summaryrefslogtreecommitdiff
path: root/guix/build-system
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2021-09-07 13:41:12 +0200
committerJulien Lepiller <julien@lepiller.eu>2021-09-08 13:39:27 +0200
commitf8f94cc5446753b37ab3ddd23e21919efd006769 (patch)
treec069489b0e3c8b3354b435373bb875c408b5efc3 /guix/build-system
parent5c5e9d4e50af20042947b6b55e462a25b9d8cfc7 (diff)
guix: dune-build-system: Put dune into a reproducible release mode.
* guix/build/dune-build-system.scm (build,check): Replace the profile parameter with the appropriate release flags. * guix/build-system/dune.scm: Remove the profile parameter. * doc/guix.texi: Remove paragraph on profile parameter. Signed-off-by: Julien Lepiller <julien@lepiller.eu>
Diffstat (limited to 'guix/build-system')
-rw-r--r--guix/build-system/dune.scm19
1 files changed, 16 insertions, 3 deletions
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 1a64cf9b75..5b33ef6841 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -60,6 +60,17 @@
#:allow-other-keys
#:rest arguments)
"Return a bag for NAME."
+
+ ;; Flags that put dune into reproducible build mode.
+ (define dune-release-flags
+ (if (version>=? (package-version dune) "2.5.0")
+ ;; For dune >= 2.5.0 this is just --release.
+ ''("--release")
+ ;; --release does not exist before 2.5.0. Replace with flags compatible
+ ;; with our old ocaml4.07-dune (1.11.3)
+ ''("--root" "." "--ignore-promoted-rules" "--no-config"
+ "--profile" "release")))
+
(define private-keywords
'(#:source #:target #:dune #:findlib #:ocaml #:inputs #:native-inputs))
@@ -79,7 +90,9 @@
(build-inputs `(("dune" ,dune)
,@(bag-build-inputs base)))
(build dune-build)
- (arguments (strip-keyword-arguments private-keywords arguments))))))
+ (arguments (append
+ `(#:dune-release-flags ,dune-release-flags)
+ (strip-keyword-arguments private-keywords arguments)))))))
(define* (dune-build store name inputs
#:key (guile #f)
@@ -89,7 +102,7 @@
(out-of-source? #t)
(jbuild? #f)
(package #f)
- (profile "release")
+ (dune-release-flags ''())
(tests? #t)
(test-flags ''())
(test-target "test")
@@ -129,7 +142,7 @@ provides a 'setup.ml' file as its build system."
#:out-of-source? ,out-of-source?
#:jbuild? ,jbuild?
#:package ,package
- #:profile ,profile
+ #:dune-release-flags ,dune-release-flags
#:tests? ,tests?
#:test-target ,test-target
#:install-target ,install-target