From 098a032507fc49dd50cffb41b821139ac88b3e52 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 24 Apr 2025 18:31:29 +0200 Subject: [PATCH] fix and re-enable documentation --- ...ve-native-lib-directories-from-rpath.patch | 2 +- 0002-std.Build-add-build-id-option.patch | 2 +- ...-bounds-of-main-zig-executable-to-9G.patch | 2 +- ...ib-dir-as-directory-instead-of-as-st.patch | 33 +++++++++++++++++++ zig.spec | 12 +++++-- 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index 971c4d3..a026bfc 100644 --- a/0001-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -1,7 +1,7 @@ From 874ce2357bb7e7398115fc6f37f3f3817a9116ba Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 13:35:37 +0200 -Subject: [PATCH 1/3] remove native lib directories from rpath +Subject: [PATCH 1/4] remove native lib directories from rpath Signed-off-by: Jan200101 --- diff --git a/0002-std.Build-add-build-id-option.patch b/0002-std.Build-add-build-id-option.patch index ba806f0..4cef24a 100644 --- a/0002-std.Build-add-build-id-option.patch +++ b/0002-std.Build-add-build-id-option.patch @@ -1,7 +1,7 @@ From fd127fafb534eade533655688c4977ae4f7cebe0 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 17 Jan 2025 20:53:30 +0100 -Subject: [PATCH 2/3] std.Build: add build-id option +Subject: [PATCH 2/4] std.Build: add build-id option Signed-off-by: Jan200101 --- diff --git a/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch b/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch index 81dfe00..b23c4f3 100644 --- a/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch +++ b/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch @@ -1,7 +1,7 @@ From e4b31d2e6cba763f4427bc689c7aa27978d47f49 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 21 Apr 2025 23:28:27 +0200 -Subject: [PATCH 3/3] increase upper bounds of main zig executable to 9G +Subject: [PATCH 3/4] increase upper bounds of main zig executable to 9G On Fedora 42 aarch64 memory usage peaked at 8736403456 bytes diff --git a/0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch b/0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch new file mode 100644 index 0000000..c5f1c72 --- /dev/null +++ b/0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch @@ -0,0 +1,33 @@ +From 2f379308820b58049cfe0aaca1eb4f77700d0047 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Thu, 24 Apr 2025 17:35:29 +0200 +Subject: [PATCH 4/4] build: pass zig lib dir as directory instead of as string + +Signed-off-by: Jan200101 +--- + build.zig | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/build.zig b/build.zig +index bc08eed298..7099edfb86 100644 +--- a/build.zig ++++ b/build.zig +@@ -1360,7 +1360,14 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath { + // in a temporary directory + "--cache-root", b.cache_root.path orelse ".", + }); +- cmd.addArgs(&.{ "--zig-lib-dir", b.fmt("{}", .{b.graph.zig_lib_directory}) }); ++ if (b.graph.zig_lib_directory.path) |zig_lib_dir| { ++ cmd.addArgs(&.{"--zig-lib-dir"}); ++ if (fs.path.isAbsolute(zig_lib_dir)) { ++ cmd.addArgs(&.{zig_lib_dir}); ++ } else { ++ cmd.addDirectoryArg(b.path(zig_lib_dir)); ++ } ++ } + cmd.addArgs(&.{"-i"}); + cmd.addFileArg(b.path(b.fmt("doc/langref/{s}", .{entry.name}))); + +-- +2.49.0 + diff --git a/zig.spec b/zig.spec index 85a2f22..4333762 100644 --- a/zig.spec +++ b/zig.spec @@ -11,7 +11,7 @@ %global llvm_version 19.0.0 %bcond bootstrap 0 -%bcond docs 0 +%bcond docs %{without bootstrap} %bcond macro %{without bootstrap} %bcond test 1 @@ -44,7 +44,7 @@ Name: zig Version: 0.14.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT AND NCSA AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND Inner-Net-2.0 AND ISC AND LicenseRef-Fedora-Public-Domain AND GFDL-1.1-or-later AND ZPL-2.1 @@ -68,6 +68,11 @@ Patch: 0002-std.Build-add-build-id-option.patch # Upstream suggested simply bumping this limit to 9GB # https://github.com/ziglang/zig/pull/23638 Patch: 0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch +# every snippet of code in the documentation is tested to see if it works +# while doing this zig incorrectly passes a relative path to the doctest tool +# which is ran in a temporary directory making that path invalid +# https://github.com/ziglang/zig/pull/23644 +Patch: 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -237,6 +242,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Thu Apr 24 2025 Jan200101 - 0.14.0-2 +- fix and re-enable documentation + * Thu Mar 06 2025 Jan200101 - 0.14.0-1 - Update to 0.14.0