From 5533dfa13252310b1f829aa734550f221846ea13 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Mon, 9 Jan 2017 22:44:18 -0500 Subject: [PATCH 1/8] Chg: updated gst versions --- Dockerfile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 53f8e0f..e103a56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -169,6 +169,12 @@ RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ libllvm3.8 \ libsoundtouch-dev \ libsoundtouch1 \ + # For general debugging + gdb \ + strace \ + lsof \ + ltrace \ + graphviz \ # end gst-plugins-bad req ubuntu-restricted-extras && \ apt-get clean && \ @@ -224,6 +230,8 @@ USER pi WORKDIR /home/pi +ENV HOME "/home/pi" + # Create a basic .jhbuildrc RUN echo "import os" > /home/pi/.jhbuildrc && \ echo "prefix='$PREFIX'" >> /home/pi/.jhbuildrc && \ @@ -394,13 +402,22 @@ RUN mkdir -p /home/pi/gnome && \ jhbuild run ./autogen.sh --prefix=/home/pi/jhbuild > /dev/null && \ jhbuild run ./configure --prefix=/home/pi/jhbuild > /dev/null && \ jhbuild run make clean all > /dev/null && \ - jhbuild run make install > /dev/null + jhbuild run make install > /dev/null && \ + + echo "****************[GDBINIT]****************" && \ + sudo zcat /usr/share/doc/python3.5/gdbinit.gz > /home/pi/.gdbinit && \ + sudo chown pi:pi /home/pi/.gdbinit && \ + + echo "****************[GSTREAMER-COMPLETION]****************" && \ + curl -L 'https://raw.githubusercontent.com/drothlis/gstreamer/bash-completion-master/tools/gstreamer-completion' | sudo tee -a /etc/bash_completion.d/gstreamer-completion && \ + sudo chown root:root /etc/bash_completion.d/gstreamer-completion + # Overlay the root filesystem from this repo COPY ./container/root / -RUN goss -g /tests/goss.jhbuild.yaml validate +RUN goss -g /tests/goss.jhbuild.yaml validate --retry-timeout 30s --sleep 1s # NOTE: intentionally NOT using s6 init as the entrypoint # This would prevent container debugging if any of those service crash From d905f8dfcdeac9c97085f833b60e3a8c7289cd31 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Mon, 22 May 2017 09:56:44 -0400 Subject: [PATCH 2/8] Chg: travis.yml --- .travis.yml | 45 ++++++++++++++++++++ Dockerfile | 110 ++++++++++++++++++++++++++++++++++++++++++------- README.md | 2 + RESEARCH.md | 41 ++++++++++++++++++ ci_build.yml | 4 ++ release_tag.sh | 17 ++++++++ 6 files changed, 205 insertions(+), 14 deletions(-) create mode 100644 .travis.yml create mode 100644 RESEARCH.md create mode 100644 ci_build.yml create mode 100755 release_tag.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..142ddf7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +matrix: + fast_finish: true + include: + - python: '3.5' + env: DOCKER_COMPOSE_VERSION=1.8.0 TEST_TARGET=default DOCKER_DATA="$HOME/docker_data" DOCKER_VERSION=1.12.0-0~trusty DOCKER_COMPOSE_VERSION=1.8.0 + sudo: required + dist: trusty + language: python + group: edge + +services: + - docker + +before_install: + # List available docker versions. + - apt-cache madison docker-engine + # Update Docker. See: https://graysonkoonce.com/managing-docker-and-docker-compose-versions-on-travis-ci/. + - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y --force-yes docker-engine=${DOCKER_VERSION} + # Add docker-compose at the version specified in ENV. + - sudo rm -f /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + - docker-compose --version + +cache: + apt: true + +install: + - travis_retry docker-compose pull + # set containers as privileged to bypass Travis environment limitations + - 'sed -i "/build: ./a \ \ privileged: true" docker-compose.yml' + - travis_retry docker-compose -f docker-compose.yml -f ci_build.yml build + +script: + - docker run --privileged -v `pwd`:/home/pi/dev/bossjones-github/scarlett_os -i -t --rm jhbuild_pygobject3 who + +# source: https://github.com/inspirehep/inspire-next/blob/9700274c36074a3e43168bf48b8ba3e3bfa7bcdf/.travis.yml +after_script: + # Killing via SIGTERM in order to trigger atexit and dump coverage information in WSGI + - "docker-compose -f docker-compose.yml kill -s SIGTERM" + - "docker-compose -f docker-compose.yml rm -f" + diff --git a/Dockerfile b/Dockerfile index e103a56..53ec576 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,16 @@ ENV PATH /usr/local/bin:/usr/local/sbin:$PATH # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. -ENV USER "pi" -ENV USER_HOME "/home/${USER}" + +# FIXME: DO NOT SET env var USER +ENV UNAME "pi" + +# /home/pi +ENV USER_HOME "/home/${UNAME}" + +# /home/pi/dev +ENV PROJECT_HOME "/home/${UNAME}/dev" + ENV LANG C.UTF-8 ENV SKIP_ON_TRAVIS yes ENV CURRENT_DIR $(pwd) @@ -26,15 +34,36 @@ ENV PYTHON_VERSION_MAJOR 3 ENV PYTHON_VERSION 3.5 ENV CFLAGS "-fPIC -O0 -ggdb -fno-inline -fno-omit-frame-pointer" ENV MAKEFLAGS "-j4" + +# /home/pi/jhbuild ENV PREFIX "${USER_HOME}/jhbuild" + +# /home/pi/gnome ENV JHBUILD "${USER_HOME}/gnome" + +# /home/pi/.virtualenvs +ENV PATH_TO_DOT_VIRTUALENV "${USER_HOME}/.virtualenvs" + +# /home/pi/jhbuild/bin:/home/pi/jhbuild/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PATH ${PREFIX}/bin:${PREFIX}/sbin:${PATH} + +# /home/pi/.virtualenvs/scarlett_os/lib ENV LD_LIBRARY_PATH ${PREFIX}/lib:${LD_LIBRARY_PATH} + +# /home/pi/jhbuild/lib/python3.5/site-packages:/usr/lib/python3.5/site-packages ENV PYTHONPATH ${PREFIX}/lib/python${PYTHON_VERSION}/site-packages:/usr/lib/python${PYTHON_VERSION}/site-packages + +# /home/pi/.virtualenvs/scarlett_os/lib/pkgconfig ENV PKG_CONFIG_PATH ${PREFIX}/lib/pkgconfig:${PREFIX}/share/pkgconfig:/usr/lib/pkgconfig + +# /home/pi/jhbuild/share:/usr/share ENV XDG_DATA_DIRS ${PREFIX}/share:/usr/share + +# /home/pi/jhbuild/etc/xdg ENV XDG_CONFIG_DIRS ${PREFIX}/etc/xdg -ENV PYTHON "python3" + +ENV PYTHON /usr/bin/python3 +ENV TERM xterm ENV PACKAGES "python3-gi python3-gi-cairo" ENV CC gcc @@ -183,54 +212,106 @@ RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ rm -rf /var/lib/{cache,log}/ && \ rm -rf /var/lib/apt/lists/*.lz4 /tmp/* /var/tmp/* - +# virtualenv stuff ENV VIRTUALENVWRAPPER_PYTHON '/usr/local/bin/python3' ENV VIRTUALENVWRAPPER_VIRTUALENV '/usr/local/bin/virtualenv' ENV VIRTUALENV_WRAPPER_SH '/usr/local/bin/virtualenvwrapper.sh' +# Ensure that Python outputs everything that's printed inside +# the application rather than buffering it. +ENV PYTHONUNBUFFERED 1 ENV PYTHON_VERSION_MAJOR "3" ENV GSTREAMER "1.0" ENV USER "pi" -ENV USER_HOME "/home/${USER}" +ENV USER_HOME "/home/${UNAME}" ENV LANGUAGE_ID 1473 ENV GITHUB_BRANCH "master" ENV GITHUB_REPO_NAME "scarlett_os" ENV GITHUB_REPO_ORG "bossjones" ENV PI_HOME "/home/pi" + +# /home/pi/dev/bossjones-github/scarlett_os ENV MAIN_DIR "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}" + +# /home/pi/.virtualenvs/scarlett_os ENV VIRT_ROOT "${PI_HOME}/.virtualenvs/${GITHUB_REPO_NAME}" + +# /home/pi/.virtualenvs/scarlett_os/lib/pkgconfig ENV PKG_CONFIG_PATH "${PI_HOME}/.virtualenvs/${GITHUB_REPO_NAME}/lib/pkgconfig" + +# /home/pi/dev/bossjones-github/scarlett_os/tests/fixtures/.scarlett ENV SCARLETT_CONFIG "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/tests/fixtures/.scarlett" -ENV SCARLETT_HMM "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/.virtualenvs/${GITHUB_REPO_NAME}/share/pocketsphinx/model/en-us/en-us" -ENV SCARLETT_LM "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/tests/fixtures/lm/${LANGUAGE_ID}.lm" -ENV SCARLETT_DICT "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/tests/fixtures/dict/${LANGUAGE_ID}.dic" + +# /home/pi/dev/bossjones-github/scarlett_os/static/speech/hmm/en_US/hub4wsj_sc_8k +ENV SCARLETT_HMM "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/static/speech/hmm/en_US/hub4wsj_sc_8k" + +# /home/pi/dev/bossjones-github/scarlett_os/static/speech/lm/1473.lm +ENV SCARLETT_LM "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/static/speech/lm/${LANGUAGE_ID}.lm" + +# /home/pi/dev/bossjones-github/scarlett_os/static/speech/dict/1473.dic +ENV SCARLETT_DICT "${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME}/static/speech/dict/${LANGUAGE_ID}.dic" + +# /home/pi/.virtualenvs/repoduce_pytest_mock_issue_84/lib ENV LD_LIBRARY_PATH "${PI_HOME}/.virtualenvs/${GITHUB_REPO_NAME}/lib" + +# /home/pi/.virtualenvs/scarlett_os/lib/gstreamer-1.0 ENV GST_PLUGIN_PATH "${PI_HOME}/.virtualenvs/${GITHUB_REPO_NAME}/lib/gstreamer-${GSTREAMER}" ENV PYTHON "/usr/local/bin/python3" ENV PYTHON_VERSION "3.5" ENV VIRTUALENVWRAPPER_PYTHON "/usr/local/bin/python3" ENV VIRTUALENVWRAPPER_VIRTUALENV "/usr/local/bin/virtualenv" ENV VIRTUALENVWRAPPER_SCRIPT "/usr/local/bin/virtualenvwrapper.sh" + +# /home/pi/.pythonrc ENV PYTHONSTARTUP "${USER_HOME}/.pythonrc" ENV PIP_DOWNLOAD_CACHE "${USER_HOME}/.pip/cache" + +# /home/pi/.virtualenvs/scarlett_os ENV WORKON_HOME "${VIRT_ROOT}" +############################[BEGIN - USER]############################################## RUN set -xe \ - && useradd -U -d ${PI_HOME} -m -r -G adm,sudo,dip,plugdev,tty,audio ${USER} \ - && usermod -a -G ${USER} ${USER} \ + && useradd -U -d ${PI_HOME} -m -r -G adm,sudo,dip,plugdev,tty,audio ${UNAME} \ + && usermod -a -G ${UNAME} ${UNAME} \ && mkdir -p ${PI_HOME}/dev/${GITHUB_REPO_ORG}-github \ && mkdir -p ${PI_HOME}/dev/${GITHUB_REPO_ORG}-github/${GITHUB_REPO_NAME} \ && mkdir -p ${MAIN_DIR} \ - && chown -hR ${USER}:${USER} ${MAIN_DIR} \ + && chown -hR ${UNAME}:${UNAME} ${MAIN_DIR} \ && echo 'pi ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \ && echo '%pi ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \ && cat /etc/sudoers -USER pi +USER $UNAME -WORKDIR /home/pi +WORKDIR /home/$UNAME + +ENV HOME "/home/$UNAME" +############################[END - USER]################################################ + +# ENV UNAME pacat + +# RUN apt-get update \ +# && DEBIAN_FRONTEND=noninteractive apt-get install --yes pulseaudio-utils + +# # Set up the user +# RUN export UNAME=$UNAME UID=1000 GID=1000 && \ +# mkdir -p "/home/${UNAME}" && \ +# echo "${UNAME}:x:${UID}:${GID}:${UNAME} User,,,:/home/${UNAME}:/bin/bash" >> /etc/passwd && \ +# echo "${UNAME}:x:${UID}:" >> /etc/group && \ +# mkdir -p /etc/sudoers.d && \ +# echo "${UNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${UNAME} && \ +# chmod 0440 /etc/sudoers.d/${UNAME} && \ +# chown ${UID}:${GID} -R /home/${UNAME} && \ +# gpasswd -a ${UNAME} audio + +# COPY pulse-client.conf /etc/pulse/client.conf + +# USER $UNAME +# ENV HOME /home/pacat + +# # run +# CMD ["pacat", "-vvvv", "/dev/urandom"] -ENV HOME "/home/pi" # Create a basic .jhbuildrc RUN echo "import os" > /home/pi/.jhbuildrc && \ @@ -264,6 +345,7 @@ RUN echo "import os" > /home/pi/.jhbuildrc && echo "os.environ['PIP_DOWNLOAD_CACHE'] = '$USER_HOME/.pip/cache'" >> /home/pi/.jhbuildrc && \ cat /home/pi/.jhbuildrc + # jhbuild RUN mkdir -p /home/pi/gnome && \ diff --git a/README.md b/README.md index 89953ba..65a57ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # boss-docker-gnome-pygobject-gtk3-gst-cmusphinx-jhbuild +[![Build Status](https://travis-ci.org/bossjones/boss-docker-jhbuild-pygobject3.svg?branch=master)](https://travis-ci.org/bossjones/boss-docker-jhbuild-pygobject3) + NOTE: This is a prereq for `scarlett_os`. It makes some strong assumptions about how you plan on running jhbuild, and should mainly just run on CI systems. Docker container that installs an jhbuild environment that has the following: diff --git a/RESEARCH.md b/RESEARCH.md new file mode 100644 index 0000000..150b29b --- /dev/null +++ b/RESEARCH.md @@ -0,0 +1,41 @@ +# When to use exec? + +`source: ` + +`exec` replaces the current program in the current process, without forking a new process. It is not something you would use in every script you write, but it comes in handy on occasion. Here are some scenarios I have used it; + +1. We want the user to run a specific application program without access to the shell. We could change the sign-in program in /etc/passwd, but maybe we want environment setting to be used from start-up files. So, in (say) .profile, the last statement says something like: + +`exec appln-program` + +so now there is no shell to go back to. Even if appln-program crashes, the end-user cannot get to a shell, because it is not there - the exec replaced it. + +2. We want to use a different shell to the one in /etc/passwd. Stupid as it may seem, some sites do not allow users to alter their sign-in shell. One site I know had everyone start with csh, and everyone just put into their .login (csh start-up file) a call to ksh. While that worked, it left a stray csh process running, and the logout was two stage which could get confusing. So we changed it to exec ksh which just replaced the c-shell program with the korn shell, and made everything simpler (there are other issues with this, such as the fact that the ksh is not a login-shell). + +3. Just to save processes. If we call prog1 -> prog2 -> prog3 -> prog4 etc. and never go back, then make each call an exec. It saves resources (not much, admittedly, unless repeated) and makes shutdown simplier. +You have obviously seen exec used somewhere, perhaps if you showed the code that's bugging you we could justify its use. + +Edit: I realised that my answer above is incomplete. There are two uses of exec in shells like ksh and bash - used for opening file descriptors. Here are some examples: + +``` +exec 3< thisfile # open "thisfile" for reading on file descriptor 3 +exec 4> thatfile # open "thatfile" for writing on file descriptor 4 +exec 8<> tother # open "tother" for reading and writing on fd 8 +exec 6>> other # open "other" for appending on file descriptor 6 +exec 5<&0 # copy read file descriptor 0 onto file descriptor 5 +exec 7>&4 # copy write file descriptor 4 onto 7 +exec 3<&- # close the read file descriptor 3 +exec 6>&- # close the write file descriptor 6 +``` + +Note that spacing is very important here. If you place a space between the fd number and the redirection symbol then exec reverts to the original meaning: + + +`exec 3 < thisfile # oops, overwrite the current program with command "3"` + +There are several ways you can use these, on ksh use read -u or print -u, on bash, for example: + +``` +read <&3 +echo stuff >&4 +``` \ No newline at end of file diff --git a/ci_build.yml b/ci_build.yml new file mode 100644 index 0000000..245efb1 --- /dev/null +++ b/ci_build.yml @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +jhbuild_pygobject3: + build: . diff --git a/release_tag.sh b/release_tag.sh new file mode 100755 index 0000000..f9eb8df --- /dev/null +++ b/release_tag.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +if [[ "$1" == "" ]] ; then + echo "You did not specify a new tag for the container you're build." + echo "Please try again with something like v1.1.0" + return 3 +else + TAG_VERSION="$1" +fi + +ID=$(docker build -q -t bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION .) +SHA=$(echo $ID | cut -d\: -f2) +echo $ID +echo $SHA +docker tag $ID bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION +# docker push bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION \ No newline at end of file From df0518651ff4f7a27ab4164b630f876eb90eb3db Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Mon, 22 May 2017 10:48:24 -0400 Subject: [PATCH 3/8] Chg: python3 update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 53ec576..18f293d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,7 @@ ENV XDG_DATA_DIRS ${PREFIX}/share:/usr/share # /home/pi/jhbuild/etc/xdg ENV XDG_CONFIG_DIRS ${PREFIX}/etc/xdg -ENV PYTHON /usr/bin/python3 +ENV PYTHON /usr/local/bin/python3 ENV TERM xterm ENV PACKAGES "python3-gi python3-gi-cairo" ENV CC gcc From dc9e6208a0faf0e44ea6e205869a593e75980e81 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Tue, 23 May 2017 20:53:19 -0400 Subject: [PATCH 4/8] Chg: python3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 18f293d..84899c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,7 @@ ENV XDG_DATA_DIRS ${PREFIX}/share:/usr/share # /home/pi/jhbuild/etc/xdg ENV XDG_CONFIG_DIRS ${PREFIX}/etc/xdg -ENV PYTHON /usr/local/bin/python3 +ENV PYTHON "python3" ENV TERM xterm ENV PACKAGES "python3-gi python3-gi-cairo" ENV CC gcc From f339ef8f319475f58a00e652c1de833c5b05d086 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 24 May 2017 11:15:24 -0400 Subject: [PATCH 5/8] Chg: modify jhbuild and python3 path --- Dockerfile | 18 ++++++++++++++---- FIXME.md | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 FIXME.md diff --git a/Dockerfile b/Dockerfile index 84899c2..f8ad6f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ ENV ENABLE_GTK yes ENV PYTHON_VERSION_MAJOR 3 ENV PYTHON_VERSION 3.5 ENV CFLAGS "-fPIC -O0 -ggdb -fno-inline -fno-omit-frame-pointer" -ENV MAKEFLAGS "-j4" +ENV MAKEFLAGS "-j4 V=1" # /home/pi/jhbuild ENV PREFIX "${USER_HOME}/jhbuild" @@ -67,6 +67,9 @@ ENV TERM xterm ENV PACKAGES "python3-gi python3-gi-cairo" ENV CC gcc +# FIXME: required for jhbuild( sudo apt-get install docbook-xsl build-essential git-core python-libxml2 ) +# source: https://wiki.gnome.org/HowDoI/Jhbuild + RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ @@ -203,6 +206,11 @@ RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ strace \ lsof \ ltrace \ + yelp-xsl \ + docbook-xsl \ + docbook-xsl-doc-html \ + python-libxslt1 \ + libxslt1-dev \ graphviz \ # end gst-plugins-bad req ubuntu-restricted-extras && \ @@ -320,6 +328,7 @@ RUN echo "import os" > /home/pi/.jhbuildrc && echo "moduleset = 'gnome-world'" >> /home/pi/.jhbuildrc && \ echo "interact = False" >> /home/pi/.jhbuildrc && \ echo "makeargs = '$MAKEFLAGS'" >> /home/pi/.jhbuildrc && \ + echo "module_autogenargs['gtk-doc'] = 'PYTHON=/usr/bin/python3'" >> /home/pi/.jhbuildrc && \ echo "os.environ['CFLAGS'] = '$CFLAGS'" >> /home/pi/.jhbuildrc && \ echo "os.environ['PYTHON'] = 'python$PYTHON_VERSION_MAJOR'" >> /home/pi/.jhbuildrc && \ echo "os.environ['GSTREAMER'] = '1.0'" >> /home/pi/.jhbuildrc && \ @@ -327,7 +336,7 @@ RUN echo "import os" > /home/pi/.jhbuildrc && echo "os.environ['ENABLE_GTK'] = 'yes'" >> /home/pi/.jhbuildrc && \ echo "os.environ['PYTHON_VERSION'] = '$PYTHON_VERSION'" >> /home/pi/.jhbuildrc && \ echo "os.environ['CFLAGS'] = '-fPIC -O0 -ggdb -fno-inline -fno-omit-frame-pointer'" >> /home/pi/.jhbuildrc && \ - echo "os.environ['MAKEFLAGS'] = '-j4'" >> /home/pi/.jhbuildrc && \ + echo "os.environ['MAKEFLAGS'] = '-j4 V=1'" >> /home/pi/.jhbuildrc && \ echo "os.environ['PREFIX'] = '$USER_HOME/jhbuild'" >> /home/pi/.jhbuildrc && \ echo "os.environ['JHBUILD'] = '$USER_HOME/gnome'" >> /home/pi/.jhbuildrc && \ echo "os.environ['PATH'] = '$PREFIX/bin:$PREFIX/sbin:$PATH'" >> /home/pi/.jhbuildrc && \ @@ -385,7 +394,7 @@ RUN mkdir -p /home/pi/gnome && \ cd /home/pi/gnome && \ cd pygobject && \ git checkout fb1b8fa8a67f2c7ea7ad4b53076496a8f2b4afdb && \ - jhbuild run ./autogen.sh --prefix=/home/pi/jhbuild --with-python=python3 > /dev/null && \ + jhbuild run ./autogen.sh --prefix=/home/pi/jhbuild --with-python=$(which python3) > /dev/null && \ jhbuild run make install > /dev/null && \ echo "****************[GSTREAMER]****************" && \ @@ -393,7 +402,7 @@ RUN mkdir -p /home/pi/gnome && \ curl -L "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.8.2.tar.xz" > gstreamer-1.8.2.tar.xz && \ tar -xJf gstreamer-1.8.2.tar.xz && \ cd gstreamer-1.8.2 && \ - jhbuild run ./configure --prefix=/home/pi/jhbuild > /dev/null && \ + jhbuild run ./configure --enable-doc-installation=no --prefix=/home/pi/jhbuild > /dev/null && \ jhbuild run make -j4 > /dev/null && \ jhbuild run make install > /dev/null && \ @@ -435,6 +444,7 @@ RUN mkdir -p /home/pi/gnome && \ echo "****************[GST-PLUGINS-BAD]****************" && \ cat /home/pi/jhbuild/bin/gdbus-codegen && \ + export BOSSJONES_PATH_TO_PYTHON=$(which python3) && \ sed -i "s,#!python3,#!/usr/bin/python3,g" /home/pi/jhbuild/bin/gdbus-codegen && \ cat /home/pi/jhbuild/bin/gdbus-codegen && \ cd /home/pi/gnome && \ diff --git a/FIXME.md b/FIXME.md new file mode 100644 index 0000000..d49fc8f --- /dev/null +++ b/FIXME.md @@ -0,0 +1,15 @@ +# unable to set CAP_SETFCAP effective capability: Operation not permitted + +``` +[0mI: Modulesets were edited locally but JHBuild is configured to get them from the network, perhaps you need to add use_local_modulesets = True to your /home/pi/.jhbuildrc. +libtool: warning: relinking 'libgstbase-1.0.la' +libtool: warning: relinking 'libgstcontroller-1.0.la' +libtool: warning: relinking 'libgstnet-1.0.la' +libtool: warning: relinking 'libgstcheck-1.0.la' +unable to set CAP_SETFCAP effective capability: Operation not permitted +make[5]: [install-data-hook] Error 1 (ignored) +libtool: warning: relinking 'libgstcoreelements.la' +libtool: warning: relinking 'libgstcoretracers.la' +``` + +https://unix.stackexchange.com/questions/106336/unable-to-set-capability-cap-setfcap-by-user \ No newline at end of file From 83c6ba98a9d63576975f74b12c6068e3ebc9489d Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 24 May 2017 12:03:19 -0400 Subject: [PATCH 6/8] Chg: woot looks like it's working --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 142ddf7..b0cc481 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,12 +34,9 @@ install: - 'sed -i "/build: ./a \ \ privileged: true" docker-compose.yml' - travis_retry docker-compose -f docker-compose.yml -f ci_build.yml build -script: - - docker run --privileged -v `pwd`:/home/pi/dev/bossjones-github/scarlett_os -i -t --rm jhbuild_pygobject3 who - # source: https://github.com/inspirehep/inspire-next/blob/9700274c36074a3e43168bf48b8ba3e3bfa7bcdf/.travis.yml after_script: # Killing via SIGTERM in order to trigger atexit and dump coverage information in WSGI - "docker-compose -f docker-compose.yml kill -s SIGTERM" - - "docker-compose -f docker-compose.yml rm -f" + # - "docker-compose -f docker-compose.yml rm -f" From c64817a16a0e93e6c0c2200ccd7391cf6be5d563 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Wed, 24 May 2017 20:10:42 -0400 Subject: [PATCH 7/8] Chg: script run --- .travis.yml | 3 ++- release_tag.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0cc481..818e587 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,11 +32,12 @@ install: - travis_retry docker-compose pull # set containers as privileged to bypass Travis environment limitations - 'sed -i "/build: ./a \ \ privileged: true" docker-compose.yml' + +script: - travis_retry docker-compose -f docker-compose.yml -f ci_build.yml build # source: https://github.com/inspirehep/inspire-next/blob/9700274c36074a3e43168bf48b8ba3e3bfa7bcdf/.travis.yml after_script: # Killing via SIGTERM in order to trigger atexit and dump coverage information in WSGI - "docker-compose -f docker-compose.yml kill -s SIGTERM" - # - "docker-compose -f docker-compose.yml rm -f" diff --git a/release_tag.sh b/release_tag.sh index f9eb8df..252b8f1 100755 --- a/release_tag.sh +++ b/release_tag.sh @@ -14,4 +14,4 @@ SHA=$(echo $ID | cut -d\: -f2) echo $ID echo $SHA docker tag $ID bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION -# docker push bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION \ No newline at end of file +docker push bossjones/boss-docker-jhbuild-pygobject3:$TAG_VERSION From 50a18d1d8be8393abaefcc70fa40e816095c2bf5 Mon Sep 17 00:00:00 2001 From: Malcolm Jones Date: Thu, 22 Jun 2017 22:40:16 -0400 Subject: [PATCH 8/8] Hotfix: fix docker on trusty --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 818e587..c614149 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,12 @@ matrix: fast_finish: true include: - python: '3.5' - env: DOCKER_COMPOSE_VERSION=1.8.0 TEST_TARGET=default DOCKER_DATA="$HOME/docker_data" DOCKER_VERSION=1.12.0-0~trusty DOCKER_COMPOSE_VERSION=1.8.0 + env: + DOCKER_COMPOSE_VERSION: 1.8.0 + TEST_TARGET: default + DOCKER_DATA: "$HOME/docker_data" + DOCKER_VERSION: 17.03.1~ce-0~ubuntu-trusty + DOCKER_COMPOSE_VERSION: 1.8.0 sudo: required dist: trusty language: python @@ -14,10 +19,14 @@ services: - docker before_install: + - sudo apt-get update + - travis_retry pip install coveralls + - sudo apt-cache search docker # List available docker versions. - - apt-cache madison docker-engine + - apt-cache madison docker-ce + - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce=$DOCKER_VERSION # Update Docker. See: https://graysonkoonce.com/managing-docker-and-docker-compose-versions-on-travis-ci/. - - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y --force-yes docker-engine=${DOCKER_VERSION} + # - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y --force-yes docker.io # Add docker-compose at the version specified in ENV. - sudo rm -f /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose