summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Rostovtsev <dan@rostovtsev.org>2026-04-05 17:17:07 -0400
committerDan Rostovtsev <dan@rostovtsev.org>2026-04-07 20:12:36 -0400
commit12024d0faddfd49d0da7644ea231772bcb128869 (patch)
tree89d15e57088f207654eb4dcefd4784d84aa8d4de
parent90574cba9dd029e47948767bca8285ad62f28ce5 (diff)
Zeroing in on rocq diff:
* reproduce.bash: using guix build / gc to get two isolated build results * build-and-diff.scm: removed. Change-Id: I4de1ee1bdd769bf2030b173ff454be0179ca82d7
-rw-r--r--build-and-diff.scm31
-rw-r--r--reproduce.bash45
2 files changed, 45 insertions, 31 deletions
diff --git a/build-and-diff.scm b/build-and-diff.scm
deleted file mode 100644
index 39e164e9e3a..00000000000
--- a/build-and-diff.scm
+++ /dev/null
@@ -1,31 +0,0 @@
-;; build-and-diff a derivation run twice.
-(use-modules (guix packages)
- (guix store)
- (guix derivations)
- (gnu packages))
-
-(define (get-package-name) (read))
-
-(define (run-derivation-and-save pkgname outdir tag)
- (let* ((pkg (specification->package pkgname))
- (store (open-connection))
- (drv ((package->derivation pkg) store))
- (output (derivation->output-path drv))
- (dest (string-append outdir "/" tag)))
- (if (not (file-exists? outdir)) (mkdir outdir))
- (build-derivations store (list drv))
- (system* "chmod" "-R" "u+w" outdir)
- (system* "rm" "-rf" dest)
- (system* "cp" "-r" "-L" output dest)
- dest))
-
-(let* ((pkgname (get-package-name))
- (outdir (string-append "diff-build-" pkgname))
- (tags '("a" "b")))
- (write
- (map
- (lambda (tag)
- (cons tag
- (run-derivation-and-save pkgname outdir tag)))
- tags))
- (newline))
diff --git a/reproduce.bash b/reproduce.bash
new file mode 100644
index 00000000000..cb2f6993c9b
--- /dev/null
+++ b/reproduce.bash
@@ -0,0 +1,45 @@
+# a tool to reproduce a build for checking diffs
+
+while getopts :p: OPT; do
+ case $OPT in
+ p|+p)
+ PACKAGE=$OPTARG
+ ;;
+ *)
+ echo "usage: ${0##*/} [+-p ARG} [--] ARGS..."
+ exit 2
+ esac
+done
+shift $(( OPTIND - 1 ))
+OPTIND=1
+
+if [ ! $PACKAGE ]
+then
+ echo "Please set package with -p"
+ exit 1
+fi
+
+function reproduce-and-tag
+{
+ TAG=$1
+ OUT=$(guix build --no-substitutes $PACKAGE)
+ REPRODIR=repro/$PACKAGE/$TAG
+ mkdir -p $REPRODIR
+ cp -r $OUT/* $REPRODIR
+ chmod -R u+w $REPRODIR # default not writeable in store
+ guix gc -D $OUT
+ if [ -f $OUT ]
+ then
+ echo [ERROR] $OUT was not deleted
+ exit 1
+ fi
+ echo "=== REPRODUCTION SUMMARY ==="
+ echo "Tag: $TAG"
+ echo "Store Output: $OUT"
+ echo "Copied to: $REPRODIR"
+ echo "----------------------------"
+ echo
+}
+
+reproduce-and-tag "A"
+reproduce-and-tag "B"