Skip to content

Commit

Permalink
Rebase from 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Feb 9, 2022
1 parent 343292f commit a6dd941
Show file tree
Hide file tree
Showing 92 changed files with 4,064 additions and 2,518 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ jobs:
- run:
name: Install Sphinx
command: |
pip3 install --user sphinx
pip3 install --user sphinx_rtd_theme
pip3 install --user sphinx==3.3.1 jinja2==2.11.3 sphinx_rtd_theme==0.5.0 MarkupSafe==1.1.1 packaging==20.8 docutils==0.17.1 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-applehelp==1.0.2 Pygments==2.10.0 imagesize==1.2.0 sphinxcontrib-serializinghtml==1.1.5 requests==2.26.0 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-jsmath==1.0.1 snowballstemmer==2.1.0 sphinxcontrib-htmlhelp==2.0.0 babel==2.9.1 alabaster==0.7.12 pyparsing==3.0.1 idna==3.3 certifi==2021.10.8 charset-normalizer==2.0.7 urllib3==1.26.7 pytz==2021.3
- run:
name: Build reStructuredText(reST)
command: cd /tmp/rst && ~/.local/bin/sphinx-build . html
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
brew "coreutils"
brew "gnu-sed"
brew "git"
brew "make"
brew "jpeg"
brew "libpng"
brew "mesalib-glw"
brew "glew"
brew "wget"
brew "poppler"
brew "bullet"
126 changes: 126 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
on:
push:
branches:
- master
pull_request:

env:
DISPLAY: '0:0'

jobs:
linux:
strategy:
matrix:
include:
- DOCKER_IMAGE: ubuntu:trusty
- DOCKER_IMAGE: ubuntu:xenial
- DOCKER_IMAGE: ubuntu:bionic
- DOCKER_IMAGE: ubuntu:focal
- DOCKER_IMAGE: debian:stretch
- DOCKER_IMAGE: ubuntu:trusty
ROS_DISTRO: indigo
- DOCKER_IMAGE: ubuntu:xenial
ROS_DISTRO: kinetic
- DOCKER_IMAGE: ubuntu:bionic
ROS_DISTRO: meodic
- DOCKER_IMAGE: ubuntu:focal
ROS_DISTRO: noetic
- DOCKER_IMAGE: osrf/ubuntu_armhf:trusty
- DOCKER_IMAGE: osrf/ubuntu_armhf:xenial
- DOCKER_IMAGE: osrf/ubuntu_arm64:trusty
- DOCKER_IMAGE: osrf/ubuntu_arm64:xenial
- DOCKER_IMAGE: osrf/ubuntu_arm64:bionic
- DOCKER_IMAGE: osrf/ubuntu_arm64:focal
- DOCKER_IMAGE: osrf/debian_arm64:stretch
- DOCKER_IMAGE: amd64/debian:unstable
#
- QEMU: amd64
DOCKER_IMAGE: amd64/debian:unstable # amd64
- QEMU: aarch64
DOCKER_IMAGE: arm64v8/debian:buster # arm64
- QEMU: arm
DOCKER_IMAGE: arm32v5/debian:jessie # armel
- QEMU: arm
DOCKER_IMAGE: arm32v7/debian:jessie # armhf
# hppa
# hurd-i386
- QEMU: i386
DOCKER_IMAGE: i386/debian:unstable # i386
- QEMU: i386
DOCKER_IMAGE: i386/debian:buster # i386
# ia64
# m68k
- QEMU: mips64el
DOCKER_IMAGE: loongnix/debian:buster # mips64el
# mipsel
# - QEMU: ppc
# DOCKER_IMAGE: vicamo/debian:unstable-powerpc # powerpc / somehow failing loading eusgl
- QEMU: ppc64le
DOCKER_IMAGE: ppc64le/debian:buster # ppc64
# riscv64
# sh4
# sparc64
fail-fast: false

runs-on: ubuntu-latest
timeout-minutes: 60

