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,52 +147,53 @@ 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 '()))
;; There are too many unclear test failures. #:out-of-source? #f ; for tests
#:tests? ,(not (or (target-riscv64?) ;; There are too many unclear test failures.
(%current-target-system))) #:tests? (not (or (target-riscv64?)
#:phases (%current-target-system)))
(modify-phases %standard-phases #:phases
(add-after 'configure 'set-cache-dir #~(modify-phases %standard-phases
(lambda _ (add-after 'configure 'set-cache-dir
;; Set cache dir, otherwise Zig looks for `$HOME/.cache'. (lambda _
(setenv "ZIG_GLOBAL_CACHE_DIR" ;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
(string-append (getcwd) "/zig-cache")))) (setenv "ZIG_GLOBAL_CACHE_DIR"
,@(if (target-riscv64?) (string-append (getcwd) "/zig-cache"))))
;; It is unclear why all these tests fail to build. #$@(if (target-riscv64?)
`((add-after 'unpack 'adjust-tests ;; It is unclear why all these tests fail to build.
(lambda _ `((add-after 'unpack 'adjust-tests
(substitute* "build.zig" (lambda _
((".*addRuntimeSafetyTests.*") "") (substitute* "build.zig"
((".*addRunTranslatedCTests.*") "")) ((".*addRuntimeSafetyTests.*") "")
(substitute* "test/standalone.zig" ((".*addRunTranslatedCTests.*") ""))
;; These tests fail to build on riscv64-linux. (substitute* "test/standalone.zig"
;; They both contain 'exe.linkSystemLibrary("c");' ;; These tests fail to build on riscv64-linux.
((".*shared_library.*") "") ;; They both contain 'exe.linkSystemLibrary("c");'
((".*mix_o_files.*") "") ((".*shared_library.*") "")
;; ld.lld: error: undefined symbol: __tls_get_addr ((".*mix_o_files.*") "")
;; Is this symbol x86 only in glibc? ;; ld.lld: error: undefined symbol: __tls_get_addr
((".*link_static_lib_as_system_lib.*") ""))))) ;; Is this symbol x86 only in glibc?
'()) ((".*link_static_lib_as_system_lib.*") "")))))
(delete 'check) '())
(add-after 'install 'check (delete 'check)
(lambda* (#:key outputs tests? #:allow-other-keys) (add-after 'install 'check
(when tests? (lambda* (#:key tests? #:allow-other-keys)
(invoke (string-append (assoc-ref outputs "out") "/bin/zig") (when tests?
;; Testing the standard library takes >7.5GB RAM, and (invoke (string-append #$output "/bin/zig")
;; will fail if it is OOM-killed. The 'test-toolchain' ;; Testing the standard library takes >7.5GB RAM, and
;; target skips standard library and doc tests. ;; will fail if it is OOM-killed. The 'test-toolchain'
"build" "test-toolchain" ;; target skips standard library and doc tests.
;; Stage 2 is experimental, not what we run with `zig', "build" "test-toolchain"
;; and stage 2 tests require a lot of RAM. ;; Stage 2 is experimental, not what we run with `zig',
"-Dskip-stage2-tests"
;; Non-native tests try to link and execute non-native "-Dskip-stage2-tests"
;; binaries. ;; Non-native tests try to link and execute non-native
"-Dskip-non-native"))))))))) ;; binaries.
"-Dskip-non-native")))))))))
(define-public zig zig-0.10) (define-public zig zig-0.10)