From 180fb2c350b838cb0352ca19d605a83d9f19cda215c40467ccc3fcd36c41762d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 25 Mar 2026 13:45:04 +0300 Subject: [PATCH] detpax is optional --- build/contrib/detpax/.gitignore | 1 - build/lib/mk-pkg | 13 +++++++------ contrib/prepare-deps/README | 17 ++++++++--------- contrib/prepare-deps/link-from-distfiles | 19 ++++++++++--------- contrib/prepare-deps/steps/080-detpax | 4 ++++ doc/Build/skelpkg | 6 ++++-- lib/rc | 1 + 7 files changed, 34 insertions(+), 27 deletions(-) delete mode 100644 build/contrib/detpax/.gitignore create mode 100644 contrib/prepare-deps/steps/080-detpax diff --git a/build/contrib/detpax/.gitignore b/build/contrib/detpax/.gitignore deleted file mode 100644 index f65c310..0000000 --- a/build/contrib/detpax/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/detpax diff --git a/build/lib/mk-pkg b/build/lib/mk-pkg index 52a8f68..d4943df 100755 --- a/build/lib/mk-pkg +++ b/build/lib/mk-pkg @@ -29,9 +29,6 @@ namenhash="$1" [ -d "$namenhash" ] shift -[ -x "$BASS_ROOT"/build/contrib/detpax/detpax ] || - ( cd "$BASS_ROOT"/build/contrib/detpax ; ./build ) - [ -n "$BASS_NOSYNC" ] || find $namenhash -type f -or -type d -exec $FSYNC {} + tmp=$(mktemp -d $TMPDIR/$namenhash-mk-pkg.XXXXXX) @@ -46,8 +43,8 @@ EOF chmod -R a-w $namenhash { - "$BASS_ROOT"/build/contrib/detpax/detpax -prec skelpkg $namenhash || - touch $tmp/tar-pipe-failed + [ -z "$NO_DETPAX" ] && cmd="$TAR cf -" || cmd="detpax -prec skelpkg" + $cmd $namenhash || touch $tmp/tar-pipe-failed } | { $COMPRESSOR || touch $tmp/tar-pipe-failed ; } | { tee $tmp/$namenhash || touch $tmp/tar-pipe-failed ; } | @@ -59,4 +56,8 @@ mv $namenhash bin mv $namenhash.hashes bin.hashes totar="name name.hashes buildinfo buildinfo.hashes bin.hashes bin" chmod a-w $totar -"$BASS_ROOT"/build/contrib/detpax/detpax $totar +if [ -z "$NO_DETPAX" ] ; then + $TAR cf - $totar +else + detpax $totar +fi diff --git a/contrib/prepare-deps/README b/contrib/prepare-deps/README index 7e7bb6f..16ef9ed 100644 --- a/contrib/prepare-deps/README +++ b/contrib/prepare-deps/README @@ -1,19 +1,18 @@ Bunch of scripts for preparing the dependencies required for BASS. -Make, C compiler are prerequired. Go, goredo, meta4ra, zstd will be built. +Make, C compiler are prerequired. + +There are various steps: Go compiler bootstrapping, zstd, goredo, +meta4ra, detpax building. All those steps are optional in general. +You may use different redo implementation. May use different fetcher +and no deterministic archiver. All of that means no need in Go building +at all, as no Go-written software will be used. Either touch $step.done +in your state directory, or just remove unnecessary steps you want to skip. * Create the state directory, where all your build artefacts will be built: $ mkdir state $ cd state * Start dependencies download process from the Internet: $ /path/to/prepare-deps/dl -* If you already have some version of the Go (its 1.4 version is not - easy to build on modern systems), then you can touch the following - steps, telling that they should not be done: - 010-go1.4.3.done - 020-go1.17.12.done - 030-go1.20.14.done - 040-go1.23.5.done - and symlink your Go to ./go1.4.3, ./go1.17.12, ./go1.20.14, ./go1.23.5 * Start build process itself: $ /path/to/prepare-deps/do * Result local/bin should contain only statically built programs, that diff --git a/contrib/prepare-deps/link-from-distfiles b/contrib/prepare-deps/link-from-distfiles index 9ac3c6c..b0cea33 100755 --- a/contrib/prepare-deps/link-from-distfiles +++ b/contrib/prepare-deps/link-from-distfiles @@ -1,13 +1,14 @@ #!/bin/sh -e +ROOT=$(realpath -- $(dirname "$0")) mkdir -p distfiles cd distfiles -ln -f ../../../build/distfiles/go1.4.3.tar.gz go1.4.3.src.tar.gz -ln -f ../../../build/distfiles/go1.17.12.tar.gz go1.17.12.src.tar.gz -ln -f ../../../build/distfiles/go1.20.14.tar.gz go1.20.14.src.tar.gz -ln -f ../../../build/distfiles/go1.23.5.tar.gz go1.23.5.src.tar.gz -ln -f ../../../build/distfiles/go1.25.6.tar.gz go1.25.6.src.tar.gz -ln -f ../../../build/distfiles/go1.26.1.tar.gz go1.26.1.src.tar.gz -ln -f ../../../build/distfiles/goredo-2.9.2.tar.zst -ln -f ../../../build/distfiles/meta4ra-2.1.0.tar.zst -ln -f ../../../build/distfiles/zstd-1.5.7.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.4.3.tar.gz go1.4.3.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.17.12.tar.gz go1.17.12.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.20.14.tar.gz go1.20.14.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.23.5.tar.gz go1.23.5.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.25.6.tar.gz go1.25.6.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/go1.26.1.tar.gz go1.26.1.src.tar.gz +ln -f $ROOT/../../build/distfiles/dl/goredo-2.9.2.tar.zst +ln -f $ROOT/../../build/distfiles/dl/meta4ra-2.1.0.tar.zst +ln -f $ROOT/../../build/distfiles/dl/zstd-1.5.7.tar.gz diff --git a/contrib/prepare-deps/steps/080-detpax b/contrib/prepare-deps/steps/080-detpax new file mode 100644 index 0000000..5510eac --- /dev/null +++ b/contrib/prepare-deps/steps/080-detpax @@ -0,0 +1,4 @@ +cd $ROOT/../../build/contrib/detpax +./build +mkdir -p $DIR/local/bin +mv detpax $DIR/local/bin diff --git a/doc/Build/skelpkg b/doc/Build/skelpkg index 8e78be5..9218f94 100644 --- a/doc/Build/skelpkg +++ b/doc/Build/skelpkg @@ -29,12 +29,14 @@ entries: A [Index/Concepts] pax-archive A [Index/Concepts] ustar-archive A [Index/Programs] detpax +A [Index/Variables] NO_DETPAX POSIX ustar archive format can not hold more than 8GiB of data and (very) long filenames. Forced pax usage guarantees compatibility with variety of OSes. GNU tar's format (also not having limitations above) -easily could be unreadable on non-GNU systems. BASS uses +easily could be unreadable on non-GNU systems. By default BASS uses build/contrib/detpax archiver for creating pax archives in deterministic -bit-to-bit reproducible way. +bit-to-bit reproducible way. You can use ordinary $TAR by setting +NO_DETPAX=1 in configuration file, loosing deterministic behaviour. As pax/tar does not have any kind of index, as ZIP does, it is crucial to place the largest "bin" file at the very end of the archive. And that diff --git a/lib/rc b/lib/rc index 4b92050..92e0fd2 100644 --- a/lib/rc +++ b/lib/rc @@ -27,6 +27,7 @@ fi export BASS_HASHERS="${BASS_HASHERS:-$("$BASS_ROOT"/build/bin/hashers-detect 2>/dev/null)}" +# NO_DETPAX=1 export FSYNC=${FSYNC:-$(command -v fsync 2>/dev/null || command -v sync)} export TAR=${TAR:-bsdtar} COMPRESSOR=${COMPRESSOR:-zstdmt} -- 2.52.0