From 7c710ce61f11cb328688a1fd9b88973b58dbc8f5 Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Thu, 30 Jul 2015 10:53:28 +1000 Subject: [PATCH 1/7] build: use travis-ci's new container infrastructure - will see what breaks --- .travis.yml | 24 ++++++++++++++++-------- easy_build_x64.sh | 9 +++++++-- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index aeef60a85..4405d1338 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +sudo: false language: cpp matrix: include: @@ -8,15 +9,11 @@ matrix: - os: linux env: OS=ubuntu EASY_BUILD=hosted exclude: - - os: linux - - compiler: gcc -before_script: -- sudo add-apt-repository ppa:miselin/pedigree-compilers -y -- sudo apt-get update -q -- sudo apt-get install qemu travis-compilers + - os: linux + - compiler: gcc script: -- ./easy_build_$EASY_BUILD.sh $OS -- ./scripts/runtest.py + - ./easy_build_$EASY_BUILD.sh nosudo $OS + # - ./scripts/runtest.py install: true notifications: email: false @@ -30,3 +27,14 @@ notifications: on_failure: always slack: secure: T9GJHictl8hUOgGh5RRVmRMExqlWJByssoSYdgnFuHA8ugLXyvHyYaVjLPVcFE9yv7w+sQgki0ZIzCyUH/Hg6/UPwRaH8W4Cm57vQwhE+TUvfy6eRRvYT118X/9X3xkYwhNUks+uydP6oI9YTnvr1XrzB6L4htA7Ma/YKBDhLhg= +addons: + apt: + packages: + - libmpfr-dev + - libmpc-dev + - libgmp3-dev + - sqlite3 + - texinfo + - scons + - genisoimage + - e2fsprogs diff --git a/easy_build_x64.sh b/easy_build_x64.sh index 5560eb7c5..de56818bc 100755 --- a/easy_build_x64.sh +++ b/easy_build_x64.sh @@ -19,6 +19,7 @@ echo compiler_build_options="" real_os="" +nosudo=0 if [ ! -e $script_dir/.easy_os ]; then echo "Checking for dependencies... Which operating system are you running on?" @@ -28,6 +29,10 @@ if [ ! -e $script_dir/.easy_os ]; then read os else os=$1 + if [ "$os" = "nosudo" ]; then + os=$2 + nosudo=1 + fi fi shopt -s nocasematch @@ -38,11 +43,11 @@ if [ ! -e $script_dir/.easy_os ]; then debian) # TODO: Not sure if the package list is any different for debian vs ubuntu? echo "Installing packages with apt-get, please wait..." - sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage + [ $nosudo = 0 ] && sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage ;; ubuntu) echo "Installing packages with apt-get, please wait..." - sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage e2fsprogs + [ $nosudo = 0 ] && sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage e2fsprogs ;; opensuse) echo "Installing packages with zypper, please wait..." From 2beaf6588084baeec25ca24fc81c09e4908c8e6e Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Thu, 30 Jul 2015 11:26:50 +1000 Subject: [PATCH 2/7] build: add qemu for travis apt deps, uncomment the travis runtest script (which will fail because qemu is not yet installed - it's requested though) --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4405d1338..43a6cb416 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: - compiler: gcc script: - ./easy_build_$EASY_BUILD.sh nosudo $OS - # - ./scripts/runtest.py + - ./scripts/runtest.py install: true notifications: email: false @@ -38,3 +38,4 @@ addons: - scons - genisoimage - e2fsprogs + - qemu From 8ddf9d3b39ec9c7db3468421470adffc89dc96af Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Thu, 30 Jul 2015 13:36:26 +1000 Subject: [PATCH 3/7] build: add travis cache for compiler builds --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 43a6cb416..8d60b119f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,3 +39,7 @@ addons: - genisoimage - e2fsprogs - qemu +cache: + directories: + - $HOME/.ccache + - $HOME/pedigree/pedigree-compiler From 26e956a3fe44add678776aa6df59c24377a7bf81 Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Thu, 30 Jul 2015 13:41:25 +1000 Subject: [PATCH 4/7] build: fix up travis compiler directory for cache --- .travis.yml | 2 +- build-etc/travis.sh | 3 +++ easy_build_x64.sh | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d60b119f..bc899d3dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,4 +42,4 @@ addons: cache: directories: - $HOME/.ccache - - $HOME/pedigree/pedigree-compiler + - $HOME/pedigree-compiler diff --git a/build-etc/travis.sh b/build-etc/travis.sh index e675053a6..aca276f58 100644 --- a/build-etc/travis.sh +++ b/build-etc/travis.sh @@ -5,6 +5,9 @@ TRAVIS_OPTIONS= if [ ! -z "$TRAVIS" ]; then TRAVIS_OPTIONS="travis=$TRAVIS forcemtools=1" + # Override the compiler directory for Travis caching. + COMPILER_DIR=$HOME/pedigree-compiler + # The toolchain .deb file installs all files owned as root, which is not # useful when we want to symlink our crt* and POSIX headers. So, fix that. ME=`whoami` diff --git a/easy_build_x64.sh b/easy_build_x64.sh index de56818bc..f12524057 100755 --- a/easy_build_x64.sh +++ b/easy_build_x64.sh @@ -7,6 +7,7 @@ old=$(pwd) script_dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && script_dir=$script_dir cd $old +COMPILER_DIR=$script_dir/pedigree-compiler . $script_dir/build-etc/travis.sh set -e @@ -127,7 +128,7 @@ case $real_os in esac # Install cross-compilers -$script_dir/scripts/checkBuildSystemNoInteractive.pl x86_64-pedigree $script_dir/pedigree-compiler $compiler_build_options +$script_dir/scripts/checkBuildSystemNoInteractive.pl x86_64-pedigree $COMPILER_DIR $compiler_build_options old=$(pwd) cd $script_dir @@ -163,7 +164,7 @@ export LIBTOOL=$script_dir/../images/local/applications:$PATH # again to build it against the shared libstdc++. Once a working shared # libstdc++ exists, the static one built here is no longer relevant. # What a mess! -$script_dir/scripts/checkBuildSystemNoInteractive.pl x86_64-pedigree $script_dir/pedigree-compiler $compiler_build_options "libcpp" +$script_dir/scripts/checkBuildSystemNoInteractive.pl x86_64-pedigree $COMPILER_DIR $compiler_build_options "libcpp" set +e From 1b6e54106f2d46493a99e6d7bc2c79ed83b95dcc Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Thu, 30 Jul 2015 14:03:41 +1000 Subject: [PATCH 5/7] build: don't run qemu on travis (waiting on apt whitelist) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc899d3dd..45fc9bdb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: - compiler: gcc script: - ./easy_build_$EASY_BUILD.sh nosudo $OS - - ./scripts/runtest.py + # - ./scripts/runtest.py install: true notifications: email: false From 6c400ff457c7bc806584149b4ea93cee98dd0531 Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Mon, 12 Oct 2015 15:23:57 +1100 Subject: [PATCH 6/7] build: nasm for travis build for hosted target --- .travis.yml | 1 + easy_build_hosted.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45fc9bdb2..7371301df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ addons: - genisoimage - e2fsprogs - qemu + - nasm cache: directories: - $HOME/.ccache diff --git a/easy_build_hosted.sh b/easy_build_hosted.sh index 1e5837a1b..8f9ac2424 100755 --- a/easy_build_hosted.sh +++ b/easy_build_hosted.sh @@ -28,6 +28,10 @@ if [ ! -e $script_dir/.easy_os ]; then read os else os=$1 + if [ "$os" = "nosudo" ]; then + os=$2 + nosudo=1 + fi fi shopt -s nocasematch @@ -38,11 +42,11 @@ if [ ! -e $script_dir/.easy_os ]; then debian) # TODO: Not sure if the package list is any different for debian vs ubuntu? echo "Installing packages with apt-get, please wait..." - sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage nasm + [ $nosudo = 0 ] && sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage nasm ;; ubuntu) echo "Installing packages with apt-get, please wait..." - sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage nasm + [ $nosudo = 0 ] && sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev sqlite3 texinfo scons genisoimage nasm ;; opensuse) echo "Installing packages with zypper, please wait..." From cb85ca2484f9407c91ff7db303c6fb33a5720fcc Mon Sep 17 00:00:00 2001 From: Matthew Iselin Date: Wed, 21 Oct 2015 11:02:43 +1100 Subject: [PATCH 7/7] build: fall back to xorriso if mkisofs and genisoimage both can't be found --- .travis.yml | 4 ++-- SConstruct | 2 +- site_scons/buildutils/diskimages/livecd.py | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7371301df..fcc1da00d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: - compiler: gcc script: - ./easy_build_$EASY_BUILD.sh nosudo $OS - # - ./scripts/runtest.py + - ./scripts/runtest.py install: true notifications: email: false @@ -36,7 +36,7 @@ addons: - sqlite3 - texinfo - scons - - genisoimage + - xorriso - e2fsprogs - qemu - nasm diff --git a/SConstruct b/SConstruct index 698c24dfb..f54a59576 100755 --- a/SConstruct +++ b/SConstruct @@ -238,7 +238,7 @@ env['PYFLAKES'] = env.Detect('pyflakes') env['MTOOLS_MMD'] = env.Detect('mmd') env['MTOOLS_MCOPY'] = env.Detect('mcopy') env['MTOOLS_MDEL'] = env.Detect('mdel') -env['MKISOFS'] = env.Detect(['mkisofs', 'genisoimage']) +env['MKISOFS'] = env.Detect(['mkisofs', 'genisoimage', 'xorriso']) env['SQLITE'] = env.Detect('sqlite3') env['MKIMAGE'] = env.Detect('mkimage') env['GIT'] = env.Detect('git') diff --git a/site_scons/buildutils/diskimages/livecd.py b/site_scons/buildutils/diskimages/livecd.py index 1abb62c7f..4ff6b24d3 100644 --- a/site_scons/buildutils/diskimages/livecd.py +++ b/site_scons/buildutils/diskimages/livecd.py @@ -43,8 +43,16 @@ def buildCdImage(target, source, env): shutil.copy(pathToMenu, '%s.mkisofs' % pathToMenu) pathToMenu += '.mkisofs' + env['MKISOFS'] = 'xorriso' + args = [ env['MKISOFS'], + ] + + if env['MKISOFS'] == 'xorriso': + args.extend(['-as', 'mkisofs']) + + args.extend([ '-D', '-joliet', '-graft-points', @@ -67,7 +75,7 @@ def buildCdImage(target, source, env): 'boot/kernel=%s' % (source[2].abspath,), 'boot/initrd.tar=%s' % (source[1].abspath,), '.pedigree-root=%s' % (source[0].abspath,), - ] + ]) if env['livecd']: args.extend([