]> Sergey Matveev's repositories - bass.git/commitdiff
detpax is optional
authorSergey Matveev <stargrave@stargrave.org>
Wed, 25 Mar 2026 10:45:04 +0000 (13:45 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 25 Mar 2026 10:45:04 +0000 (13:45 +0300)
build/contrib/detpax/.gitignore [deleted file]
build/lib/mk-pkg
contrib/prepare-deps/README
contrib/prepare-deps/link-from-distfiles
contrib/prepare-deps/steps/080-detpax [new file with mode: 0644]
doc/Build/skelpkg
lib/rc

diff --git a/build/contrib/detpax/.gitignore b/build/contrib/detpax/.gitignore
deleted file mode 100644 (file)
index f65c310..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/detpax
index 52a8f681b8751f3988f5256cd26ca795ce0cc4cd7665cd68d089d85ce3a063b5..d4943df4fd1238096fe39d612e6efd36d8541dd00c4c2a767853ca0c351f3a27 100755 (executable)
@@ -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
index 7e7bb6fb17303db5862fcc86a00bd2e89e7d8dd55b7f498a094efe0df6050bf1..16ef9ed806802a7120026f3874c316e2fe5c22a3b3da32a844dd99cfe957b801 100644 (file)
@@ -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
index 9ac3c6c86a169748893961f03ccdc96210be15f9f6e32151372be38feb5c9879..b0cea3360cf02fdbea6571070d0b6bb1763abe5d7bf282a0cdae8764be7d749e 100755 (executable)
@@ -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 (file)
index 0000000..5510eac
--- /dev/null
@@ -0,0 +1,4 @@
+cd $ROOT/../../build/contrib/detpax
+./build
+mkdir -p $DIR/local/bin
+mv detpax $DIR/local/bin
index 8e78be59eb4a200e2be1150af81cc886b8d920583472bd08236f1ac153be2d5c..9218f9407059b752763f5e026fa655f8f3030a0821488c4cee1941d6cbf06103 100644 (file)
@@ -29,12 +29,14 @@ entries:
 A [Index/Concepts] pax-archive\r
 A [Index/Concepts] ustar-archive\r
 A [Index/Programs] detpax\r
+A [Index/Variables] NO_DETPAX\r
 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 4b92050b943b68d11e713f62c30338fa959e2e3ff3bf4f602ba3e09be5b06a05..92e0fd260ccdebbeaa9df3d6faab6936e829717553646de55fc5f5ae669809a9 100644 (file)
--- 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}