[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
47/57: gnu: Add zig-0.11.0-1967.
From: |
guix-commits |
Subject: |
47/57: gnu: Add zig-0.11.0-1967. |
Date: |
Wed, 13 Nov 2024 11:46:56 -0500 (EST) |
hako pushed a commit to branch wip-zig-bootstrap
in repository guix.
commit affebd23b8e8a8da6acdcaeef6a73aab44cf06df
Author: Hilton Chain <hako@ultrarare.space>
AuthorDate: Mon Nov 11 17:42:49 2024 +0800
gnu: Add zig-0.11.0-1967.
* gnu/packages/patches/zig-0.12-use-baseline-cpu-by-default.patch: New file.
* gnu/local.mk (dist_patch_DATA): Regisiter it.
* gnu/packages/zig.scm (zig-source): Use it.
(zig-0.11.0-1967): New variable.
Change-Id: I198cdb0a1e237e573360f7c37feff9bac5e4e3f2
---
gnu/local.mk | 1 +
.../zig-0.12-use-baseline-cpu-by-default.patch | 31 +++++++++++++++++++++
gnu/packages/zig.scm | 32 +++++++++++++++++++++-
3 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2672d5a7c1..4245ebb2d7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2370,6 +2370,7 @@ dist_patch_DATA =
\
%D%/packages/patches/zig-0.10.0-747-CallOptions.patch \
%D%/packages/patches/zig-0.10.0-1638-re-add-qualCast.patch \
%D%/packages/patches/zig-0.11-use-system-paths.patch \
+ %D%/packages/patches/zig-0.12-use-baseline-cpu-by-default.patch \
%D%/packages/patches/zig-use-baseline-cpu-by-default.patch \
%D%/packages/patches/zig-use-system-paths.patch \
%D%/packages/patches/zsh-egrep-failing-test.patch \
diff --git a/gnu/packages/patches/zig-0.12-use-baseline-cpu-by-default.patch
b/gnu/packages/patches/zig-0.12-use-baseline-cpu-by-default.patch
new file mode 100644
index 0000000000..c5c48a36ca
--- /dev/null
+++ b/gnu/packages/patches/zig-0.12-use-baseline-cpu-by-default.patch
@@ -0,0 +1,31 @@
+commit 053c6bae67c159f8f397d021649410338e4b501f
+Author: Ekaitz Zarraga <ekaitz@elenq.tech>
+Date: Sat Nov 18 15:04:16 2023 +0100
+
+ Use `baseline` cpu by default.
+
+ This helps Guix tune the package later. Tunning will only add
+ `-Dcpu=whatever` which should override the standard behaviour.
+
+ Zig by default uses `native`, which interferes with our build process.
+ In our previous zig-build-system we chose to add `-Dcpu=baseline` flag
+ in each `zig build` execution, but that doesn't allow us to tune the
+ package later. Tunning is only designed to add extra flags in the
+ command line call, and we already had one set for the baseline case.
+ With this patch we set the standard behavior to `baseline` so we don't
+ need to add the `-Dcpu=baseline` flag in the zig-build-system and we can
+ tune with no issues.
+
+diff --git a/lib/std/Target/Query.zig b/lib/std/Target/Query.zig
+index 8871e360a5..797d6a74db 100644
+--- a/lib/std/Target/Query.zig
++++ b/lib/std/Target/Query.zig
+@@ -6,7 +6,7 @@
+ /// `null` means native.
+ cpu_arch: ?Target.Cpu.Arch = null,
+
+-cpu_model: CpuModel = CpuModel.determined_by_cpu_arch,
++cpu_model: CpuModel = CpuModel.baseline,
+
+ /// Sparse set of CPU features to add to the set from `cpu_model`.
+ cpu_features_add: Target.Cpu.Feature.Set = Target.Cpu.Feature.Set.empty,
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index fdcede6269..88b99fd885 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -45,7 +45,10 @@
(sha256 (base32 hash))
(patches
(append
- (search-patches "zig-use-baseline-cpu-by-default.patch")
+ (search-patches
+ (if (version>=? version "0.11.0-1967")
+ "zig-0.12-use-baseline-cpu-by-default.patch"
+ "zig-use-baseline-cpu-by-default.patch"))
;; FIXME: Workaround RUNPATH issue by adding all paths in
;; CROSS_LIBRARY_PATH or LIBRARY_PATH environment variable to RUNPATH.
;; This is meant to be handled with a 'shrink-runpath' build phase.
@@ -1267,4 +1270,31 @@ toolchain. Among other features it provides
(modify-inputs (package-native-inputs base)
(replace "zig" `(,base "zig1")))))))
+;; Supply zig2, build zig1.wasm, install zig1.wasm.
+(define zig-0.11.0-1967
+ (let ((commit "6beae6c061a650ea2d695e6902683641df920aa8")
+ (revision "1967")
+ (base zig-0.11.0-761))
+ (package
+ (inherit base)
+ (name "zig")
+ (version (git-version "0.11.0" revision commit))
+ (source (zig-source
+ version commit
+ "0bah98h9rdaynwxlq4ibr925hmk69kwbrkgid2dgsksf6krb6sms"))
+ (arguments
+ (substitute-keyword-arguments (package-arguments zig-0.10.0-747)
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (replace 'patch-more-shebangs
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Zig uses information about /usr/bin/env to determine the
+ ;; version of glibc and other data.
+ (substitute* "lib/std/zig/system.zig"
+ (("/usr/bin/env")
+ (search-input-file inputs "bin/env")))))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs base)
+ (replace "zig" `(,base "out")))))))
+
(define-public zig zig-0.10)
- 42/57: gnu: Add zig-0.11.0-587., (continued)
- 42/57: gnu: Add zig-0.11.0-587., guix-commits, 2024/11/13
- 53/57: gnu: Add zig-0.11.0-3604., guix-commits, 2024/11/13
- 04/57: build-system: zig: Add shrink-runpath phase., guix-commits, 2024/11/13
- 11/57: gnu: Add zig-0.10.0-851., guix-commits, 2024/11/13
- 03/57: gnu: zig-0.10: Workaround RUNPATH issue., guix-commits, 2024/11/13
- 23/57: gnu: Add zig-0.10.0-1713., guix-commits, 2024/11/13
- 36/57: gnu: Add zig-0.10.0-3980., guix-commits, 2024/11/13
- 30/57: gnu: Add zig-0.10.0-2838., guix-commits, 2024/11/13
- 29/57: gnu: Add zig-0.10.0-2797., guix-commits, 2024/11/13
- 07/57: gnu: Add zig-0.10.0-675., guix-commits, 2024/11/13
- 47/57: gnu: Add zig-0.11.0-1967.,
guix-commits <=
- 51/57: gnu: Add zig-0.11.0-3503., guix-commits, 2024/11/13
- 46/57: gnu: Add zig-0.11.0-761., guix-commits, 2024/11/13
- 54/57: gnu: Add zig-0.12., guix-commits, 2024/11/13
- 06/57: gnu: Add zig-0.10.0-610., guix-commits, 2024/11/13
- 08/57: gnu: Add zig-0.10.0-722., guix-commits, 2024/11/13
- 10/57: gnu: Add zig-0.10.0-748., guix-commits, 2024/11/13
- 15/57: gnu: Add zig-0.10.0-1027., guix-commits, 2024/11/13
- 26/57: gnu: Add zig-0.10.0-2558., guix-commits, 2024/11/13
- 25/57: gnu: Add zig-0.10.0-1891., guix-commits, 2024/11/13
- 37/57: gnu: Add zig-0.10.0-3985., guix-commits, 2024/11/13