diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-04 07:14:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-04 07:14:34 +0200 |
commit | ec050b2f1a1a1e51692251d3a7687e48c226fff5 (patch) | |
tree | 4601d8d4c8060486a5170a0b49c6762d69feb2c1 | |
parent | 0d7d9b481d8dff60c96b20967bc6e30aa388b3c5 (diff) |
Updates during the 0.2.0 release0.2.0
-rw-r--r-- | git/modules | 16 | ||||
-rwxr-xr-x | install | 51 | ||||
-rwxr-xr-x | intro | 242 | ||||
-rwxr-xr-x | publish | 9 | ||||
-rw-r--r-- | release.txt | 111 | ||||
-rwxr-xr-x | stage | 2 | ||||
-rwxr-xr-x | test | 51 | ||||
-rwxr-xr-x | version | 22 |
8 files changed, 444 insertions, 60 deletions
diff --git a/git/modules b/git/modules index ffac205..76c1176 100644 --- a/git/modules +++ b/git/modules @@ -1,6 +1,5 @@ modules=" \ git \ -etc \ private \ libbutl \ build2 \ @@ -8,3 +7,18 @@ libbpkg \ bpkg \ brep \ build2-toolchain" + +# During release it is useful to exclude etc/ so can +# do mass commits (like version updates). +# +modules="$modules etc" + +# We don't tag etc/ and private/. +# +tag_modules=" \ +libbutl \ +build2 \ +libbpkg \ +bpkg \ +brep \ +build2-toolchain" @@ -16,7 +16,7 @@ # Use sudo when installing. # # -t -# Install toolchain only. +# Build and install toolchain only, no extras (brep). # # --cxx <path> # C++ compiler to use, g++ by default. @@ -27,6 +27,9 @@ # --cppflags <flags> # Extra C++ preprocessor flags to use. # +# --bpkgflags <flags> +# Extra flags to pass to bpkg. +# # For example: # # install /tmp/build2-toolchain-0.1.0.tar.gz https://pkg.cppget.org/1/alpha @@ -47,11 +50,12 @@ lib="/usr/local" # Library (libodb, etc) installation directory. ins="$tmp/build2-install" # Our installation directory. sudo= extras=brep # Extras to build. -extras_show=brep-loader # Extra programs (in bin/) to test with --version. +extras_show=brep-load # Extra programs (in bin/) to test with --version. pmc="build2-toolchain" # bpkg configuration directory cxx="g++" cxxflags="-W -Wall -Wno-unknown-pragmas" cppflags= +bpkgflags= while [ $# -gt 0 ]; do case $1 in @@ -88,6 +92,11 @@ while [ $# -gt 0 ]; do cppflags="$1" shift ;; + --bpkgflags) + shift + bpkgflags="$1" + shift + ;; *) if [ -z "$tca" ]; then tca=${1%/}; shift @@ -98,6 +107,8 @@ while [ $# -gt 0 ]; do esac done +echo "'$bpkgflags'" + if [ -z "$tca" ]; then error $usage fi @@ -122,7 +133,7 @@ elif [[ $tca != /* ]]; then tca=$owd/$tca fi -if [[ ( $rep != http://* || $tca == https://* ) && $rep != /* ]]; then +if [[ $rep != http://* && $rep != https://* && $rep != /* ]]; then rep=$owd/$rep fi @@ -138,6 +149,11 @@ fi tcb=`basename $tca .tar.gz` +# Remove installation directories so that any old stuff doesn't affect +# us due to rpath. +# +$sudo rm -rf $ins $ins-boot + # Unpack. # rm -rf $tcb @@ -148,13 +164,13 @@ tar xfz $tca # cd $tcb/build2 ./bootstrap --cxx $cxx --cxxflags "$cxxflags" -./build/b-boot \ +./build2/b-boot \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ config.bin.rpath=$ins-boot/lib update cd .. -./build2/build/b \ +./build2/build2/b \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ config.cxx.poptions="$cppflags -I$lib/include" \ @@ -164,17 +180,14 @@ cd .. config.install.root.sudo=$sudo \ configure -./build2/build/b update - -$sudo mkdir -p $ins-boot -$sudo rm -rf $ins-boot/* -./build2/build/b install +./build2/build2/b update +./build2/build2/b install function show () # <dir> <prog>... { local d=$1; shift for p in $*; do - if [ `which $p` != "$d/bin/$p" ]; then + if [ "`which $p`" != "$d/bin/$p" ]; then error "wrong $p path: `which $p`" fi @@ -198,7 +211,7 @@ rm -rf $pmc/* rm -rf $pmc.disabled cd $pmc -bpkg create \ +bpkg $bpkgflags create \ cxx \ config.cxx=$cxx \ config.cxx.coptions="$cxxflags" \ @@ -208,13 +221,11 @@ bpkg create \ config.install.root=$ins \ config.install.root.sudo=$sudo \ -bpkg add $rep -bpkg fetch -bpkg build --yes build2 bpkg +bpkg $bpkgflags add $rep +bpkg $bpkgflags fetch +bpkg $bpkgflags build --yes build2 bpkg -$sudo mkdir -p $ins -$sudo rm -rf $ins/* -bpkg install build2 bpkg +bpkg $bpkgflags install build2 bpkg cd $tmp mv $pmc $pmc.disabled @@ -228,8 +239,8 @@ mv $pmc.disabled $pmc # if [ ! -z "$extras" ]; then cd $pmc - bpkg build --yes $extras - bpkg install $extras + bpkg $bpkgflags build --yes $extras + bpkg $bpkgflags install $extras cd $tmp mv $pmc $pmc.disabled @@ -0,0 +1,242 @@ +#! /usr/bin/env bash + +# Test examples from the into. +# +# Usage: install [options] <hello-repo> +# +# -t <toolchain> +# Specify the build2 toolchain install/stage directory. The script will +# use <toolchain>/bin/b and <toolchain>/bin/bpkd instead of just b and +# bpkg. +# +# -c1 +# -c2 +# -c3 +# C++ compilers 1 (g++-5), 2 (clang++-3.6), and 3 prefix +# (x86_64-w64-mingw32). If the value for 2 or 2 is empty, then this test +# is skipped. +# +# -h +# The hello2 source directory, by default hello/hello2 +# +# For example: +# +# intro https://pkg.cppget.org/1/hello +# intro /var/bpkg/1/hello +# +usage="usage: $0 [options] <hello-repo>" + +owd=`pwd` +trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. + +function error () { echo "$*" 1>&2; exit 1; } + +tmp=/tmp +rep= +toolchain= +hello2=hello/hello2 + +c1=g++-5 +c2=clang++-3.6 +c3=x86_64-w64-mingw32 + +while [ $# -gt 0 ]; do + case $1 in + -t) + shift + toolchain=${1%/} + shift + ;; + -c1) + shift + c1=$1 + shift + ;; + -c2) + shift + c2=$1 + shift + ;; + -c3) + shift + c3=$1 + shift + ;; + -h) + shift + hello2=${1%/} + shift + ;; + *) + rep=${1%/} + break + ;; + esac +done + +if [ -z "$rep" ]; then + error "$usage" +fi + +if [[ $hello2 != /* ]]; then + hello2=$owd/$hello2 +fi + +if [ ! -d "$hello2" ]; then + error "hello2 directory $hello2 does not exist" +fi + +if [ -n "$toolchain" ]; then + export PATH="$toolchain/bin:$PATH" + + if [ "`which b`" != "$toolchain/bin/b" ]; then + error "b does not appear to be in $toolchain/bin/" + fi + + if [ "`which bpkg`" != "$toolchain/bin/bpkg" ]; then + error "bpkg does not appear to be in $toolchain/bin/" + fi +fi + +if [ -z "`which tree`" ]; then + tree="ls -1" +else + tree=tree +fi + +function create () # <dir> <bpkg-args> +{ + local d=$1; shift + + rm -rf $tmp/$d + mkdir $tmp/$d + cd $tmp/$d + bpkg create $* +} + +function info () # stable|testing +{ + local d=$1; shift + bpkg rep-info $rep/$d +} + +function add () # stable|testing +{ + local d=$1; shift + bpkg add $rep/$d +} + +function fetch () +{ + bpkg fetch +} + +function build () # <bpkg-args> +{ + bpkg build -y $* +} + +function drop () # <bpkg-args> +{ + bpkg drop -y $* +} + +function status () # <pkg> <expected> +{ + local s=`bpkg status $1` + echo "$s" + + if [ "$s" != "$2" ]; then + error "status $1: '"$s"', expected: '"$2"'" + fi +} + +function update () # <bpk> +{ + bpkg update $* +} + +function test () # <bpk> +{ + bpkg test $* +} + +create hello-gcc5-release cxx config.cxx=$c1 config.cxx.coptions=-O3 +info stable +add stable +fetch +build hello +drop hello +build -v hello +status libhello "configured 1.0.0+1" +status hello "configured 1.0.0 hold_package" +drop hello +status hello "available 1.0.0" +status libfoobar "unknown" + +build hello +add testing +fetch +build hello +build libhello +update hello +build libhello/1.0.0 hello + +test libhello hello +ls -1F +ls -1F hello-1.0.0/ +hello-1.0.0/hello || true +hello-1.0.0/hello World + +bpkg install config.install.root=/opt/hello config.install.root.sudo=sudo hello +$tree -F /opt/hello/ +/opt/hello/bin/hello World +sudo rm -rf /opt/hello + +cd $hello2 +b config.cxx=$c1 config.import.libhello=$tmp/hello-gcc5-release +$tree -F +./hello +b config.cxx=$c1 config.import.libhello=$tmp/hello-gcc5-release clean # Extra. + +cd $tmp +rm -rf hello2-gcc5-release +mkdir hello2-gcc5-release +b config.cxx=$c1 config.cxx.coptions=-O3 \ +config.import.libhello=$tmp/hello-gcc5-release \ +"configure($hello2/@hello2-gcc5-release/)" +b hello2-gcc5-release/ +cd hello2-gcc5-release/ +b +b clean +b -v + +cd $tmp +b "configure($hello2/@$tmp/hello-gcc5-release/hello2/)" +b $tmp/hello-gcc5-release/hello2/ +b "{clean disfigure}($tmp/hello-gcc5-release/hello2/)" + +build -d $tmp/hello-gcc5-release $hello2/ +build -d $tmp/hello-gcc5-release libhello +update -d $tmp/hello-gcc5-release hello2 +$tmp/hello-gcc5-release/hello2-1.0.0/hello + +if [ -n "$c2" ]; then + create hello-clang36-release cxx config.cxx=$c2 config.cxx.coptions=-O3 + add testing + fetch + build libhello/1.0.0 $hello2/ +fi + +if [ -n "$c3" ]; then + create hello-mingw32 cxx \ + config.cxx=$c3-g++ \ + config.bin.ar=$c3-ar \ + config.bin.lib=static config.cxx.loptions=-static + add stable + fetch + build hello + export WINEDEBUG=fixme-all + wine hello-1.0.0/hello.exe Windows +fi @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# Publish build2 to build2.org/cppget.org. +# Publish build2 to build2.org/cppget.org (and brep.cppget.org). # # Usage: publish [<rsync-options>] # @@ -27,10 +27,15 @@ fi function sync () { - rsync -v -rlpt --copy-unsafe-links --prune-empty-dirs --delete-after $* \ + info "build2.org:" + rsync -v -rlpt -c --copy-unsafe-links --prune-empty-dirs --delete-after $* \ $d/ build2.org:/var/www/download.build2.org/public/$v/ + info "cppget.org:" cppget.org/publish cppget.org/repository/1/ cppget.org:/var/bpkg/1/ $* + + info "brep.cppget.org:" + cppget.org/publish cppget.org/repository/1/ brep.cppget.org:/var/bpkg/1/ $* } sync --dry-run $* diff --git a/release.txt b/release.txt index c813817..e9985c6 100644 --- a/release.txt +++ b/release.txt @@ -1,40 +1,106 @@ TODO ==== -@@ Run tests in each project/package? -@@ Local Clang test is broken and disabled. -@@ Release date update in man page generation +@@ Looks like we need a public staging host. +@@ Local Clang test is broken and disabled, using FreeBSD for Clang testing +Notes +==== +- Be very careful with submodules if fixing anything, remember to update + build2-toolchain. Setup ===== -- Set passwordless sudo, logins to freebsd, cppget1 - - Make symlinks to development b, bpkg in /usr/local/bin/, used as the latest toolchain. - Boot cppget1, freebsd VMs, make sure data/time is correct. +- Set passwordless sudo, logins to freebsd, cppget1, rbook (Mac OS) + + For Mac OS: + echo "boris ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers + #echo "192.168.111.103 cppget1 pkg.cppget1" >>/etc/hosts + #echo "192.168.0.19 protem" >>/etc/hosts + curl --resolve 'pkg.cppget1:8080:192.168.0.19' http://pkg.cppget1:8080/1/ + iptables -t nat -A PREROUTING -d 192.168.0.19 -p tcp --dport 8080 -j DNAT --to-destination 192.168.111.103:80 + +- Copy prerequisites into build2-X.Y/, generate sha256 sums in BINARY (-b) + - Build new prerequisites (if any) on local, freebsd (install to /usr/local). Prelude ======= -- Copy new/updated prerequisites into build2-X.Y/ +- Review '@@' items [note: etc, private excluded] + + etc/review | less -R -- Need to update submodules? +- Increment version to final. -- Need to regenerate ODB files, CLI documentation? + * Need to update versions/dates for man generation. - Close schema versions, review schema changlog difference from previous release (tag) for any data migration that may be required (@@ Would also need to test this). -- Run bpkg tests, valgrind, remote (publish) +- Need to update submodules? Remember to push first. + +- Need to regenerate ODB files, CLI documentation, in build2-toolchin! + +- Update everything: + + b libbutl/ build2/ libbpkg/ bpkg/ brep/ build2-toolchain-default/ + +- Run tests for each project: + + * b 'test(libbutl/ libbpkg/)' + + * Manually in build2/ + + * Manually in bpkg/; test valgrind, publish, test remote with -v, FreeBSD + tools: + + ./test.sh -v --remote --fetch fetch --fetch-option --no-verify-peer \ + --tar bsdtar --sha256 sha256-freebsd + + * Update hello repository: + + cd hello + for d in hello libhello libprint libformat repository; do \ + git -C $d status; done + ./release -a + + * Update cppget repository (existing packages, not publishing yet): + + cd cppget.org + git -C repository status + ./update repository/1/ + + This might not work in the early stage (backwards-incompatible) + + ./test -c cxx -c config.cxx.loptions=-L/usr/local/lib \ + -c config.cxx.poptions="-I/usr/include/apache2 -I/usr/include/apr-1.0" \ + repository/1/ + + * Test dev integration of brep/ on hello and cppget repos + + First check if Apache2 configuration needs updating (INSTALL-DEV). Then + from build2/ work root: + + # This will have broken links since we are not running it as /pkg/hello. + # + brep/migrate/brep-migrate --recreate + brep/load/brep-load hello/brep-loader-home.conf + sudo /etc/init.d/apache2 restart + + brep/migrate/brep-migrate --recreate + brep/load/brep-load cppget.org/brep-loader-home.conf + sudo /etc/init.d/apache2 restart Procession ========== @@ -48,7 +114,14 @@ Procession etc/stage - Determine the earliest supported toolchain (see requires: in manifests), - update ./test + update etc/test + +- Publish hello repository [@@ Ideally we would want to stage it. Perhaps + on cppget1?] + +- Test Intro steps: + + etc/intro https://build2.org/pkg/1/hello/ - Test @@ -64,23 +137,33 @@ Procession - Test production and save a copy of toolchain in etc1/install/X.Y.Z etc/install -t -i "etc1/install/`cat build2-toolchain/version`" \ - https://download.build2.org/0.1/build2-toolchain-0.1.0.tar.gz \ + https://download.build2.org/0.Y/build2-toolchain-0.2.0.tar.gz \ + https://pkg.cppget.org/1/alpha + +etc/install -t -i "etc1/install/`cat build2-toolchain/version`" \ + https://download.build2.org/0.2/build2-toolchain-0.2.0.tar.gz \ https://pkg.cppget.org/1/alpha - Upgrade brep on cppget.org (using pkg.cppget.org), verify works -- Tag +- Tag (review tag_modules) etc/tag ./push.sh -- Commit and push cppget.org +- Commit and push cppget.org, hello git repositories + +Release +======= +cat `ls -1 *.sha256` Postlude ======== +- Need to regenerate/republish hello/ repository? + - Increment and open schema versions. Maybe not. Maybe we should only do that when there is a model change. -- Increment project versions +- Increment project versions to alpha1 @@ -8,4 +8,4 @@ usage="$0 [<rsync-options>]" trap 'exit 1' ERR -cppget.org/publish cppget.org/repository/1/ cppget1 $* +cppget.org/publish cppget.org/repository/1/ cppget1:/var/bpkg/1/ $* @@ -24,7 +24,6 @@ fi src=build2-$v - # Update the development build. # info "making sure everythings is up to date..." @@ -33,7 +32,9 @@ b build2/ bpkg/ # Test repository with the earliest and latest (development build via # /usr/local links) toolchains. # -for t in etc1/install/0.1.0 /usr/local; do +# etc1/install/0.1.0 +# +for t in /usr/local; do cppget.org/test -t $t -n \ -c cxx \ -c config.cxx.coptions="-W -Wall -Wno-unknown-pragmas" \ @@ -42,22 +43,20 @@ for t in etc1/install/0.1.0 /usr/local; do cppget.org/repository/1/ done - # Test the build2-toolchain INSTALL procedure (plus brep) with the earliest # compiler versions we claim to support and the latest available. # # Note: Clang 3.4 and 3.7 are tested on FreeBSD below (3.4 cannot coexist # with newer versions on Ubuntu). # -for c in g++-4.9 g++-5; do +for c in g++-4.8 g++-4.9 g++-5; do etc/install \ --cxx $c \ --cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \ $src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget1/1/alpha +http://pkg.cppget1/1/alpha done - # This doesn't work since libodb, etc are using libstdc++. # if false; then @@ -67,16 +66,14 @@ for c in clang++-3.5 clang++-3.6; do --cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \ --cxxflags --stdlib=libc++ \ $src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget1/1/alpha +http://pkg.cppget1/1/alpha done fi - # Test installation requiring sudo. # etc/install -t -i /opt/build2 -s $src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget1/1/alpha - +http://pkg.cppget1/1/alpha # Test on FreeBSD with Clang 3.4 (default) and Clang 3.7. # @@ -86,5 +83,37 @@ for c in clang++ clang++37; do ssh freebsd cd /tmp ';' ./install \ --cxx $c \ --cppflags '"-I/usr/local/include/apr-1 -I/usr/local/include/apache24"' \ -build2-toolchain-$tcv.tar.gz https://pkg.cppget1/1/alpha +build2-toolchain-$tcv.tar.gz http://pkg.cppget1/1/alpha done + +# Also run the Intro steps based on the toolchain we just built. +# +scp -r hello/hello2 etc/intro freebsd:/tmp/ + +ssh freebsd cd /tmp ';' ./intro \ +-t /tmp/build2-install \ +-c1 clang++37 \ +-c2 clang++ \ +-c3 "''" \ +-h /tmp/hello2 \ +https://build2.org/pkg/1/hello/ + +# Test on Mac OS (no brep). +# +scp etc/install $src/build2-toolchain-$tcv.tar.gz rbook:/tmp/ + +ssh rbook cd /tmp ';' ./install -t --cxx clang++ --bpkgflags \ +"'--fetch-option --resolve --fetch-option pkg.cppget1:8080:192.168.0.19'" \ +build2-toolchain-$tcv.tar.gz http://pkg.cppget1:8080/1/alpha + +# Again, run the Intro steps based on the toolchain we just built. +# +scp -r hello/hello2 etc/intro rbook:/tmp/ + +ssh rbook cd /tmp ';' ./intro \ +-t /tmp/build2-install \ +-c1 clang++ \ +-c2 "''" \ +-c3 "''" \ +-h /tmp/hello2 \ +https://build2.org/pkg/1/hello/ @@ -8,35 +8,35 @@ usage="usage: $0 [<module>...]" # Notes: # -# * min/max are [min, max) +# * min/max are [min max) # if min == max, then '== min' is assumed # if max is unspecified, then '>= min' is assumed # currently, max can only be 1.2.3- (#if-conditions will need adjustment) # -build2_min=0.1.0 # No max, always >=. +build2_min=0.2.0 # No max, always >=. -libbutl=0.1.0 +libbutl=0.2.0 libbutl_min=$libbutl -libbutl_max=$libbutl +libbutl_max=0.3.0- libbutl_build2=$build2_min libbutl_hxx=butl/version -build2=0.1.0 +build2=0.2.0 build2_libbutl_min=$libbutl_min build2_libbutl_max=$libbutl_max build2_build2=$build2_min build2_hxx=build2/version -libbpkg=0.1.0 +libbpkg=0.2.0 libbpkg_min=$libbpkg -libbpkg_max=$libbpkg +libbpkg_max=0.3.0- libbpkg_libbutl_min=$libbutl_min libbpkg_libbutl_max=$libbutl_max libbpkg_build2=$build2_min libbpkg_hxx=bpkg/version -bpkg=0.1.0 +bpkg=0.2.0 bpkg_libbutl_min=$libbutl_min bpkg_libbutl_max=$libbutl_max bpkg_libbpkg_min=$libbpkg_min @@ -44,10 +44,10 @@ bpkg_libbpkg_max=$libbpkg_max bpkg_build2=$build2_min bpkg_hxx=bpkg/bpkg-version -build2_toolchain=0.1.0 +build2_toolchain=0.2.0 build2_toolchain_build2=$build2_min -brep=0.1.0 +brep=0.2.0 brep_libbutl_min=$libbutl_min brep_libbutl_max=$libbutl_max brep_libbpkg_min=$libbpkg_min @@ -223,7 +223,7 @@ for m in $modules; do dch="${DV}_VERSION != $dminn" else dmaxn=`str_num $dmax` - dcm="[$dmin, $dmax)" + dcm="[$dmin $dmax)" dch="${DV}_VERSION < $dminn || ${DV}_VERSION > $dmaxn" fi |