name: linux

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run test
shell: bash
run: |
set -x
export CI_SOURCE_PATH=$(pwd)
export REPOSITORY_NAME=${PWD##*/}
export TRAVIS_BRANCH=${GITHUB_REF#refs/heads/}
export TRAVIS_OS_NAME=linux
export DOCKER_IMAGE=${{matrix.DOCKER_IMAGE}}
export ROS_DISTRO=${{matrix.ROS_DISTRO}}
export QEMU=${{matrix.QEMU}}
export MAKEFLAGS="-j4"
if [[ "$QEMU" != "" || "$DOCKER_IMAGE" == *"arm"* ]]; then sudo apt-get update -y -qq; fi
if [[ "$QEMU" != "" ]]; then sudo apt-get install -y -qq qemu-user-static; ls /usr/bin/qemu-*-static; export QEMU_VOLUME="-v /usr/bin/qemu-$QEMU-static:/usr/bin/qemu-$QEMU-static" ; fi
if [[ "$QEMU" != "" ]]; then docker run --rm --privileged multiarch/qemu-user-static:register; fi
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then sudo apt-get install -y -qq qemu-user-static; fi
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then git clone http://github.com/euslisp/jskeus ${HOME}/jskeus; fi
echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME on $QEMU_VOLUME"
docker run --rm $QEMU_VOLUME -v $HOME:$HOME -e "QEMU=$QEMU" -e "TRAVIS_OS_NAME=$TRAVIS_OS_NAME" -e "CI_SOURCE_PATH=$CI_SOURCE_PATH" -e "HOME=$HOME" -e "MAKEFLAGS=$MAKEFLAGS" -e "DOCKER_IMAGE=$DOCKER_IMAGE" -t $DOCKER_IMAGE sh -c "cd $CI_SOURCE_PATH; ./.travis.sh"
osx:
runs-on: macos-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get brew cache directory
id: brew-cache
run: echo "::set-output name=dir::$(brew --cache)/downloads"
- name: Brew cache
uses: actions/cache@v2
with:
path: ${{ steps.brew-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/Brewfile') }}
- name: Brew config
run: |
cd .github/workflows/
brew config
- name: Run test
shell: bash
run: |
set -x
export CI_SOURCE_PATH=$(pwd)
export REPOSITORY_NAME=${PWD##*/}
export TRAVIS_BRANCH=${GITHUB_REF#refs/heads/}
export TRAVIS_OS_NAME=osx
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export LC_CTYPE=C
(cd ${HOME}; git clone --depth 1 http://github.com/euslisp/jskeus jskeus)
(cd ${HOME}/jskeus; patch -f -p1 < ${CI_SOURCE_PATH}/.github/workflows/fix-dylib-location.patch || echo "OK")
bash -x ./.travis.sh
- name: Cleanup some brew downloads
run: cd ${{ steps.brew-cache.outputs.dir }} && ls -lsS | head -n 10 | awk '{ print $10 }' | xargs rm -rf
33 changes: 33 additions & 0 deletions .github/workflows/fix-dylib-location.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/irteus/irtgl.l b/irteus/irtgl.l
index 4c417e61..afd606bc 100644
--- a/irteus/irtgl.l
+++ b/irteus/irtgl.l
@@ -51,6 +51,8 @@
(cond
((probe-file "/opt/local/lib/libGL.dylib")
(setq gl-lib ( load-foreign "/opt/local/lib/libGL.dylib")))
+ ((probe-file "/usr/local/lib/libGL.dylib")
+ (setq gl-lib ( load-foreign "/usr/local/lib/libGL.dylib")))
(t
(setq gl-lib ( load-foreign "/opt/X11/lib/libGL.dylib")))))
#+:cygwin
diff --git a/irteus/irtx.l b/irteus/irtx.l
index 6a6761d4..4477b6ce 100644
--- a/irteus/irtx.l
+++ b/irteus/irtx.l
@@ -76,9 +76,12 @@
(let (x-lib pname)
#+:darwin
#+:darwin
- (if (probe-file "/opt/local/lib/libX11.dylib")
- (setq pname "/opt/local/lib/libX11.dylib")
- (setq pname "/opt/X11/lib/libX11.dylib"))
+ (cond ((probe-file "/opt/local/lib/libX11.dylib")
+ (setq pname "/opt/local/lib/libX11.dylib"))
+ ((probe-file "/usr/local/lib/libX11.dylib")
+ (setq pname "/usr/local/lib/libX11.dylib"))
+ (t
+ (setq pname "/opt/X11/lib/libX11.dylib")))
#+:cygwin
(if (probe-file "/usr/bin/cygX11-6.dll")
(setq pname "/usr/bin/cygX11-6.dll")
102 changes: 73 additions & 29 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function travis_time_start {
else
TRAVIS_START_TIME=$(date +%s%N)
fi
TRAVIS_TIME_ID=$(cat /dev/urandom | LC_ALL=C LC_CTYPE=C tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
TRAVIS_TIME_ID=$(head /dev/urandom | base64 | head -c 8)
TRAVIS_FOLD_NAME=$1
echo -e "\e[0Ktravis_fold:start:$TRAVIS_FOLD_NAME"
echo -e "\e[0Ktravis_time:start:$TRAVIS_TIME_ID"
Expand All @@ -35,6 +35,12 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ ! -e /usr/bin/sudo ] ; then apt-get update && apt-get install -y sudo; else sudo apt-get update; fi
travis_time_end

travis_time_start setup.tzdata
# set non interactive tzdata https://stackoverflow.com/questions/8671308/non-interactive-method-for-dpkg-reconfigure-tzdata
# set DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
travis_time_end

travis_time_start setup.apt-get_install
ret=1; while [ $ret != 0 ]; do sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi pkg-config libbullet-dev && ret=0 || echo "failed, retry"; done # msttcorefonts could not install on 14.04 travis
# unset protocol version https://github.com/juju/charm-tools/issues/532
Expand All @@ -45,13 +51,16 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
travis_time_start setup.install
# https://apple.stackexchange.com/questions/393481/homebrew-cask-download-failure-ssl-certificate-problem-certificate-has-expired
# skip if already installed
# https://discourse.brew.sh/t/skip-ignore-brew-install-if-package-is-already-installed/633/2
# brew install jpeg libpng mesalib-glw;
# use HOMEBREW_NO_AUT_UPDATE to fix unexpected keyword error https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
echo insecure >> ~/.curlrc
export HOMEBREW_CURLRC=1
brew list jpeg &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install jpeg
brew list libpng &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install libpng
brew list mesalib-glw &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install mesalib-glw
brew list mesa-glu &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install mesa-glu
brew list bullet &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install bullet
travis_time_end

Expand All @@ -60,7 +69,7 @@ fi
### for multiarch compile test
if [ "$QEMU" != "" ]; then
travis_time_start install.dpkg-dev
apt-get install -qq -y dpkg-dev
apt-get install -qq -y dpkg-dev patchutils
travis_time_end

echo "uname -a : $(uname -a)"
Expand All @@ -69,10 +78,26 @@ if [ "$QEMU" != "" ]; then
echo "gcc -dumpversion : $(gcc -dumpversion)"
echo "getconf LONG_BIT : $(getconf LONG_BIT)"

travis_time_start download.euslisp-debian
export GIT_SSL_NO_VERIFY=1
git clone http://salsa.debian.org/science-team/euslisp /tmp/euslisp-dfsg
for file in $(cat /tmp/euslisp-dfsg/debian/patches/series); do
# skip patches already applied by https://github.com/euslisp/EusLisp/pull/482
[[ $file =~ use-rtld-global-loadelf.patch|fix-arm-ldflags.patch|fix-library-not-linked-against-libc.patch|fix-manpage-has-bad-whatis-entry-on-man-pages.patch ]] && continue;
# skip patch already applied by https://github.com/euslisp/EusLisp/pull/441
if [[ $file =~ fix-for-reprotest.patch ]]; then
filterdiff -p1 -x 'lisp/image/jpeg/makefile' -x 'lisp/comp/comp.l' < /tmp/euslisp-dfsg/debian/patches/$file > /tmp/euslisp-dfsg/debian/patches/$file-fix
file=$file-fix
fi
echo $file
patch -p1 < /tmp/euslisp-dfsg/debian/patches/$file
done
travis_time_end

travis_time_start compile.euslisp
export EUSDIR=`pwd`
eval "$(dpkg-buildflags --export=sh)"
make -C lisp -f Makefile.Linux eus0 eus1 eus2 eusg eusx eusgl eus eusjpeg
make
travis_time_end

if [[ `gcc -dumpmachine | egrep "^(arm|aarch)"` != "" ]]; then
Expand All @@ -87,16 +112,45 @@ if [ "$QEMU" != "" ]; then
export EXIT_STATUS=0;
set +e
# run test in EusLisp/test
make -C test
for test_l in test/*.l; do

[[ "`uname -m`" == "ppc64le"* && $test_l =~ test-foreign.l ]] && continue;

travis_time_start euslisp.${test_l##*/}.test

sed -i 's/\(i-max\ [0-9]000\)0*/\1/' $test_l

eusgl $test_l;
export TMP_EXIT_STATUS=$?

travis_time_end `expr 32 - $TMP_EXIT_STATUS`
export CONTINUE=0
# test-foreign.l only works for x86 / arm
if [[ $test_l =~ test-foreign.l && ! "$(gcc -dumpmachine)" =~ "aarch".*|"arm".*|"x86_64".*|"i"[0-9]"86".* ]]; then export CONTINUE=1; fi
# object.l fails on ppc64le since https://github.com/euslisp/EusLisp/pull/481. Can not fix this after 2 week debugging....
if [[ "$DOCKER_IMAGE" == "ppc64le/debian:buster" && $test_l =~ object.l ]]; then export CONTINUE=1; fi

if [[ $CONTINUE == 0 ]]; then travis_time_end `expr 32 - $TMP_EXIT_STATUS`; else travis_time_end 33; fi

if [[ $TMP_EXIT_STATUS != 0 ]]; then echo "Failed running $test_l. Exiting with $TMP_EXIT_STATUS"; fi

if [[ $CONTINUE != 0 ]]; then export TMP_EXIT_STATUS=0; fi

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;

travis_time_start compiled.${test_l##*/}.test

eusgl "(let ((o (namestring (merge-pathnames \".o\" \"$test_l\"))) (so (namestring (merge-pathnames \".so\" \"$test_l\")))) (compile-file \"$test_l\" :o o) (if (probe-file so) (load so) (exit 1))))"
export TMP_EXIT_STATUS=$?

# const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
if [[ $test_l =~ const.l ]]; then export CONTINUE=1; fi

if [[ $CONTINUE == 0 ]]; then travis_time_end `expr 32 - $TMP_EXIT_STATUS`; else travis_time_end 33; fi

if [[ $TMP_EXIT_STATUS != 0 ]]; then echo "Failed running $test_l. Exiting with $TMP_EXIT_STATUS"; fi

if [[ $CONTINUE != 0 ]]; then continue; fi

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
done;
Expand Down Expand Up @@ -129,14 +183,17 @@ if [[ "$DOCKER_IMAGE" == *"trusty"* || "$DOCKER_IMAGE" == *"jessie"* ]]; then
else
make eus-installed WFLAGS="-Werror=implicit-int -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=unused-result"
fi
make
travis_time_end

travis_time_start script.eustag
travis_time_start script.make.jskeus

(cd eus/lisp/tool; make)
make

travis_time_end

travis_time_start script.eustag

(cd eus/lisp/tool; make)

travis_time_end

Expand Down Expand Up @@ -206,10 +263,7 @@ export DISPLAY=
export EXIT_STATUS=0;
set +e

# arm target (ubuntu_arm64/trusty) takes too long time (>50min) for test
if [[ "`uname -m`" == "aarch"* ]]; then
sed -i 's@00000@0000@' $CI_SOURCE_PATH/test/object.l $CI_SOURCE_PATH/test/coords.l
fi
set -x # enable debug information
# arm target (ubuntu_arm64/trusty) takes too long time (>50min) for test
# osrf/ubuntu_arm64:trusty takes >50 min, reduce loop count for irteus-demo.l
if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then
Expand All @@ -219,8 +273,13 @@ if [[ "$DOCKER_IMAGE" == *"arm"* ]]; then
sed -i 's/(hanoi-program (length \*disks\*))/(subseq (hanoi-program (length \*disks\*)) 0 2)/' irteus/demo/hanoi-arm.l
sed -i 's/^\s*footstep-list/(subseq footstep-list 0 3)/' irteus/demo/walk-motion.l
fi
set +x # disable debug information

# run test in EusLisp/test
travis_time_start script.make.test
make -C $CI_SOURCE_PATH/test
travis_time_end

for test_l in $CI_SOURCE_PATH/test/*.l; do

travis_time_start euslisp.${test_l##*/}.test
Expand All @@ -246,10 +305,6 @@ fi
export TMP_EXIT_STATUS=$?

export CONTINUE=0
# bignum test fails on armhf
if [[ "`uname -m`" == "arm"* && $test_l =~ bignum.l ]]; then export CONTINUE=1; fi
# sort test fails on armhf (https://github.com/euslisp/EusLisp/issues/232)
if [[ "`uname -m`" == "arm"* && $test_l =~ sort.l ]]; then export CONTINUE=1; fi
# const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
if [[ $test_l =~ const.l ]]; then export CONTINUE=1; fi

Expand All @@ -272,13 +327,11 @@ fi
export TMP_EXIT_STATUS=$?

export CONTINUE=0
# irteus-demo.l, robot-model-usage.l and test-irt-motion.l fails on armhf both trusty and xenial
if [[ "`uname -m`" == "arm"* && $test_l =~ irteus-demo.l|robot-model-usage.l|test-irt-motion.l ]]; then export CONTINUE=1; fi
# skip collision test because bullet of 2.83 or later version is not released in trusty and jessie.
# https://github.com/euslisp/jskeus/blob/6cb08aa6c66fa8759591de25b7da68baf76d5f09/irteus/Makefile#L37
if [[ ( "$DOCKER_IMAGE" == *"trusty"* || "$DOCKER_IMAGE" == *"jessie"* ) && $test_l =~ test-collision.l ]]; then export CONTINUE=1; fi
# skip if test-cad.l/graph.l for arm
if [[ "$DOCKER_IMAGE" == *"arm"* && $test_l =~ test-collision.l|test-cad.l|graph.l ]]; then export CONTINUE=1; fi
# aarch64:bionic and aarch64:focal start failing from https://github.com/euslisp/EusLisp/pull/481. Can not fix this after 2 week debugging....
if [[ ( "$DOCKER_IMAGE" == "osrf/ubuntu_arm64:bionic" || "$DOCKER_IMAGE" == "osrf/ubuntu_arm64:focal" ) ]]; then export CONTINUE=1; fi

if [[ $CONTINUE == 0 ]]; then travis_time_end `expr 32 - $TMP_EXIT_STATUS`; else travis_time_end 33; fi

Expand All @@ -293,15 +346,6 @@ fi

[ $EXIT_STATUS == 0 ] || exit 1

travis_time_start eus64.test

if [[ "$TRAVIS_OS_NAME" == "osx" || "`uname -m`" == "arm"* ]]; then
uname -a
else
make -C eus/contrib/eus64-check/ || exit 1 # check eus64-check
fi
travis_time_end

if [ "$TRAVIS_OS_NAME" == "linux" -a "`uname -m`" == "x86_64" ]; then

travis_time_start script.doc
Expand Down
Loading

0 comments on commit a6dd941

Please sign in to comment.