From 87ab50b23bba5b06e7baa63bac3baf798ab7c480 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 19 May 2020 01:53:50 +0300 Subject: [PATCH 1/3] Introduced readies submodule --- .circleci/config.yml | 15 ++ .gitmodules | 3 + opt/Makefile | 1 + opt/readies | 1 + opt/readies/.gitignore | 36 ----- opt/readies/LICENSE | 29 ---- opt/readies/README.md | 9 -- opt/readies/bin/filter-colors | 4 - opt/readies/bin/getdocker | 61 -------- opt/readies/bin/getgosu | 36 ----- opt/readies/bin/getpy2 | 35 ----- opt/readies/bin/getpy3 | 35 ----- opt/readies/bin/getredis5 | 57 ------- opt/readies/bin/platform | 53 ------- opt/readies/bin/python | 7 - opt/readies/bin/python2 | 7 - opt/readies/bin/sep | 6 - opt/readies/bin/sep0 | 6 - opt/readies/bin/system-setup.py | 48 ------ opt/readies/cetara/README.md | 0 opt/readies/cetara/diag/gdb.c | 131 ---------------- opt/readies/cetara/diag/gdb.h | 12 -- opt/readies/mk/README.md | 0 opt/readies/mk/bindirs.defs | 11 -- opt/readies/mk/bindirs.rules | 22 --- opt/readies/mk/build.defs | 3 - opt/readies/mk/build.rules | 20 --- opt/readies/mk/cmake.defs | 18 --- opt/readies/mk/cmake.rules | 15 -- opt/readies/mk/common.defs | 21 --- opt/readies/mk/common.rules | 6 - opt/readies/mk/configure.defs | 13 -- opt/readies/mk/configure.rules | 12 -- opt/readies/mk/coverage.defs | 51 ------- opt/readies/mk/coverage.rules | 11 -- opt/readies/mk/defs | 15 -- opt/readies/mk/docker | 123 --------------- opt/readies/mk/functions | 5 - opt/readies/mk/git.defs | 5 - opt/readies/mk/help.defs | 4 - opt/readies/mk/help.rules | 13 -- opt/readies/mk/macosx.defs | 42 ------ opt/readies/mk/main | 50 ------ opt/readies/mk/nproc.defs | 6 - opt/readies/mk/platform.defs | 7 - opt/readies/mk/rules | 21 --- opt/readies/mk/variant.defs | 56 ------- opt/readies/mk/variant.rules | 7 - opt/readies/paella/README.md | 0 opt/readies/paella/__init__.py | 33 ---- opt/readies/paella/debug.py | 21 --- opt/readies/paella/docopt1.py | 25 --- opt/readies/paella/files.py | 70 --------- opt/readies/paella/log.py | 6 - opt/readies/paella/platform.py | 260 -------------------------------- opt/readies/paella/setup.py | 254 ------------------------------- opt/readies/paella/utils.py | 12 -- opt/readies/paella/utils2.py | 9 -- opt/readies/paella/utils3.py | 10 -- opt/readies/shibumi/README.md | 0 opt/readies/shibumi/functions | 35 ----- opt/readies/shibumi/here | 3 - 62 files changed, 20 insertions(+), 1867 deletions(-) create mode 100644 .gitmodules create mode 160000 opt/readies delete mode 100755 opt/readies/.gitignore delete mode 100755 opt/readies/LICENSE delete mode 100755 opt/readies/README.md delete mode 100644 opt/readies/bin/filter-colors delete mode 100755 opt/readies/bin/getdocker delete mode 100644 opt/readies/bin/getgosu delete mode 100755 opt/readies/bin/getpy2 delete mode 100755 opt/readies/bin/getpy3 delete mode 100755 opt/readies/bin/getredis5 delete mode 100755 opt/readies/bin/platform delete mode 100755 opt/readies/bin/python delete mode 100755 opt/readies/bin/python2 delete mode 100755 opt/readies/bin/sep delete mode 100755 opt/readies/bin/sep0 delete mode 100644 opt/readies/bin/system-setup.py delete mode 100644 opt/readies/cetara/README.md delete mode 100755 opt/readies/cetara/diag/gdb.c delete mode 100755 opt/readies/cetara/diag/gdb.h delete mode 100644 opt/readies/mk/README.md delete mode 100755 opt/readies/mk/bindirs.defs delete mode 100755 opt/readies/mk/bindirs.rules delete mode 100755 opt/readies/mk/build.defs delete mode 100755 opt/readies/mk/build.rules delete mode 100755 opt/readies/mk/cmake.defs delete mode 100755 opt/readies/mk/cmake.rules delete mode 100755 opt/readies/mk/common.defs delete mode 100755 opt/readies/mk/common.rules delete mode 100755 opt/readies/mk/configure.defs delete mode 100755 opt/readies/mk/configure.rules delete mode 100644 opt/readies/mk/coverage.defs delete mode 100644 opt/readies/mk/coverage.rules delete mode 100755 opt/readies/mk/defs delete mode 100644 opt/readies/mk/docker delete mode 100755 opt/readies/mk/functions delete mode 100644 opt/readies/mk/git.defs delete mode 100755 opt/readies/mk/help.defs delete mode 100755 opt/readies/mk/help.rules delete mode 100644 opt/readies/mk/macosx.defs delete mode 100755 opt/readies/mk/main delete mode 100644 opt/readies/mk/nproc.defs delete mode 100644 opt/readies/mk/platform.defs delete mode 100755 opt/readies/mk/rules delete mode 100755 opt/readies/mk/variant.defs delete mode 100755 opt/readies/mk/variant.rules delete mode 100644 opt/readies/paella/README.md delete mode 100755 opt/readies/paella/__init__.py delete mode 100755 opt/readies/paella/debug.py delete mode 100755 opt/readies/paella/docopt1.py delete mode 100755 opt/readies/paella/files.py delete mode 100755 opt/readies/paella/log.py delete mode 100755 opt/readies/paella/platform.py delete mode 100755 opt/readies/paella/setup.py delete mode 100755 opt/readies/paella/utils.py delete mode 100755 opt/readies/paella/utils2.py delete mode 100755 opt/readies/paella/utils3.py delete mode 100644 opt/readies/shibumi/README.md delete mode 100755 opt/readies/shibumi/functions delete mode 100755 opt/readies/shibumi/here diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f2c11a87..b9caa0c65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,9 @@ commands: type: string steps: - checkout + - run: + name: Submodule checkout + command: git submodule update --init --recursive - restore_cache: keys: - v1-dependencies-{{ checksum "get_deps.sh" }} @@ -34,6 +37,9 @@ commands: type: string steps: - checkout + - run: + name: Submodule checkout + command: git submodule update --init --recursive - run: name: Build command: make -C opt all SHOW=1 @@ -81,6 +87,9 @@ jobs: - image: redisfab/rmbuilder:6.0.1-x64-buster steps: - checkout + - run: + name: Submodule checkout + command: git submodule update --init --recursive - restore_cache: keys: - build-dependencies-{{ checksum "get_deps.sh" }} @@ -127,6 +136,9 @@ jobs: image: ubuntu-1604:201903-01 steps: - checkout + - run: + name: Submodule checkout + command: git submodule update --init --recursive - run: name: Checkout LFS command: | @@ -154,6 +166,9 @@ jobs: image: ubuntu-1604-cuda-10.1:201909-23 steps: - checkout + - run: + name: Submodule checkout + command: git submodule update --init --recursive - run: name: Build command: | diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..cf3c17099 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "opt/readies"] + path = opt/readies + url = https://github.com/RedisLabsModules/readies.git diff --git a/opt/Makefile b/opt/Makefile index dd6c7cee4..47bfc81ff 100755 --- a/opt/Makefile +++ b/opt/Makefile @@ -1,5 +1,6 @@ ROOT:=.. +MK.pyver:=3 include readies/mk/main MK.cmake:=1 diff --git a/opt/readies b/opt/readies new file mode 160000 index 000000000..3ee684db7 --- /dev/null +++ b/opt/readies @@ -0,0 +1 @@ +Subproject commit 3ee684db718810bc19022d1946b5ffeae329d7b9 diff --git a/opt/readies/.gitignore b/opt/readies/.gitignore deleted file mode 100755 index 5ff250e4c..000000000 --- a/opt/readies/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -# Object files -*.o -*.ko -*.obj -*.elf -*.lib -*.a -*.la -*.lo -*.dll -*.so -*.so.* -*.dylib -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# C/C++ -*.gch -*.pch -*.d - -# Python -*.pyc - -# CMake -CMakeFiles/ -*.cmake -CMakeCache.txt - -# Eclipse -.cproject -.project diff --git a/opt/readies/LICENSE b/opt/readies/LICENSE deleted file mode 100755 index bf39fd1a1..000000000 --- a/opt/readies/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2019, Redis Labs Modules -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/opt/readies/README.md b/opt/readies/README.md deleted file mode 100755 index a490b311a..000000000 --- a/opt/readies/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Library cluster of common Redis Modules code - -Cetara: C/C++ - -Paella: Python - -Shibumi: Bash - -mk: GNU Make diff --git a/opt/readies/bin/filter-colors b/opt/readies/bin/filter-colors deleted file mode 100644 index b51496e17..000000000 --- a/opt/readies/bin/filter-colors +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -sed 's/\x1b\[[0-9;]*m//g' - diff --git a/opt/readies/bin/getdocker b/opt/readies/bin/getdocker deleted file mode 100755 index 1c64f8489..000000000 --- a/opt/readies/bin/getdocker +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os -import argparse - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) -import paella - -#---------------------------------------------------------------------------------------------- - -class DockerSetup(paella.Setup): - def __init__(self, nop=False, no_install=False, no_exp=False): - self.no_install = no_install - self.no_exp = no_exp - paella.Setup.__init__(self, nop) - - def debian_compat(self): - if self.no_install: - return - self.install("apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release") - self.run("curl -fsSL https://download.docker.com/linux/{}/gpg | apt-key add -".format(self.dist)) - self.add_repo("'deb [arch=amd64] https://download.docker.com/linux/debian {} stable'".format(sh("lsb_release -cs"))) - self.run("apt-get -qq update") - self.install("docker-ce docker-ce-cli containerd.io") - - def redhat_compat(self): - if self.no_install: - return - self.install("yum-utils device-mapper-persistent-data lvm2") - self.add_repo("https://download.docker.com/linux/centos/docker-ce.repo") - self.install("docker-ce docker-ce-cli containerd.io") - - def fedora(self): - if self.no_install: - return - self.add_repo("https://download.docker.com/linux/fedora/docker-ce.repo") - self.install("docker-ce docker-ce-cli containerd.io") - - def common_last(self): - if self.no_exp: - return - self.install("jq moreutils") - self.run("mkdir -p ~/.docker") - self.run("if [ ! -f ~/.docker/config.json ]; then echo '{}' > ~/.docker/config.json; fi") - self.run("jq '.experimental = \"enabled\"' ~/.docker/config.json | sponge ~/.docker/config.json") - if self.has_command("systemctl"): - self.run("systemctl restart docker") - else: - self.run("service docker restart") - pass - -#---------------------------------------------------------------------------------------------- - -parser = argparse.ArgumentParser(description='Install Docker CE') -parser.add_argument('-n', '--nop', action="store_true", help='no operation') -parser.add_argument('--just-enable-exp', action="store_true", help='no install, just enable experimental features') -parser.add_argument('--no-exp', action="store_true", help="don't enable experimental features") -args = parser.parse_args() - -DockerSetup(nop = args.nop, no_install=args.just_enable_exp, no_exp=args.no_exp).setup() diff --git a/opt/readies/bin/getgosu b/opt/readies/bin/getgosu deleted file mode 100644 index b1fa736bd..000000000 --- a/opt/readies/bin/getgosu +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python2 - -import os -import sys - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) -import paella - -platform = paella.Platform() - -gosu_arch={ - "x64": "amd64", - "arm64v8": "arm64", - "arm32v7": "armhf" -} - -version = os.environ.get('GOSU_VERSION', '1.11') - -gosu = "https://github.com/tianon/gosu/releases/download/{}/gosu-{}".format(version, gosu_arch[platform.arch]) -# paella.wget(gosu, dest='/usr/local/bin/gosu') -# the former fails with: -# urllib2.URLError: -# thus falling back to wget -sh("wget -q -O /usr/local/bin/gosu {}".format(gosu)) - -# paella.wget(gosu + ".asc", dest='/usr/local/bin/gosu.asc') - -## note: gpg sometimes fails due to network problems, disabling ipv6 helps -# export GNUPGHOME="$(mktemp -d)" -# echo "disable-ipv6" >> $GNUPGHOME/dirmngr.conf -# gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 -# gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu -# gpgconf --kill all -# rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc - -os.chmod('/usr/local/bin/gosu', 0755) diff --git a/opt/readies/bin/getpy2 b/opt/readies/bin/getpy2 deleted file mode 100755 index 14bb045c8..000000000 --- a/opt/readies/bin/getpy2 +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" - -. $HERE/../shibumi/functions - -[ "$VERBOSE" = "1" ] && set -x - -if [ ! -z $(command -v python) ]; then - [ "$(python --version 2>&1 | cut -d" " -f2 | cut -d. -f1)" = "2" ] && exit 0 -fi - -[ ! -z $(command -v python2) ] && exit 0 -[ ! -z $(command -v python2.7) ] && exit 0 - -[[ $CHECK == 1 ]] && exit 1 - -if [ ! -z $(command -v apt-get) ]; then - runn apt-get -qq update - runn apt-get -qq install -y python -elif [ ! -z $(command -v dnf) ]; then - runn dnf install -y python2 -elif [ ! -z $(command -v yum) ]; then - runn yum install -y python2 -elif [ ! -z $(command -v apk) ]; then - runn apk update - runn apk add python2 -elif [ ! -z $(command -v brew) ]; then - runn brew install python2 -fi - -if [ -z $(command -v python) ]; then - >&2 echo "Cannot install Python2. Aborting." - exit 1 -fi diff --git a/opt/readies/bin/getpy3 b/opt/readies/bin/getpy3 deleted file mode 100755 index d54e5d7f9..000000000 --- a/opt/readies/bin/getpy3 +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" - -. $HERE/../shibumi/functions - -[ "$VERBOSE" = "1" ] && set -x - -if [ ! -z $(command -v python) ]; then - [ "$(python --version 2>&1 | cut -d" " -f2 | cut -d. -f1)" = "3" ] && exit 0 -fi - -[ ! -z $(command -v python3) ] && exit 0 - -[[ $CHECK == 1 ]] && exit 1 - -if [ ! -z $(command -v apt-get) ]; then - runn apt-get -qq update - runn apt-get -qq install -y python3 -elif [ ! -z $(command -v dnf) ]; then - runn dnf install -y python3 -elif [ ! -z $(command -v yum) ]; then - runn yum install -y epel-release - runn yum install -y python36 -elif [ ! -z $(command -v apk) ]; then - runn apk update - runn apk add python3 -elif [ ! -z $(command -v brew) ]; then - runn brew install python3 -fi - -if [ -z $(command -v python3) ]; then - >&2 echo "Cannot install Python3. Aborting." - exit 1 -fi diff --git a/opt/readies/bin/getredis5 b/opt/readies/bin/getredis5 deleted file mode 100755 index ee77c79f7..000000000 --- a/opt/readies/bin/getredis5 +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os -import argparse - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) -import paella - -os.environ["PYTHONWARNINGS"] = 'ignore:DEPRECATION::pip._internal.cli.base_command' - -#---------------------------------------------------------------------------------------------- - -class Redis5Setup(paella.Setup): - def __init__(self, nop=False): - paella.Setup.__init__(self, nop) - - def common_first(self): - pass - - def debian_compat(self): - # https://chilts.org/installing-redis-from-chris-leas-ppa/ - self.add_repo("ppa:chris-lea/redis-server") - self.install("redis-server") - # if not removed, might break apt-get update - self.run("add-apt-repository -r -y ppa:chris-lea/redis-server") - - def redhat_compat(self): - # https://linuxize.com/post/how-to-install-and-configure-redis-on-centos-7/ - self.install("epel-release yum-utils") - - self.install("http://rpms.remirepo.net/enterprise/remi-release-7.rpm") - self.run("yum-config-manager -y --enable remi") - self.install("redis") - - def fedora(self): - self.install("dnf-plugins-core") - - self.install("https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm") - self.install("--allowerasing https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm") - self.install("http://rpms.remirepo.net/enterprise/remi-release-7.rpm") - self.run("dnf config-manager -y --set-enabled remi") - self.install("redis") - - def macosx(self): - self.install("redis") - - def common_last(self): - pass - -#---------------------------------------------------------------------------------------------- - -parser = argparse.ArgumentParser(description='Set up system for build.') -parser.add_argument('-n', '--nop', action="store_true", help='no operation') -args = parser.parse_args() - -Redis5Setup(nop = args.nop).setup() diff --git a/opt/readies/bin/platform b/opt/readies/bin/platform deleted file mode 100755 index e3570d2fd..000000000 --- a/opt/readies/bin/platform +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import os -import argparse - -READIES_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), "..")) -sys.path.insert(0, READIES_PATH) -import paella - -parser = argparse.ArgumentParser(description='Report platform characteristics.') -parser.add_argument('--os', action="store_true", help='Operating system') -parser.add_argument('--version', action="store_true", help='OS/Distribution version') -parser.add_argument('--dist', action="store_true", help='Linux distribution (if applicable)') -parser.add_argument('--osnick', action="store_true", help='OS/distribution/version is a single word') -parser.add_argument('--arch', action="store_true", help='CPU Architecture') -parser.add_argument('--kernel', action="store_true", help='Kernel version (if applicable)') -parser.add_argument('--glibc', action="store_true", help='GLIBC version (if applicable)') -parser.add_argument('--strict', action="store_true", help='Fail if cannot identify platform') -args = parser.parse_args() - -try: - platform = paella.Platform(strict=args.strict) -except: - eprint("platform: cannot identify") - exit(1) -ret = "" -if args.os: - ret += " " + platform.os -if args.osnick: - ret += " " + platform.osnick -if args.dist: - ret += " " + platform.dist -if args.version: - ret += " " + platform.os_ver -if args.arch: - ret += " " + platform.arch -if args.kernel: - pass -if args.glibc: - pass -if ret == "": - os = platform.os - dist = platform.dist - if dist != "": - os = dist + " " + os - if platform.osnick != "": - nick = " (" + platform.osnick + ")" - else: - nick = "" - ret = os + " " + platform.os_ver + nick + " " + platform.arch -if ret.strip() != "": - print(ret.strip()) diff --git a/opt/readies/bin/python b/opt/readies/bin/python deleted file mode 100755 index 814ff07ce..000000000 --- a/opt/readies/bin/python +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ ! -z $(command -v python3) ]; then - python3 "$@" -else - python "$@" -fi diff --git a/opt/readies/bin/python2 b/opt/readies/bin/python2 deleted file mode 100755 index f46ed5a8e..000000000 --- a/opt/readies/bin/python2 +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ ! -z $(command -v python2) ]; then - python2 "$@" -else - python "$@" -fi diff --git a/opt/readies/bin/sep b/opt/readies/bin/sep deleted file mode 100755 index 9d41b81fa..000000000 --- a/opt/readies/bin/sep +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import os -rows, cols = os.popen('stty size', 'r').read().split() -print("\n" + "-" * (int(cols) - 1) + "\n") - diff --git a/opt/readies/bin/sep0 b/opt/readies/bin/sep0 deleted file mode 100755 index d5555910a..000000000 --- a/opt/readies/bin/sep0 +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import os -rows, cols = os.popen('stty size', 'r').read().split() -print("-" * (int(cols) - 1) + "\n") - diff --git a/opt/readies/bin/system-setup.py b/opt/readies/bin/system-setup.py deleted file mode 100644 index 5acb059b1..000000000 --- a/opt/readies/bin/system-setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python2 - -import sys -import os -import argparse - -HERE=os.path.join(os.path.dirname(__file__) -sys.path.insert(0, HERE, "..")) -import paella - -#---------------------------------------------------------------------------------------------- - -class SystemSetup(paella.Setup): - def __init__(self, nop=False): - paella.Setup.__init__(self, nop) - - def common_first(self): - # self.install("") - # self.group_install("") - # self.setup_pip() - # self.pip_install("") - pass - - def debian_compat(self): - pass - - def redhat_compat(self): - pass - - def fedora(self): - pass - - def macosx(self): - pass - - def common_last(self): - pass - -#---------------------------------------------------------------------------------------------- - -parser = argparse.ArgumentParser(description='Set up system for build.') -parser.add_argument('-n', '--nop', action="store_true", help='no operation') -# parser.add_argument('--bool', action="store_true", help="flag") -# parser.add_argument('--int', type=int, default=1, help='number') -# parser.add_argument('--str', type=str, default='str', help='number') -args = parser.parse_args() - -SystemSetup(nop = args.nop).setup() diff --git a/opt/readies/cetara/README.md b/opt/readies/cetara/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/opt/readies/cetara/diag/gdb.c b/opt/readies/cetara/diag/gdb.c deleted file mode 100755 index d4eb44ca6..000000000 --- a/opt/readies/cetara/diag/gdb.c +++ /dev/null @@ -1,131 +0,0 @@ - -#include -#include - -#include "readies/cetara/diag/gdb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef __linux__ - -static inline bool _via_gdb_simple() -{ - const int status_fd = open("/proc/self/status", O_RDONLY); - if (status_fd == -1) - return false; - - char buf[4096]; - const ssize_t num_read = read(status_fd, buf, sizeof(buf) - 1); - if (num_read <= 0) - return false; - - buf[num_read] = '\0'; - char tracer_pid[] = "TracerPid:"; - const char *tracer_pid_p = strstr(buf, tracer_pid); - if (!tracer_pid_p) - return false; - - for (const char *p = tracer_pid_p + sizeof(tracer_pid) - 1; p <= buf + num_read; ++p) - { - if (isspace(*p)) - continue; - return isdigit(*p) && *p != '0'; - } - - return false; -} - -static inline bool _via_gdb() -{ - if (_via_gdb_simple()) - return true; - - int pid; - int from_child[2] = {-1, -1}; - - if (pipe(from_child) < 0) { - fprintf(stderr, "Debugger check failed: Error opening internal pipe: %s", strerror(errno)); - return false; - } - - pid = fork(); - if (pid == -1) { - fprintf(stderr, "Debugger check failed: Error forking: %s", strerror(errno)); - return false; - } - - if (pid == 0) // child - { - uint8_t ret = 0; - int ppid = getppid(); - - close(from_child[0]); // close parent's side - - if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0) - { - waitpid(ppid, NULL, 0); // wait for the parent to stop - write(from_child[1], &ret, sizeof(ret)); // tell the parent what happened - - ptrace(PTRACE_DETACH, ppid, NULL, NULL); - exit(0); - } - - ret = 1; - write(from_child[1], &ret, sizeof(ret)); // tell the parent what happened - - exit(0); - - } - else // parent - { - uint8_t ret = -1; - - // child writes a 1 if pattach failed else 0. - // read may be interrupted by pattach, hence the loop. - while (read(from_child[0], &ret, sizeof(ret)) < 0 && errno == EINTR) - ; - - // ret not updated - if (ret < 0) - fprintf(stderr, "Debugger check failed: Error getting status from child: %s", strerror(errno)); - - // close the pipes here, to avoid races with pattach (if we did it above) - close(from_child[1]); - close(from_child[0]); - - waitpid(pid, NULL, 0); // collect the status of the child - - return ret == 1; - } -} - -#elif defined(__APPLE__) - -static inline bool _via_gdb() -{ -} - -#endif - -//--------------------------------------------------------------------------------------------- - -bool __via_gdb = false; - -__attribute__((constructor)) -static void initialize(void) -{ - __via_gdb = _via_gdb(); -} - -/////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/opt/readies/cetara/diag/gdb.h b/opt/readies/cetara/diag/gdb.h deleted file mode 100755 index 458a7e15b..000000000 --- a/opt/readies/cetara/diag/gdb.h +++ /dev/null @@ -1,12 +0,0 @@ - -#pragma once - -#include - -extern bool __via_gdb; - -#ifdef __arm__ -#define BB do { if (__via_gdb) { __asm__("trap"); } } while(0) -#else -#define BB do { if (__via_gdb) { __asm__("int $3"); } } while(0) -#endif \ No newline at end of file diff --git a/opt/readies/mk/README.md b/opt/readies/mk/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/opt/readies/mk/bindirs.defs b/opt/readies/mk/bindirs.defs deleted file mode 100755 index 48fadc04e..000000000 --- a/opt/readies/mk/bindirs.defs +++ /dev/null @@ -1,11 +0,0 @@ - -ifndef BINROOT -BINROOT=$(ROOT)/bin/$(FULL_VARIANT) -endif -BINROOT.release=$(ROOT)/bin/$(FULL_VARIANT.release) -BIN_DIRS=$(sort $(patsubst %/,%,$(BINDIR) $(dir $(OBJECTS))) $(BINDIRS)) - -define mkdir_rule -$(1): - $$(SHOW)mkdir -p $(1) -endef diff --git a/opt/readies/mk/bindirs.rules b/opt/readies/mk/bindirs.rules deleted file mode 100755 index bf2d5fe87..000000000 --- a/opt/readies/mk/bindirs.rules +++ /dev/null @@ -1,22 +0,0 @@ - -ifneq ($(MK.nobindir),1) - -ifeq ($(BINDIR),) -$(error BINDIR is undefined) -endif - -.PHONY: bindirs - -bindirs: $(BIN_DIRS) - -ifeq ($(DIAG),1) -$(info *** BIN_DIRS=$(BIN_DIRS)) -endif - -$(foreach DIR,$(BIN_DIRS),$(eval $(call mkdir_rule,$(DIR)))) - -else - -bindirs: ; - -endif # MK.nobindir diff --git a/opt/readies/mk/build.defs b/opt/readies/mk/build.defs deleted file mode 100755 index 78ac8dd8d..000000000 --- a/opt/readies/mk/build.defs +++ /dev/null @@ -1,3 +0,0 @@ - -MK_CLEAN_DIR=$(SRCDIR) -MK_CLEAN_ALL_DIRS += $(BINDIR) diff --git a/opt/readies/mk/build.rules b/opt/readies/mk/build.rules deleted file mode 100755 index 02862f8db..000000000 --- a/opt/readies/mk/build.rules +++ /dev/null @@ -1,20 +0,0 @@ - -.PHONY: build clean - -ifeq ($(DIAG),1) -$(info *** DEFAULT_TARGETS=$(DEFAULT_TARGETS)) -$(info *** MK_MAKEFILES=$(MK_MAKEFILES)) -endif - -build: $(DEFAULT_TARGETS) $(MK_MAKEFILES) $(TARGET) - -ifneq ($(MK_CUSTOM_CLEAN),1) - -clean: -ifeq ($(ALL),1) - $(SHOW)if [ ! -z "$(MK_CLEAN_ALL_DIRS)" ]; then rm -rf $(sort $(MK_CLEAN_ALL_DIRS)); fi -else - $(SHOW)$(MAKE) clean -C $(MK_CLEAN_DIR) -endif - -endif # MK_CUSTOM_CLEAN diff --git a/opt/readies/mk/cmake.defs b/opt/readies/mk/cmake.defs deleted file mode 100755 index 7c1d6d693..000000000 --- a/opt/readies/mk/cmake.defs +++ /dev/null @@ -1,18 +0,0 @@ - -ifneq ($(MK.cmake),) - -MK_CMAKE_FILES ?= $(SRCDIR)/CMakeLists.txt - -MK_MAKEFILES += $(BINDIR)/Makefile -DEFAULT_TARGETS += cmake-build - -ifeq ($(DEBUG),1) -CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=Debug -endif - -ifeq ($(WHY),1) -CMAKE_WHY=--trace-expand -CMAKE_SINK= >/tmp/cmake.why 2>&1 -endif - -endif # MK.cmake diff --git a/opt/readies/mk/cmake.rules b/opt/readies/mk/cmake.rules deleted file mode 100755 index e553c7b63..000000000 --- a/opt/readies/mk/cmake.rules +++ /dev/null @@ -1,15 +0,0 @@ - -ifneq ($(MK.cmake),) - -$(BINDIR)/Makefile : $(MK_CMAKE_FILES) - $(SHOW)if [ ! -d $(BINDIR) ]; then echo "CMake: $(BINDIR) does not exist."; exit 1; fi - $(SHOW)cd $(BINDIR); cmake $(CMAKE_WHY) $(CMAKE_FLAGS) $(abspath $(SRCDIR)) $(CMAKE_SINK) - -ifneq ($(MK_CUSTOM_CMAKE_BUILD),1) - -cmake-build $(TARGET): $(MK_MAKEFILES) - $(SHOW)$(MAKE) -C $(BINDIR) - -endif - -endif # MK.cmake diff --git a/opt/readies/mk/common.defs b/opt/readies/mk/common.defs deleted file mode 100755 index 976aedd61..000000000 --- a/opt/readies/mk/common.defs +++ /dev/null @@ -1,21 +0,0 @@ - -_SHOW:=$(SHOW) -ifeq ($(_SHOW),) -_SHOW:=0 -endif -ifeq ($(SHOW),1) -override SHOW:= -else -override SHOW:=@ -endif - -MAKEFLAGS += --no-builtin-rules --no-print-directory -# --no-builtin-variables - -define __SEP -import os; rows, cols = os.popen('stty size', 'r').read().split(); print('-' * (int(cols) - 1) + \"\n\") -endef - -ifneq ($(filter cov-upload,$(MAKECMDGOALS)),) -COV=1 -endif diff --git a/opt/readies/mk/common.rules b/opt/readies/mk/common.rules deleted file mode 100755 index 633cf2f6b..000000000 --- a/opt/readies/mk/common.rules +++ /dev/null @@ -1,6 +0,0 @@ - -.PHONY: __sep - -__sep: ; -# @python -c "$(__SEP)" - diff --git a/opt/readies/mk/configure.defs b/opt/readies/mk/configure.defs deleted file mode 100755 index 6b4f5fa20..000000000 --- a/opt/readies/mk/configure.defs +++ /dev/null @@ -1,13 +0,0 @@ - -ifneq (,$(MK.configure)) - -CONFIGURE_FLAGS = $(CONFIGURE_FLAGS.$(OS)) - -CONFIGURE_BUILD_DIR ?= $(BINDIR) - -CONFIGURE_TARGET ?= $(TARGET) - -MK_CLEAN_DIR=$(CONFIGURE_BUILD_DIR) -MK_CLEAN_ALL_DIRS += $(CONFIGURE_BUILD_DIR) - -endif # MK.configure diff --git a/opt/readies/mk/configure.rules b/opt/readies/mk/configure.rules deleted file mode 100755 index 8378279d9..000000000 --- a/opt/readies/mk/configure.rules +++ /dev/null @@ -1,12 +0,0 @@ - -ifneq (,$(MK.configure)) - -$(CONFIGURE_BUILD_DIR)/Makefile: $(SRCDIR)/configure - $(SHOW)set -e ;\ - cd $(CONFIGURE_BUILD_DIR) ;\ - $(abspath $(SRCDIR))/configure $(CONFIGURE_FLAGS) - -$(CONFIGURE_TARGET): $(CONFIGURE_BUILD_DIR)/Makefile - $(SHOW)make -C $(CONFIGURE_BUILD_DIR) -j $(NPROC) - -endif # MK.configure diff --git a/opt/readies/mk/coverage.defs b/opt/readies/mk/coverage.defs deleted file mode 100644 index f38f8d9ba..000000000 --- a/opt/readies/mk/coverage.defs +++ /dev/null @@ -1,51 +0,0 @@ - -ifneq ($(filter cov-upload,$(MAKECMDGOALS)),) -COV=1 -endif - -ifeq ($(COV),1) - -CC_FLAGS.coverage += --coverage -LD_FLAGS.coverage += --coverage - -COV_INFO=$(BINROOT)/cov.info -COV_DIR=$(BINROOT)/cov - -COV_EXCLUDE += \ - '/Applications/*' \ - '/usr/*' - -define COVERAGE_RESET -$(SHOW)set -e ;\ -echo "Starting coverage analysys." ;\ -mkdir -p $(COV_DIR) ;\ -lcov --directory $(BINROOT) --base-directory $(SRCDIR) -z > /dev/null 2>&1 -endef - -define COVERAGE_COLLECT -$(SHOW)set -e ;\ -echo "Collecting coverage data ..." ;\ -lcov --capture --directory $(BINROOT) --base-directory $(SRCDIR) --output-file $(COV_INFO) > /dev/null 2>&1 ;\ -lcov -o $(COV_INFO) -r $(COV_INFO) $(COV_EXCLUDE) > /dev/null 2>&1 -endef - -define COVERAGE_REPORT -$(SHOW)set -e ;\ -lcov -l $(COV_INFO) ;\ -genhtml --legend -o $(COV_DIR) $(COV_INFO) > /dev/null 2>&1 ;\ -echo "Coverage info at $$(realpath $(COV_DIR))/index.html" -endef - -define COVERAGE_COLLECT_REPORT -$(COVERAGE_COLLECT) -$(COVERAGE_REPORT) -endef - -else - -COVERAGE_RESET= -COVERAGE_COLLECT= -COVERAGE_REPORT= -COVERAGE_COLLECT_REPORT= - -endif # COV diff --git a/opt/readies/mk/coverage.rules b/opt/readies/mk/coverage.rules deleted file mode 100644 index 6f3ee0671..000000000 --- a/opt/readies/mk/coverage.rules +++ /dev/null @@ -1,11 +0,0 @@ - -ifeq ($(COV),1) - -cov-upload: -ifneq ($(CODECOV_TOKEN),) - $(SHOW)bash <(curl -s https://codecov.io/bash) -f $(COV_INFO) -else - @echo "To upload to codecov.io, please define CODECOV_TOKEN for this module." -endif - -endif # COV diff --git a/opt/readies/mk/defs b/opt/readies/mk/defs deleted file mode 100755 index 7ba0de577..000000000 --- a/opt/readies/mk/defs +++ /dev/null @@ -1,15 +0,0 @@ - -include $(MK)/help.defs -include $(MK)/build.defs - -ifneq ($(MK.cmake),) -include $(MK)/cmake.defs -endif - -ifneq ($(MK.configure),) -include $(MK)/configure.defs -endif - -ifeq ($(COV),1) -include $(MK)/coverage.defs -endif diff --git a/opt/readies/mk/docker b/opt/readies/mk/docker deleted file mode 100644 index 1679e95d4..000000000 --- a/opt/readies/mk/docker +++ /dev/null @@ -1,123 +0,0 @@ - -.NOTPARALLEL: - -MK.nobindir=1 - -MK_ALL_TARGETS=build publish - -ifeq ($(VERSION),) -VERSION:=$(patsubst v%,%,$(shell git describe --tags `git rev-list --tags --max-count=1`)) -endif -ifeq ($(VERSION),) -$(error Cannot determine version. Aborting.) -endif - -BUILD_OPT=--rm -# --squash - -DOCKERFILE_STEM ?= $(ROOT)/Dockerfile - -#---------------------------------------------------------------------------------------------- - -define HELP -make build # build Docker images - X86=1 # build x64 Docker image - ARM7=1 # build arm32v7 Docker image - ARM8=1 # build arm64v8 Docker image -make publish # build and push multi-arch Docker manifest - X86=1 # push x64 Docker image and multi-arch manifest - ARM7=1 # push arm32v7 Docker image and multi-arch manifest - ARM8=1 # push arm64v8 Docker image and multi-arch manifest - PUSH=0 # only push multi-arch manifest -make show # display registry information from Docker repo - -Other arguments: - VERSION=x.y.z # build and publish version x.y.z - OSNICK=nick # nick=buster|stretch|bionic -endef - -#---------------------------------------------------------------------------------------------- - -define targets # (1=OP, 2=op) -$(1)_TARGETS := -$(1)_TARGETS += $(if $(findstring $(X64),1),$(2)_x64) -$(1)_TARGETS += $(if $(findstring $(ARM7),1),$(2)_arm32v7) -$(1)_TARGETS += $(if $(findstring $(ARM8),1),$(2)_arm64v8) - -$(1)_TARGETS += $$(if $$(strip $$($(1)_TARGETS)),,$(2)_x64 $(2)_arm32v7 $(2)_arm64v8) -endef - -$(eval $(call targets,BUILD,build)) -$(eval $(call targets,PUSH,push)) - -#---------------------------------------------------------------------------------------------- - -define build_x64 # (1=arch) -build_$(1): - @docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-x64 -f $(DOCKERFILE_STEM) \ - $(foreach A,$(DOCKER_BUILD_ARGS),--build-arg $(A)) \ - $(ROOT) - -.PHONY: build_$(1) -endef - -define build_arm # (1=arch) -build_$(1): - @docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-$(1) -f $(DOCKERFILE_STEM).arm \ - $(foreach A,$(DOCKER_BUILD_ARGS),--build-arg $(A)) \ - --build-arg ARCH=$(1) \ - $(ROOT) - -.PHONY: build_$(1) -endef - -define push # (1=arch) -push_$(1): - @docker push $(STEM)-$(OSNICK):$(VERSION)-$(1) - -.PHONY: push_$(1) -endef - -define create_manifest # (1=version) -@docker manifest create -a $(STEM)-$(OSNICK):$(1) \ - -a $(STEM)-$(OSNICK):$(VERSION)-x64 \ - -a $(STEM)-$(OSNICK):$(VERSION)-arm64v8 \ - -a $(STEM)-$(OSNICK):$(VERSION)-arm32v7 -@docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm32v7 --os linux --arch arm --variant v7 -@docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm64v8 --os linux --arch arm64 --variant v8 -@docker manifest push -p $(STEM)-$(OSNICK):$(1) -endef - -#---------------------------------------------------------------------------------------------- - -DEFAULT_TARGETS += $(BUILD_TARGETS) - -include $(MK)/defs - -include $(MK)/rules - -$(eval $(call build_x64,x64)) -$(eval $(call build_arm,arm64v8)) -$(eval $(call build_arm,arm32v7)) - -$(eval $(call push,x64)) -$(eval $(call push,arm64v8)) -$(eval $(call push,arm32v7)) - -ifneq ($(PUSH),0) -publish: $(PUSH_TARGETS) -else -publish: -endif - $(call create_manifest,$(VERSION)) - $(call create_manifest,latest) - -show: - @echo "$(STEM)-$(OSNICK):" -ifeq ($(INSPECT),1) - @docker manifest inspect $(STEM)-$(OSNICK):$(VERSION) | jq -else - @curl -s -X "GET" https://cloud.docker.com/v2/repositories/$(STEM)-$(OSNICK)/tags/ | jq -endif - -.PHONY: build publish show diff --git a/opt/readies/mk/functions b/opt/readies/mk/functions deleted file mode 100755 index 6ae6606d2..000000000 --- a/opt/readies/mk/functions +++ /dev/null @@ -1,5 +0,0 @@ - -reverse=$(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1)) - -__EMPTY:= -__SPACE:=$(__EMPTY) $(__EMPTY) diff --git a/opt/readies/mk/git.defs b/opt/readies/mk/git.defs deleted file mode 100644 index 6a09915a9..000000000 --- a/opt/readies/mk/git.defs +++ /dev/null @@ -1,5 +0,0 @@ - -ifeq ($(shell { [ -d .git ] || git rev-parse --git-dir >/dev/null 2>&1; echo -n $$?; }),0) -GIT_SHA := $(shell git rev-parse HEAD) -GIT_COMMIT := $(shell git describe --always --abbrev=7 --dirty="+" 2>/dev/null || git rev-parse --short HEAD) -endif diff --git a/opt/readies/mk/help.defs b/opt/readies/mk/help.defs deleted file mode 100755 index 0641d1684..000000000 --- a/opt/readies/mk/help.defs +++ /dev/null @@ -1,4 +0,0 @@ - -ifneq ($(HELP),) -HELPFILE:=$(shell mktemp /tmp/make.help.XXXX) -endif diff --git a/opt/readies/mk/help.rules b/opt/readies/mk/help.rules deleted file mode 100755 index f44ae0c85..000000000 --- a/opt/readies/mk/help.rules +++ /dev/null @@ -1,13 +0,0 @@ - -ifneq ($(HELP),) - -.PHONY: help - -help: - $(file >$(HELPFILE),$(HELP)) - @echo - @cat $(HELPFILE) - @echo - @-rm -f $(HELPFILE) - -endif diff --git a/opt/readies/mk/macosx.defs b/opt/readies/mk/macosx.defs deleted file mode 100644 index 65486aa58..000000000 --- a/opt/readies/mk/macosx.defs +++ /dev/null @@ -1,42 +0,0 @@ - -ifeq ($(OS),macosx) - -#---------------------------------------------------------------------------------------------- - -# pip install --user puts packages here: -export PATH:=$(PATH):$(HOME)/Library/Python/2.7/bin - -#---------------------------------------------------------------------------------------------- - -ZLIB_PREFIX:=$(shell brew --prefix zlib) -LIBSSL_PREFIX:=$(shell brew --prefix openssl) -READLINE_PREFIX:=$(shell brew --prefix readline) -SDK_PREFIX:=$(shell xcrun --show-sdk-path) - -export CPPFLAGS:=\ - -I$(ZLIB_PREFIX)/include \ - -I$(READLINE_PREFIX)/include \ - -I$(LIBSSL_PREFIX)/include \ - -I$(SDK_PREFIX)/usr/include - -export LDFLAGS:=\ - -L$(ZLIB_PREFIX)/lib \ - -L$(LIBSSL_PREFIX)/lib \ - -L$(READLINE_PREFIX)/lib \ - -L$(SDK_PREFIX)/usr/lib - -PKG_CONFIG_DIRS += \ - $(ZLIB_PREFIX) \ - $(LIBSSL_PREFIX) \ - $(READLINE_PREFIX) - -export PKG_CONFIG_PATH:=$(subst $(__SPACE),:,$(strip $(addsuffix /lib/pkgconfig,$(PKG_CONFIG_DIRS)))):$(PKG_CONFIG_PATH) - -CONFIGURE_FLAGS.macosx += \ - CPPFLAGS='$(CPPFLAGS)' \ - LDFLAGS='$(LDFLAGS)' \ - --with-openssl=$(LIBSSL_PREFIX) - -#---------------------------------------------------------------------------------------------- - -endif # macosx diff --git a/opt/readies/mk/main b/opt/readies/mk/main deleted file mode 100755 index cd590fce6..000000000 --- a/opt/readies/mk/main +++ /dev/null @@ -1,50 +0,0 @@ - -SHELL=/bin/bash - -ifeq ($(ROOT),) -$(error ROOT is undefined) -endif - -ifneq ($(wildcard $(ROOT)/deps/readies),) -READIES:=$(ROOT)/deps/readies -else ifneq ($(wildcard $(ROOT)/opt/readies),) -READIES:=$(ROOT)/opt/readies -else -$(error Cannot find readies root) -endif - -MK:=$(READIES)/mk - -MK.pyver ?= 3 -MK.getpy=getpy$(MK.pyver) - -ifneq ($(shell { CHECK=1 $(READIES)/bin/$(MK.getpy); echo -n $$?; }),0) -ifneq ($(filter setup,$(MAKECMDGOALS)),) -$(error It seems build prerequisites have not been installed: please run 'sudo make setup'.) -endif -__NO_PYTHON=1 -endif - -MK_ALL_TARGETS:=bindirs build -DEFAULT_TARGETS:=bindirs - -SUDO:=$(shell [ $$( command -v sudo >/dev/null 2>&1; echo $$? ) = 0 ] && echo sudo) -USER:=$(shell whoami) - -include $(MK)/functions -include $(MK)/common.defs - -ifneq ($(__NO_PYTHON),1) - -include $(MK)/platform.defs - -ifeq ($(OS),macosx) -include $(MK)/macosx.defs -endif - -include $(MK)/git.defs -include $(MK)/variant.defs -include $(MK)/bindirs.defs -include $(MK)/nproc.defs - -endif # __NO_PYTHON \ No newline at end of file diff --git a/opt/readies/mk/nproc.defs b/opt/readies/mk/nproc.defs deleted file mode 100644 index 95f6d3b1f..000000000 --- a/opt/readies/mk/nproc.defs +++ /dev/null @@ -1,6 +0,0 @@ - -ifeq ($(OS),linux) -NPROC:=$(shell nproc) -else ifeq ($(OS),macosx) -NPROC:=$(shell sysctl -n hw.physicalcpu) -endif diff --git a/opt/readies/mk/platform.defs b/opt/readies/mk/platform.defs deleted file mode 100644 index 50896184e..000000000 --- a/opt/readies/mk/platform.defs +++ /dev/null @@ -1,7 +0,0 @@ - -OS:=$(shell $(READIES)/bin/platform --os) -# ifeq ($(OS),linux) -# OS:=$(shell $(READIES)/bin/platform --dist) -# endif - -ARCH=$(shell $(READIES)/bin/platform --arch) diff --git a/opt/readies/mk/rules b/opt/readies/mk/rules deleted file mode 100755 index 77bd717fa..000000000 --- a/opt/readies/mk/rules +++ /dev/null @@ -1,21 +0,0 @@ - -default: build - -include $(MK)/common.rules -include $(MK)/variant.rules -include $(MK)/bindirs.rules -include $(MK)/help.rules -include $(MK)/build.rules -include $(MK)/coverage.rules - -ifneq ($(MK.cmake),) -include $(MK)/cmake.rules -endif - -ifneq ($(MK.configure),) -include $(MK)/configure.rules -endif - -all: $(MK_ALL_TARGETS) - -.PHONY: all default diff --git a/opt/readies/mk/variant.defs b/opt/readies/mk/variant.defs deleted file mode 100755 index 4277263fa..000000000 --- a/opt/readies/mk/variant.defs +++ /dev/null @@ -1,56 +0,0 @@ - -ifeq ($(COV),1) -export DEBUG ?= 1 -endif - -ifeq ($(DEBUG),1) -FLAVOR=debug -else -FLAVOR=release -endif - -#---------------------------------------------------------------------------------------------- - -ifeq ($(COV),1) -VARIANT.list:=$(sort $(VARIANT.list) cov) -endif - -VARIANT.file:=$(shell if [ -f $(ROOT)/VARIANT ]; then cat $(ROOT)/VARIANT; fi) - -# if VARIANT not specified and we're the not in submake, use one from file, if present -ifeq ($(origin VARIANT),undefined) - ifeq ($(VARIANT.primary),) - ifneq ($(VARIANT.file),) - VARIANT:=$(VARIANT.file) - $(info VARIANT is $(VARIANT)) - endif - endif -else # VARIANT specified - ifeq ($(VARIANT.primary),) - export VARIANT.primary:=$(VARIANT) - endif -endif - -# add variant to variant list -ifneq ($(firstword $(call reverse,$(VARIANT.list))),$(VARIANT)) -export VARIANT.list:=$(strip $(VARIANT.list) $(VARIANT)) -endif - -# join strings with hyphens -VARIANT.string:=$(subst $(__SPACE),-,$(strip $(VARIANT.list))) - -ifeq ($(VARIANT.string),) -_VARIANT.string:= -else -_VARIANT.string:=-$(VARIANT.string) -endif - -FULL_VARIANT:=$(OS)-$(ARCH)-$(FLAVOR)$(_VARIANT.string) -FULL_VARIANT.release:=$(OS)-$(ARCH)-release$(_VARIANT.string) - -# if primary variant present, write it to file. otherwise, delete file -ifneq ($(VARIANT.primary),) -ifneq ($(origin VARIANT),) -$(eval $(shell if [ -z $(VARIANT) ]; then rm -f $(ROOT)/VARIANT; else echo $(VARIANT)>$(ROOT)/VARIANT; fi)) -endif -endif diff --git a/opt/readies/mk/variant.rules b/opt/readies/mk/variant.rules deleted file mode 100755 index 4bed27d15..000000000 --- a/opt/readies/mk/variant.rules +++ /dev/null @@ -1,7 +0,0 @@ - -show-variant: -ifneq ($(wildcard $(ROOT)/VARIANT),) - @cat $(ROOT)/VARIANT -else - @echo -endif diff --git a/opt/readies/paella/README.md b/opt/readies/paella/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/opt/readies/paella/__init__.py b/opt/readies/paella/__init__.py deleted file mode 100755 index 3ae11faca..000000000 --- a/opt/readies/paella/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ - -from .debug import * -from .utils import * -from .files import * -# from .docopt import docopt -from .log import * -from .platform import * -from .setup import * - -#---------------------------------------------------------------------------------------------- - -import sys - -class global_injector: - def __init__(self): - try: - # Python 2 - self.__dict__['builtin'] = sys.modules['__builtin__'].__dict__ - except KeyError: - # Python 3 - self.__dict__['builtin'] = sys.modules['builtins'].__dict__ - def __setattr__(self,name,value): - self.builtin[name] = value - -Global = global_injector() - -#---------------------------------------------------------------------------------------------- - -Global.BB = bb -Global.eprint = eprint -Global.fatal = fatal -Global.cwd = cwd -Global.sh = sh diff --git a/opt/readies/paella/debug.py b/opt/readies/paella/debug.py deleted file mode 100755 index c615a09c5..000000000 --- a/opt/readies/paella/debug.py +++ /dev/null @@ -1,21 +0,0 @@ - -import os - -#---------------------------------------------------------------------------------------------- - -pydebug = os.environ.get('PYDEBUG', '') -if pydebug == '1': - try: - from ipdb import set_trace as bb - except ImportError: - from pdb import set_trace as bb -elif pydebug == 'pudb': - from pudb import set_trace as bb -elif pydebug == 'pdb': - from pdb import set_trace as bb -elif pydebug == 'ipdb': - from ipdb import set_trace as bb -else: - def bb(): pass - -#---------------------------------------------------------------------------------------------- diff --git a/opt/readies/paella/docopt1.py b/opt/readies/paella/docopt1.py deleted file mode 100755 index dc08ee3c5..000000000 --- a/opt/readies/paella/docopt1.py +++ /dev/null @@ -1,25 +0,0 @@ - -from docopt import docopt as docopt1 -from collections import namedtuple -import re - -def dict_to_obj(d): - def add_to_dict_if_match(r, k, v, d): - m = re.match(r, k) - if m: - d[m[1].replace('-', '_')] = v - return not not m - - d1 = dict() - for k, v in d.items(): - if isinstance(v, dict): - d1[k] = dict_to_obj(v) - elif add_to_dict_if_match('--(.*)', k, v, d1): - pass - elif add_to_dict_if_match('\<(.*)\>', k, v, d1): - pass - return namedtuple('object', d1.keys())(*d1.values()) - -def docopt(*args, **kwargs): - a = docopt1(*args, **kwargs) - return dict_to_obj(a) diff --git a/opt/readies/paella/files.py b/opt/readies/paella/files.py deleted file mode 100755 index add6d6747..000000000 --- a/opt/readies/paella/files.py +++ /dev/null @@ -1,70 +0,0 @@ - -from contextlib import contextmanager -import os -import os.path -import tempfile -try: - from urllib2 import urlopen -except: - from urllib.request import urlopen - -#---------------------------------------------------------------------------------------------- - -def fread(fname, mode='rb'): - with open(fname, mode) as file: - return file.read() - -#---------------------------------------------------------------------------------------------- - -def fwrite(fname, text, mode='w'): - with open(fname, mode) as file: - return file.write(text) - -#---------------------------------------------------------------------------------------------- - -def flines(fname, mode = 'rb'): - return [line.rstrip() for line in open(fname)] - -#---------------------------------------------------------------------------------------------- - -def tempfilepath(): - fd, path = tempfile.mkstemp() - os.close(fd) - return path - -#---------------------------------------------------------------------------------------------- - -def wget(url, dest="", tempdir=False): - if dest == "": - dest = os.path.basename(url) - if dest == "": - dest = tempfilepath() - elif tempdir: - dest = os.path.join('/tmp', dest) - ufile = urlopen(url) - data = ufile.read() - with open(dest, "wb") as file: - file.write(data) - return os.path.abspath(dest) - -#---------------------------------------------------------------------------------------------- - -@contextmanager -def cwd(path): - d0 = os.getcwd() - os.chdir(str(path)) - try: - yield - finally: - os.chdir(d0) - -#---------------------------------------------------------------------------------------------- - -def mkdir_p(dir): - if dir != '': - os.makedirs(dir, exist_ok=True) - -#---------------------------------------------------------------------------------------------- - -def relpath(dir, rel): - return os.path.abspath(os.path.join(dir, rel)) diff --git a/opt/readies/paella/log.py b/opt/readies/paella/log.py deleted file mode 100755 index 3edaec3ee..000000000 --- a/opt/readies/paella/log.py +++ /dev/null @@ -1,6 +0,0 @@ - -import os - -def fatal(text): - eprint("%s: %s" %(os.path.basename(__file__), text)) - exit(1) diff --git a/opt/readies/paella/platform.py b/opt/readies/paella/platform.py deleted file mode 100755 index 9105089fb..000000000 --- a/opt/readies/paella/platform.py +++ /dev/null @@ -1,260 +0,0 @@ - -from __future__ import absolute_import -import platform -import os -import re - -#---------------------------------------------------------------------------------------------- - -class Platform: - #------------------------------------------------------------------------------------------ - class OSRelease(): - def __init__(self): - self.defs = {} - with open("/etc/os-release") as f: - for line in f: - try: - k, v = line.rstrip().split("=") - self.defs[k] = v.strip('"').strip("'") - except: - pass - - def distname(self): - return self.defs["ID"].lower() - - def version(self): - return self.defs["VERSION_ID"] - - def osnick(self): - try: - return self.defs["VERSION_CODENAME"] - except: - return "" - - #------------------------------------------------------------------------------------------ - - def __init__(self, strict=False): - self.os = self.dist = self.os_ver = self.full_os_ver = self.osnick = self.arch = '?' - - # self.os = os.getenv("READIES_PLATFORM_OS", '?') - # self.dist = os.getenv("READIES_PLATFORM_DIST", '?') - # self.os_ver = os.getenv("READIES_PLATFORM_OS_VER", '?') - # self.full_os_ver = os.getenv("READIES_PLATFORM_FULL_OS_VER", '?') - # self.osnick = os.getenv("READIES_PLATFORM_OSNICK", '?') - # self.arch = os.getenv("READIES_PLATFORM_ARCH", '?') - - self.os = platform.system().lower() - if self.os == 'linux': - if False: - dist = platform.linux_distribution() - distname = dist[0].lower() - self.os_ver = self.full_os_ver = dist[1] - else: - try: - os_release = Platform.OSRelease() - distname = os_release.distname() - self.os_ver = self.full_os_ver = os_release.version() - self.osnick = os_release.osnick() - if self.osnick == "": - self.osnick = distname + str(self.os_ver) - except: - if strict: - assert(False), "Cannot determine distribution" - distname = 'unknown' - self.os_ver = self.full_os_ver = 'unknown' - if distname == 'fedora' or distname == 'ubuntu' or distname == 'debian' or distname == 'arch': - pass - elif distname.startswith('centos'): - distname = 'centos' - elif distname.startswith('redhat') or distname == 'rhel': - distname = 'redhat' - elif distname.startswith('suse'): - distname = 'suse' - elif distname.startswith('amzn'): - distname = 'amzn' - self.osnick = 'amzn' + str(os_release.version()) - else: - if strict: - assert(False), "Cannot determine distribution" - self.dist = distname - elif self.os == 'darwin': - self.os = 'macosx' - self.dist = '' - mac_ver = platform.mac_ver() - self.full_os_ver = mac_ver[0] # e.g. 10.14, but also 10.5.8 - self.os_ver = '.'.join(self.full_os_ver.split('.')[:2]) # major.minor - # self.arch = mac_ver[2] # e.g. x64_64 - self.osnick = self.os + str(self.full_os_ver.split('.')[1]) - nicks = { - "10.15": "catalina", - "10.14": "mojave", - "10.13": "highsierra", - "10.12": "sierra", - "10.11": "elcapitan", - "10.10": "yosemite", - "10.9": "mavericks", - "10.8": "mountainlion", - "10.7": "lion", - "10.6": "snowleopard", - "10.5": "leopard", - "10.4": "tiger", - "10.3": "panther", - "10.2": "jaguar", - "10.1": "puma", - "10.0": "cheetah" - } - if self.os_ver in nicks: - self.osnick = nicks[self.os_ver] - elif self.os == 'windows': - self.dist = self.os - self.os_ver = platform.release() - self.full_os_ver = os.version() - elif self.os == 'sunos': - self.os = 'solaris' - self.os_ver = '' - self.dist = '' - elif self.os == 'freebsd': - self.dist = '' - ver = sh('freebsd-version') - m = re.search(r'([^-]*)-(.*)', ver) - self.os_ver = self.full_os_ver = m.group(1) - self.osnick = self.os + self.os_ver - else: - if strict: - assert(False), "Cannot determine OS" - self.os_ver = '' - self.dist = '' - - self.arch = platform.machine().lower() - if self.arch == 'amd64' or self.arch == 'x86_64': - self.arch = 'x64' - elif self.arch == 'i386' or self.arch == 'i686' or self.arch == 'i86pc': - self.arch = 'x86' - elif self.arch == 'aarch64': - self.arch = 'arm64v8' - elif self.arch == 'armv7l': - self.arch = 'arm32v7' - - def is_debian_compat(self): - return self.dist == 'debian' or self.dist == 'ubuntu' or self.dist == 'linuxmint' - - def is_redhat_compat(self): - return self.dist == 'redhat' or self.dist == 'centos' or self.dist == 'amzn' - - def is_container(self): - with open('/proc/1/cgroups', 'r') as conf: - for line in conf: - if re.search('docker', line): - return True - return False - - def report(self): - print("This system is " + self.distname + " " + self.distver + ".\n") - -#---------------------------------------------------------------------------------------------- - -class OnPlatform: - def __init__(self): - self.stages = [0] - self.platform = Platform() - - def invoke(self): - os = self.os = self.platform.os - dist = self.dist = self.platform.dist - self.ver = self.platform.os_ver - self.common_first() - - for stage in self.stages: - self.stage = stage - self.common() - if os == 'linux': - self.linux() - - if self.platform.is_debian_compat(): - self.debian_compat() - if self.platform.is_redhat_compat(): - self.redhat_compat() - - if dist == 'fedora': - self.fedora() - elif dist == 'ubuntu': - self.ubuntu() - elif dist == 'debian': - self.debian() - elif dist == 'centos': - self.centos() - elif dist == 'redhat': - self.redhat() - elif dist == 'suse': - self.suse() - elif dist == 'arch': - self.arch() - elif dist == 'linuxmint': - self.linuxmint() - elif dist == 'amzn': - self.amzn() - else: - assert(False), "Cannot determine installer" - elif os == 'macosx': - self.macosx() - elif os == 'freebsd': - self.freebsd() - - self.common_last() - - def common(self): - pass - - def common_first(self): - pass - - def common_last(self): - pass - - def linux(self): - pass - - def arch(self): - pass - - def debian_compat(self): # debian, ubuntu, etc - pass - - def debian(self): - pass - - def centos(self): - pass - - def fedora(self): - pass - - def redhat_compat(self): # centos, rhel, amzn, etc - pass - - def redhat(self): - pass - - def ubuntu(self): - pass - - def suse(self): - pass - - def macosx(self): - pass - - def windows(self): - pass - - def bsd_compat(self): - pass - - def freebsd(self): - pass - - def linuxmint(self): - pass - - def amzn(self): - pass diff --git a/opt/readies/paella/setup.py b/opt/readies/paella/setup.py deleted file mode 100755 index b10af35ed..000000000 --- a/opt/readies/paella/setup.py +++ /dev/null @@ -1,254 +0,0 @@ - -import os -import sys -import tempfile -import textwrap -from .platform import OnPlatform, Platform - -#---------------------------------------------------------------------------------------------- - -class Runner: - def __init__(self, nop=False): - self.nop = nop - - def run(self, cmd, output_on_error=False, _try=False): - if cmd.find('\n') > -1: - cmd = str.lstrip(textwrap.dedent(cmd)).replace('\n', '; ') - print(cmd) - sys.stdout.flush() - if self.nop: - return - if output_on_error: - fd, temppath = tempfile.mkstemp() - os.close(fd) - cmd = "{{ {}; }} >{} 2>&1".format(cmd, temppath) - rc = os.system(cmd) - if rc > 0: - if output_on_error: - os.system("cat {}".format(temppath)) - os.remove(temppath) - eprint("command failed: " + cmd) - sys.stderr.flush() - if not _try: - sys.exit(1) - return rc - - def has_command(self, cmd): - return os.system("command -v " + cmd + " > /dev/null") == 0 - -#---------------------------------------------------------------------------------------------- - -class RepoRefresh(OnPlatform): - def __init__(self, runner): - OnPlatform.__init__(self) - self.runner = runner - - def redhat_compat(self): - pass - - def debian_compat(self): - self.runner.run("apt-get -qq update -y") - - def macosx(self): - if os.environ.get('BREW_NO_UPDATE') != '1': - self.runner.run("brew update || true") - -#---------------------------------------------------------------------------------------------- - -class Setup(OnPlatform): - def __init__(self, nop=False): - OnPlatform.__init__(self) - self.runner = Runner(nop) - self.stages = [0] - self.platform = Platform() - self.os = self.platform.os - self.dist = self.platform.dist - self.ver = self.platform.os_ver - - self.python = sys.executable - - if self.os == 'macosx': - # this is required because osx pip installed are done with --user - os.environ["PATH"] = os.environ["PATH"] + ':' + os.environ["HOME"] + '/Library/Python/2.7/bin' - # this prevents brew updating before each install - os.environ["HOMEBREW_NO_AUTO_UPDATE"] = "1" - - if self.platform.is_debian_compat(): - # prevents apt-get from interactively prompting - os.environ["DEBIAN_FRONTEND"] = 'noninteractive' - - os.environ["PYTHONWARNINGS"] = 'ignore:DEPRECATION::pip._internal.cli.base_command' - - def setup(self): - RepoRefresh(self.runner).invoke() - self.invoke() - - def run(self, cmd, output_on_error=False, _try=False): - return self.runner.run(cmd, output_on_error=output_on_error, _try=_try) - - def has_command(self, cmd): - return self.runner.has_command(cmd) - - #------------------------------------------------------------------------------------------ - - def apt_install(self, packs, group=False, _try=False): - self.run("apt-get -qq install -y " + packs, output_on_error=True, _try=_try) - - def yum_install(self, packs, group=False, _try=False): - if not group: - self.run("yum install -q -y " + packs, output_on_error=True, _try=_try) - else: - self.run("yum groupinstall -y " + packs, output_on_error=True, _try=_try) - - def dnf_install(self, packs, group=False, _try=False): - if not group: - self.run("dnf install -y " + packs, output_on_error=True, _try=_try) - else: - self.run("dnf groupinstall -y " + packs, output_on_error=True, _try=_try) - - def zypper_install(self, packs, group=False, _try=False): - self.run("zipper --non-interactive install " + packs, output_on_error=True, _try=_try) - - def pacman_install(self, packs, group=False, _try=False): - self.run("pacman --noconfirm -S " + packs, output_on_error=True, _try=_try) - - def brew_install(self, packs, group=False, _try=False): - # brew will fail if package is already installed - for pack in packs.split(): - self.run("brew list {} &>/dev/null || brew install {}".format(pack, pack), output_on_error=True, _try=_try) - - def pkg_install(self, packs, group=False, _try=False): - self.run("pkg install -q -y " + packs, output_on_error=True, _try=_try) - - def install(self, packs, group=False, _try=False): - if self.os == 'linux': - if self.dist == 'fedora': # also include centos 8 - self.dnf_install(packs, group=group, _try=_try) - elif self.platform.is_debian_compat(): - self.apt_install(packs, group=group, _try=_try) - elif self.platform.is_redhat_compat(): - self.yum_install(packs, group=group, _try=_try) - elif self.dist == 'suse': - self.zypper_install(packs, group=group, _try=_try) - elif self.dist == 'arch': - self.pacman_install(packs, group=group, _try=_try) - else: - Assert(False), "Cannot determine installer" - elif self.os == 'macosx': - self.brew_install(packs, group=group, _try=_try) - elif self.os == 'freebsd': - self.pkg_install(packs, group=group, _try=_try) - else: - Assert(False), "Cannot determine installer" - - def group_install(self, packs, _try=False): - self.install(packs, group=True, _try=_try) - - #------------------------------------------------------------------------------------------ - - def yum_add_repo(self, repourl, repo="", _try=False): - if not self.has_command("yum-config-manager"): - self.install("yum-utils") - self.run("yum-config-manager -y --add-repo {}".format(repourl), _try=_try) - - def apt_add_repo(self, repourl, repo="", _try=False): - if not self.has_command("yum-config-manager"): - self.install("software-properties-common") - self.run("add-apt-repository -y {}".format(repourl), _try=_try) - self.run("apt-get -qq update", _try=_try) - - def dnf_add_repo(self, repourl, repo="", _try=False): - if self.run("dnf config-manager 2>/dev/null", _try=True): - self.install("dnf-plugins-core", _try=_try) - self.run("dnf config-manager -y --add-repo {}".format(repourl), _try=_try) - - def zypper_add_repo(self, repourl, repo="", _try=False): - pass - - def pacman_add_repo(self, repourl, repo="", _try=False): - pass - - def brew_add_repo(self, repourl, repo="", _try=False): - pass - - def add_repo(self, repourl, repo="", _try=False): - if self.os == 'linux': - if self.dist == 'fedora': - self.dnf_add_repo(repourl, repo=repo, _try=_try) - elif self.dist == 'ubuntu' or self.dist == 'debian': - self.apt_add_repo(repourl, repo=repo, _try=_try) - elif self.dist == 'centos' or self.dist == 'redhat': - self.yum_add_repo(repourl, repo=repo, _try=_try) - elif self.dist == 'suse': - self.zypper_add_repo(repourl, repo=repo, _try=_try) - elif self.dist == 'arch': - self.pacman_add_repo(repourl, repo=repo, _try=_try) - else: - Assert(False), "Cannot determine installer" - elif self.os == 'macosx': - self.brew_add_repo(packs, group=group, _try=_try) - else: - Assert(False), "Cannot determine installer" - - #------------------------------------------------------------------------------------------ - - def pip_install(self, cmd, _try=False): - pip_user = '' - if self.os == 'macosx': - pip_user = '--user ' - self.run(self.python + " -m pip install --disable-pip-version-check " + pip_user + cmd, output_on_error=True, _try=_try) - - def pip3_install(self, cmd, _try=False): - pip_user = '' - if self.os == 'macosx': - pip_user = '--user ' - self.run(self.python + " -m pip install --disable-pip-version-check " + pip_user + cmd, output_on_error=True, _try=_try) - - def setup_pip(self, _try=False): - get_pip = "set -e; wget -q https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py" - if self.run(self.python + " -m pip --version", _try=True, output_on_error=False) != 0: - if sys.version_info.major == 3: - self.install("python3-distutils") - self.install_downloaders() - pip_user = ' --user' if self.os == 'macosx' else '' - self.run(get_pip + "; " + self.python + " /tmp/get-pip.py" + pip_user + " 'pip==19.3.1'", output_on_error=True, _try=_try) - - def install_downloaders(self, _try=False): - if self.os == 'linux': - self.install("ca-certificates", _try=_try) - self.install("curl wget", _try=_try) - - def install_git_lfs_on_linux(self, _try=False): - self.run(""" - set -e - d=$(mktemp -d /tmp/git-lfs.XXXXXX) - mkdir -p $d - wget -q https://github.com/git-lfs/git-lfs/releases/download/v2.9.2/git-lfs-linux-amd64-v2.9.2.tar.gz -O $d/git-lfs.tar.gz - cd $d - tar xf git-lfs.tar.gz - cd - - $d/install.sh - rm -rf $d - """) - -# cmd = "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.{}.sh | bash" -# if self.platform.is_redhat_compat(): -# self.run(cmd.format('rpm'), _try=_try) -# elif self.platform.is_debian_compat(): -# self.run(cmd.format('deb'), _try=_try) -# self.install("git-lfs", _try=_try) - - def install_gnu_utils(self, _try=False): - packs = "" - if self.os == 'macosx': - packs= "make findutils gnu-sed gnu-tar gawk" - elif self.os == 'freebsd': - packs = "gmake findutils gsed gtar gawk" - self.install(packs) - for x in ['make', 'find', 'sed', 'tar']: - p = "/usr/local/bin/{}".format(x) - if not os.path.exists(p): - self.run("ln -sf /usr/local/bin/g{} {}".format(x, p)) - else: - eprint("Warning: {} exists - not replaced".format(p)) - diff --git a/opt/readies/paella/utils.py b/opt/readies/paella/utils.py deleted file mode 100755 index dbe8f654c..000000000 --- a/opt/readies/paella/utils.py +++ /dev/null @@ -1,12 +0,0 @@ - -import sys -import inspect -import os.path - -if (sys.version_info > (3, 0)): - from .utils3 import * -else: - from .utils2 import * - -def current_filepath(): - return os.path.abspath(inspect.getfile(inspect.currentframe().f_back)) diff --git a/opt/readies/paella/utils2.py b/opt/readies/paella/utils2.py deleted file mode 100755 index 294fe3153..000000000 --- a/opt/readies/paella/utils2.py +++ /dev/null @@ -1,9 +0,0 @@ - -import sys -from subprocess import Popen, PIPE - -def eprint(*args, **kwargs): - print >> sys.stderr, ' '.join(map(lambda x: "%s" % x, args)) - -def sh(cmd): - return " ".join(Popen(cmd.split(), stdout=PIPE).communicate()[0].split("\n")) diff --git a/opt/readies/paella/utils3.py b/opt/readies/paella/utils3.py deleted file mode 100755 index 4698e9d49..000000000 --- a/opt/readies/paella/utils3.py +++ /dev/null @@ -1,10 +0,0 @@ - -import sys -from subprocess import Popen, PIPE - -def eprint(*args, **kwargs): - print(*args, file = sys.stderr, **kwargs) - -def sh(cmd): - return " ".join(Popen(cmd.split(), stdout=PIPE).communicate()[0].decode('utf-8').split("\n")) - diff --git a/opt/readies/shibumi/README.md b/opt/readies/shibumi/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/opt/readies/shibumi/functions b/opt/readies/shibumi/functions deleted file mode 100755 index 92cfd9e2c..000000000 --- a/opt/readies/shibumi/functions +++ /dev/null @@ -1,35 +0,0 @@ - -#---------------------------------------------------------------------------------------------- - -platform_os() { - case "$OSTYPE" in - linux*) echo "linux" ;; - solaris*) echo "solaris" ;; - darwin*) echo "macosx" ;; - bsd*) echo "bsd" ;; - msys*) echo "windows" ;; - *) echo "?" ;; - esac -} - -#---------------------------------------------------------------------------------------------- - -if [[ $(platform_os) == macosx ]]; then - -realpath() { - [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" -} - -fi - -#---------------------------------------------------------------------------------------------- - -runn() { - [[ $NOP == 1 ]] && { echo "${@:1}"; return; } - __runn_log=$(mktemp /tmp/run.XXXXX) - { "${@:1}"; } > $__runn_log 2>&1 - [ $? != 0 ] && cat $__runn_log - rm -f $__runn_log -} - -#---------------------------------------------------------------------------------------------- diff --git a/opt/readies/shibumi/here b/opt/readies/shibumi/here deleted file mode 100755 index a6e56964e..000000000 --- a/opt/readies/shibumi/here +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" From 1651daf77f8cb512f41a0803ce358ad24c526e12 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 19 May 2020 02:33:00 +0300 Subject: [PATCH 2/3] Fix in paella --- opt/readies | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opt/readies b/opt/readies index 3ee684db7..c464712d7 160000 --- a/opt/readies +++ b/opt/readies @@ -1 +1 @@ -Subproject commit 3ee684db718810bc19022d1946b5ffeae329d7b9 +Subproject commit c464712d7174856545afb7e22d6ed3013a1349ac From e52bc11c5946728261f9734c30a422e221617750 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 19 May 2020 06:19:32 +0300 Subject: [PATCH 3/3] Updated get_deps.sh and docs --- docs/quickstart.md | 2 +- get_deps.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 06f4b41f9..85c42cd9b 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -30,7 +30,7 @@ You can compile and build the module from its source code. The [Developer](devel You can obtain the module's source code by cloning the project's repository using git like so: ```sh -git clone https://github.com/RedisAI/RedisAI +git clone --recursive https://github.com/RedisAI/RedisAI ``` Switch to the project's directory with: diff --git a/get_deps.sh b/get_deps.sh index 676cc9f10..21529d9b6 100755 --- a/get_deps.sh +++ b/get_deps.sh @@ -66,6 +66,8 @@ LIBTORCH=libtorch MKL=mkl ONNXRUNTIME=onnxruntime +git submodule update --init --recursive || true + ######################################################################################## DLPACK if [[ $WITH_DLPACK != 0 ]]; then