me
/
guix
Archived
1
0
Fork 0

gnu: zig-0.9: Use gexp.

* gnu/packages/zig.scm (zig-0.9)[arguments]: Use gexp.

Change-Id: I38c856320ace6d960ae342f5de164ca6c3f449c0
master
Hilton Chain 2023-10-23 22:26:45 +08:00
parent ca8dda2428
commit 1680e3c77f
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
1 changed files with 48 additions and 47 deletions

View File

@ -147,23 +147,24 @@ toolchain. Among other features it provides
(native-inputs (native-inputs
(list llvm-13)) (list llvm-13))
(arguments (arguments
`(#:configure-flags (list
(list ,@(if (%current-target-system) #:configure-flags
(string-append "-DZIG_TARGET_TRIPLE=" #~(list #$@(if (%current-target-system)
(%current-target-system)) (list (string-append "-DZIG_TARGET_TRIPLE="
(%current-target-system)))
'())) '()))
#:out-of-source? #f ; for tests #:out-of-source? #f ; for tests
;; There are too many unclear test failures. ;; There are too many unclear test failures.
#:tests? ,(not (or (target-riscv64?) #:tests? (not (or (target-riscv64?)
(%current-target-system))) (%current-target-system)))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'configure 'set-cache-dir (add-after 'configure 'set-cache-dir
(lambda _ (lambda _
;; Set cache dir, otherwise Zig looks for `$HOME/.cache'. ;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
(setenv "ZIG_GLOBAL_CACHE_DIR" (setenv "ZIG_GLOBAL_CACHE_DIR"
(string-append (getcwd) "/zig-cache")))) (string-append (getcwd) "/zig-cache"))))
,@(if (target-riscv64?) #$@(if (target-riscv64?)
;; It is unclear why all these tests fail to build. ;; It is unclear why all these tests fail to build.
`((add-after 'unpack 'adjust-tests `((add-after 'unpack 'adjust-tests
(lambda _ (lambda _
@ -181,15 +182,15 @@ toolchain. Among other features it provides
'()) '())
(delete 'check) (delete 'check)
(add-after 'install 'check (add-after 'install 'check
(lambda* (#:key outputs tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?
(invoke (string-append (assoc-ref outputs "out") "/bin/zig") (invoke (string-append #$output "/bin/zig")
;; Testing the standard library takes >7.5GB RAM, and ;; Testing the standard library takes >7.5GB RAM, and
;; will fail if it is OOM-killed. The 'test-toolchain' ;; will fail if it is OOM-killed. The 'test-toolchain'
;; target skips standard library and doc tests. ;; target skips standard library and doc tests.
"build" "test-toolchain" "build" "test-toolchain"
;; Stage 2 is experimental, not what we run with `zig', ;; Stage 2 is experimental, not what we run with `zig',
;; and stage 2 tests require a lot of RAM.
"-Dskip-stage2-tests" "-Dskip-stage2-tests"
;; Non-native tests try to link and execute non-native ;; Non-native tests try to link and execute non-native
;; binaries. ;; binaries.