summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-30 14:06:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-30 14:06:50 +0200
commitb41f45a623e0e1ddb858970172315830770bc3eb (patch)
treece323de7c39074d8e82133fe152aaeed03f95c25 /bootstrap
parentd5e9a57b0dd8cb333997b5a0ef2e072ed0b76dd9 (diff)
Make symlinks to actual binaries rather than backlinks in bootstrap script
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap42
1 files changed, 25 insertions, 17 deletions
diff --git a/bootstrap b/bootstrap
index 7a1291b..4eb33ff 100755
--- a/bootstrap
+++ b/bootstrap
@@ -176,6 +176,9 @@ while [ $# -gt 0 ]; do
esac
done
+cfg_bs="$cfg-asan-bs"
+cfg_pm="$cfg-asan-pm"
+
function git_clone () # <url>
{
local u d l
@@ -238,43 +241,43 @@ run mkdir -p builds
#
# 2. Only building shared libraries for speed of development.
#
-run bpkg create -d "builds/$cfg-asan-bs" cc ?cli \
+run bpkg create -d "builds/$cfg_bs" cc ?cli \
config.cxx="$cxx" \
config.cc.coptions="-Wall -Wextra -Werror -g3 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" \
config.cc.loptions="-fuse-ld=gold -Wl,--threads,--thread-count,4" \
config.bin.lib=shared \
config.install.root=/tmp/install config.dist.root=/tmp/dist
-run bdep init -d libbutl -A "builds/$cfg-asan-bs" "@$cfg-asan-bs" --no-default
-run bdep init -d build2 -A "builds/$cfg-asan-bs" "@$cfg-asan-bs"
+run bdep init -d libbutl -A "builds/$cfg_bs" "@$cfg_bs" --no-default
+run bdep init -d build2 -A "builds/$cfg_bs" "@$cfg_bs"
run b build2/build2/
run build2/build2/b --version
# Package manager (and the rest of the toolchain) configuration.
#
-run bpkg create -d "builds/$cfg-asan-pm" cc cli \
+run bpkg create -d "builds/$cfg_pm" cc cli \
config.cxx="$cxx" \
config.cc.coptions="-Wall -Wextra -Werror -g3 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" \
config.cc.loptions="-fuse-ld=gold -Wl,--threads,--thread-count,4" \
config.bin.lib=shared \
config.install.root=/tmp/install config.dist.root=/tmp/dist
-run bdep init -d libbutl -A "builds/$cfg-asan-pm" "@$cfg-asan-pm" --default
-run bdep init -d libbpkg -A "builds/$cfg-asan-pm" "@$cfg-asan-pm"
-run bdep init -d bpkg -A "builds/$cfg-asan-pm" "@$cfg-asan-pm"
-run bdep init -d bdep -A "builds/$cfg-asan-pm" "@$cfg-asan-pm"
+run bdep init -d libbutl -A "builds/$cfg_pm" "@$cfg_pm" --default
+run bdep init -d libbpkg -A "builds/$cfg_pm" "@$cfg_pm"
+run bdep init -d bpkg -A "builds/$cfg_pm" "@$cfg_pm"
+run bdep init -d bdep -A "builds/$cfg_pm" "@$cfg_pm"
# Generate database support (currently and temporarily handled with a script).
#
# Note: this has to be done after bdep-init since we need the libodb headers.
# We also have to pre-update version headers.
#
-run bpkg update -d builds/$cfg-asan-pm libodb
-run b "builds/$cfg-asan-pm/libbutl/libbutl/hxx{version}"
-run b "builds/$cfg-asan-pm/libbpkg/libbpkg/hxx{version}"
-run b "builds/$cfg-asan-pm/bpkg/bpkg/hxx{version common-options}"
-run b "builds/$cfg-asan-pm/bdep/bdep/hxx{version common-options project-options}"
+run bpkg update -d "builds/$cfg_pm" libodb
+run b "builds/$cfg_pm/libbutl/libbutl/hxx{version}"
+run b "builds/$cfg_pm/libbpkg/libbpkg/hxx{version}"
+run b "builds/$cfg_pm/bpkg/bpkg/hxx{version common-options}"
+run b "builds/$cfg_pm/bdep/bdep/hxx{version common-options project-options}"
run cd bpkg/bpkg
run ./odb.sh
@@ -291,10 +294,15 @@ run bdep/bdep/bdep --version
# Add symlinks.
#
if [ "$sym" ]; then
- run sudo ln -s "$owd/build2/build2/b" /usr/local/bin/b
- run sudo ln -s "$owd/build2/build2/b-boot" /usr/local/bin/b-boot
- run sudo ln -s "$owd/bpkg/bpkg/bpkg" /usr/local/bin/bpkg
- run sudo ln -s "$owd/bdep/bdep/bdep" /usr/local/bin/bdep
+ # Note that we symlink the actual executable in the build configuration
+ # rather than the backlink in the forwarded source to make the old binary
+ # runnable in the face of compilation errors (which trigger the removal of
+ # backlinks).
+ #
+ run sudo ln -s "$owd/build2/build2/b-boot" /usr/local/bin/b-boot
+ run sudo ln -s "$owd/$builds/$cfg_bs/build2/build2/b" /usr/local/bin/b
+ run sudo ln -s "$owd/$builds/$cfg_pm/bpkg/bpkg/bpkg" /usr/local/bin/bpkg
+ run sudo ln -s "$owd/$builds/$cfg_pm/bdep/bdep/bdep" /usr/local/bin/bdep
run export PATH="/usr/local/bin:$PATH"
run which b bpkg bdep