From de9733eb6efb85f987c3b11ca00b678f52038d37 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 08:15:40 +0000 Subject: [PATCH 01/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index befc83b..eca9f9f 100644 --- a/zig.spec +++ b/zig.spec @@ -27,7 +27,7 @@ Name: zig Version: 0.9.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -178,6 +178,9 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d %endif %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 0.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Jul 23 2022 Fedora Release Engineering - 0.9.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From e8322f0e4504063244e762a37bb7ecf04087e7d3 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 3 Jul 2023 00:10:40 +0800 Subject: [PATCH 02/59] allow building on epel without %fedora --- zig.spec | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/zig.spec b/zig.spec index eca9f9f..fb08b95 100644 --- a/zig.spec +++ b/zig.spec @@ -2,18 +2,10 @@ # 32 bit builds currently run out of memory https://github.com/ziglang/zig/issues/6485 %global zig_arches x86_64 aarch64 riscv64 %{mips64} -# note here at which Fedora release we need to deal with LLVM and glibc differences -%global fedora_llvm 36 -# TODO check if this is still relevant -%global fedora_glibc 38 - %global llvm_version 13.0.0 - -%if %{fedora} >= %{fedora_llvm} %define llvm_compat 13 -%endif -%if %{fedora} >= %{fedora_glibc} +%if 0%{?fedora} >= 38 # documentation and tests do not build due to an unsupported glibc version %bcond_with test %bcond_with docs @@ -108,7 +100,7 @@ Summary: Common RPM macros for %{name} Requires: rpm BuildArch: noarch -%description rpm-macros +%description rpm-macros This package contains common RPM macros for %{name}. %endif @@ -245,4 +237,3 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d * Tue Aug 18 2020 Jan Drögehoff - 0.6.0-1 - Initial zig spec - From cb82d9f39e10c76e260608999f616d12d47a39f9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 19:41:38 +0000 Subject: [PATCH 03/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index fb08b95..d5233f2 100644 --- a/zig.spec +++ b/zig.spec @@ -19,7 +19,7 @@ Name: zig Version: 0.9.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -170,6 +170,9 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d %endif %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 0.9.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Sat Jan 21 2023 Fedora Release Engineering - 0.9.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 92cf9baa1fc69686d19322f56d68dd25e17e7bc1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 11:06:25 +0000 Subject: [PATCH 04/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index d5233f2..b2c13e6 100644 --- a/zig.spec +++ b/zig.spec @@ -19,7 +19,7 @@ Name: zig Version: 0.9.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -170,6 +170,9 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d %endif %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 0.9.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - 0.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 36f7a7c31635e37039dce452cd099d6d2e3ccdfe Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Wed, 7 Jun 2023 09:30:10 +0000 Subject: [PATCH 05/59] Verify signature --- .gitignore | 1 + sources | 2 +- zig-0.9.1.tar.xz.minisig | 4 ++++ zig.spec | 18 ++++++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 zig-0.9.1.tar.xz.minisig diff --git a/.gitignore b/.gitignore index 335ec95..de742ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.tar.gz +/zig-0.9.1.tar.xz diff --git a/sources b/sources index fb7f511..7a22812 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zig-0.9.1.tar.gz) = a9dc5fea25dde511122056832449658b00dbcf6d6bbfe658b375968a7bdb06c690abbdfe00c1afcfa481442392b051dcef5a5a5e81d4ceb23fa98a866b900f37 +SHA512 (zig-0.9.1.tar.xz) = 0b8a5f9b7e34e4252536f59bc91429f1e76b2bf8e01f024095919f6ecf34db56b5c86c554fbb94bdcb5255394c87f2c87519c8f34c631f53816927ec0882ae2d diff --git a/zig-0.9.1.tar.xz.minisig b/zig-0.9.1.tar.xz.minisig new file mode 100644 index 0000000..ff8c45d --- /dev/null +++ b/zig-0.9.1.tar.xz.minisig @@ -0,0 +1,4 @@ +untrusted comment: signature from minisign secret key +RUSGOq2NVecA2cP4/GOO4uekp9HkLStSWbZ3j8twZWAOdJSobHaH9v7516KWmVeOb/yuCma//Xhx95jK4bFuW5RQGHKDENYODgE= +trusted comment: timestamp:1673851410 file:zig-0.9.1.tar.xz hashed +m6gIsJ5ibJxAx6ea9+Un6uJcfNNY4Ay4UP4mAzzB7Uq+vgHljM8mMsDnSSsmeJmBmbOPGqQj950nidNu2XMRDg== diff --git a/zig.spec b/zig.spec index b2c13e6..896d89a 100644 --- a/zig.spec +++ b/zig.spec @@ -1,6 +1,8 @@ # https://ziglang.org/download/%{version}/release-notes.html#Support-Table # 32 bit builds currently run out of memory https://github.com/ziglang/zig/issues/6485 %global zig_arches x86_64 aarch64 riscv64 %{mips64} +# Signing key from https://ziglang.org/download/ +%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U %global llvm_version 13.0.0 %define llvm_compat 13 @@ -19,13 +21,14 @@ Name: zig Version: 0.9.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 URL: https://ziglang.org -Source0: https://github.com/ziglang/zig/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source1: macros.%{name} +Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz +Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig +Source2: macros.%{name} # prevent native directories from polluting the rpath # https://github.com/ziglang/zig/pull/10621 Patch0: 0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch @@ -38,6 +41,8 @@ BuildRequires: clang%{?llvm_compat}-devel BuildRequires: lld%{?llvm_compat}-devel # for man page generation BuildRequires: help2man +# for signature verification +BuildRequires: minisign %if %{with macro} || 0%{?llvm_compat} BuildRequires: sed @@ -105,6 +110,8 @@ This package contains common RPM macros for %{name}. %endif %prep +/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} + %autosetup -p1 %if 0%{?llvm_compat} @@ -139,7 +146,7 @@ install -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/ mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ -install -p -m644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/ +install -p -m644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d/ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name} %check @@ -170,6 +177,9 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d %endif %changelog +* Sat Jan 27 2024 Benson Muite - 0.9.1-6 +- Verify source signature + * Sat Jan 27 2024 Fedora Release Engineering - 0.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 13becf1d7b7035973a1967d64f7a2e84fd32aad7 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 20 Oct 2023 04:14:56 +0000 Subject: [PATCH 06/59] Fix build with `--without macro` Skip %%check and test dependencies when tests are disabled Other minor cleanups --- zig.spec | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/zig.spec b/zig.spec index 896d89a..c10e2e0 100644 --- a/zig.spec +++ b/zig.spec @@ -9,15 +9,15 @@ %if 0%{?fedora} >= 38 # documentation and tests do not build due to an unsupported glibc version -%bcond_with test %bcond_with docs %else -%bcond_without test %bcond_without docs %endif %bcond_without macro - +# Issues with tests stop them from completing successfully +# https://github.com/ziglang/zig/issues/9738 +%bcond_with test Name: zig Version: 0.9.1 @@ -133,28 +133,22 @@ help2man --no-discard-stderr "%{__cmake_builddir}/zig" --version-option=version ln -s lib "%{__cmake_builddir}/" %if %{with docs} -%{__cmake_builddir}/zig build docs -Dversion-string="%{version}" +%{__cmake_builddir}/zig build docs --verbose -Dversion-string="%{version}" %endif -mkdir -p zig-cache -touch zig-cache/langref.html %install %cmake_install -mkdir -p %{buildroot}/%{_mandir}/man1 -install -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/ +install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ %{name}.1 -mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ - -install -p -m644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d/ -sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name} - -%check +%if %{with macro} +install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} +sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{name} +%endif %if %{with test} -# Issues with tests stop them from completing successfully -# https://github.com/ziglang/zig/issues/9738 -#%%{__cmake_builddir}/zig build test +%check +%{__cmake_builddir}/zig build test --verbose %endif %files @@ -173,10 +167,14 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d %if %{with macro} %files rpm-macros -%{_rpmconfigdir}/macros.d/macros.%{name} +%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat Jan 27 2024 Aleksei Bavshin - 0.9.1-6 +- Fix build with `--without macro` +- Skip %%check and test dependencies when tests are disabled + * Sat Jan 27 2024 Benson Muite - 0.9.1-6 - Verify source signature From 39e7a7ca51d69cc1b71b70ee9412c736a14d7828 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 4 Nov 2023 05:01:15 +0000 Subject: [PATCH 07/59] Drop %%_zig_version macro As discussed in https://bugzilla.redhat.com/show_bug.cgi?id=2142363#c5 --- macros.zig | 1 - zig.spec | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/macros.zig b/macros.zig index 4aacbc5..0b2b767 100644 --- a/macros.zig +++ b/macros.zig @@ -1,6 +1,5 @@ %zig_arches x86_64 aarch64 riscv64 %{mips64} -%_zig_version @@ZIG_VERSION@@ %zig /usr/bin/zig # expected features for each arch when targeting baseline diff --git a/zig.spec b/zig.spec index c10e2e0..a4230ee 100644 --- a/zig.spec +++ b/zig.spec @@ -44,7 +44,7 @@ BuildRequires: help2man # for signature verification BuildRequires: minisign -%if %{with macro} || 0%{?llvm_compat} +%if 0%{?llvm_compat} BuildRequires: sed %endif @@ -143,7 +143,6 @@ install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ %{name}.1 %if %{with macro} install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} -sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %if %{with test} @@ -174,6 +173,7 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{ * Sat Jan 27 2024 Aleksei Bavshin - 0.9.1-6 - Fix build with `--without macro` - Skip %%check and test dependencies when tests are disabled +- Drop %%_zig_version macro * Sat Jan 27 2024 Benson Muite - 0.9.1-6 - Verify source signature From 8c4bf362571486944ae90700582f719488815e13 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 21 Oct 2023 02:46:55 +0000 Subject: [PATCH 08/59] Update to 0.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 0.11.0 includes a prebuilt wasm stage1, we are no longer allowed to build and tag it directly[1]. Instead, we shall do the following: * Obtain an exception from the packaging committee[2] * Build initial package completely from stage1 to stage3 with `%%bcond bootstrap 1` (this can be done in a side-tag without any changes to the spec[3]). * Use the bootstrapped package to make a clean source-only build of stage3. * Discard the ~bootstrap and send the clean build to bodhi. [1]: https://docs.fedoraproject.org/en-US/packaging-guidelines/what-can-be-packaged/#_exceptions [2]: https://pagure.io/packaging-committee/issue/1319 [3]: https://pagure.io/packaging-committee/pull-request/1308#request_diff Co-authored-by: Jan Drögehoff --- .gitignore | 4 +- ...tstrap-and-extra-build-flags-support.patch | 66 +++++++++++++ ...b-dirs-when-invoked-with-feach-lib-r.patch | 28 ------ 0002-Enable-build-id-by-default.patch | 25 +++++ macros.zig | 2 +- sources | 3 +- zig-0.9.1.tar.xz.minisig | 4 - zig.spec | 92 +++++++++++-------- 8 files changed, 148 insertions(+), 76 deletions(-) create mode 100644 0001-Fedora-bootstrap-and-extra-build-flags-support.patch delete mode 100644 0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch create mode 100644 0002-Enable-build-id-by-default.patch delete mode 100644 zig-0.9.1.tar.xz.minisig diff --git a/.gitignore b/.gitignore index de742ee..2476d59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -*.tar.gz -/zig-0.9.1.tar.xz +/zig-0.11.0.tar.xz +/zig-0.11.0.tar.xz.minisig diff --git a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch new file mode 100644 index 0000000..61537c7 --- /dev/null +++ b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch @@ -0,0 +1,66 @@ +From 83a3cf50d81b65809d4a4619502295b4b5ff8636 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Fri, 20 Oct 2023 04:49:46 +0000 +Subject: [PATCH 1/2] Fedora: bootstrap and extra build flags support + +- Allow passing ZIG_EXTRA_BUILD_FLAGS for stage3 build. +- Allow redefining ZIG_EXECUTABLE and short-circuiting to stage3 build + when using a prebuilt compiler from bootstrap package. +- Bump required CMake version to 3.14 to enable generator expression + expansion in `install(CODE ...)`. +--- + CMakeLists.txt | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f1289e20b..031654dee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.5) ++cmake_minimum_required(VERSION 3.14) + + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING +@@ -859,6 +859,10 @@ else() + set(ZIG_PIE_ARG "") + endif() + ++# Fedora customizations ++set(ZIG_EXTRA_BUILD_ARGS "" CACHE STRING "Extra flags for stage3 build") ++set(ZIG_EXECUTABLE "$" CACHE STRING "Compiler command to use for stage3 build") ++ + # -Dno-langref is currently hardcoded because building the langref takes too damn long + # -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation + # that prevents it from working. +@@ -877,6 +881,7 @@ set(ZIG_BUILD_ARGS + "-Dtarget=${ZIG_TARGET_TRIPLE}" + "-Dcpu=${ZIG_TARGET_MCPU}" + "-Dversion-string=${RESOLVED_ZIG_VERSION}" ++ ${ZIG_EXTRA_BUILD_ARGS} + ) + + add_custom_target(stage3 ALL +@@ -885,17 +890,12 @@ add_custom_target(stage3 ALL + + add_custom_command( + OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig" +- COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} ++ COMMAND ${ZIG_EXECUTABLE} build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} + COMMENT STATUS "Building stage3" ++ DEPENDS zigcpp + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + ) + +-if(WIN32) +- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2.exe") +-else() +- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2") +-endif() +- + install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")") + install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")") + install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")") +-- +2.41.0 + diff --git a/0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch b/0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch deleted file mode 100644 index 80fab5d..0000000 --- a/0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d505ddbb7f46ba974b5d8458fd7134901930f033 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Thu, 17 Feb 2022 18:00:58 +0100 -Subject: [PATCH] ignore target lib dirs when invoked with -feach-lib-rpath - -Signed-off-by: Jan200101 ---- - src/main.zig | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/src/main.zig b/src/main.zig -index 7f50a7de6..a6bcf69a8 100644 ---- a/src/main.zig -+++ b/src/main.zig -@@ -2077,10 +2077,6 @@ fn buildOutputType( - clang_argv.appendAssumeCapacity(framework_dir); - framework_dirs.appendAssumeCapacity(framework_dir); - } -- -- for (paths.lib_dirs.items) |lib_dir| { -- try lib_dirs.append(lib_dir); -- } - for (paths.rpaths.items) |rpath| { - try rpath_list.append(rpath); - } --- -2.35.1 - diff --git a/0002-Enable-build-id-by-default.patch b/0002-Enable-build-id-by-default.patch new file mode 100644 index 0000000..dc955dc --- /dev/null +++ b/0002-Enable-build-id-by-default.patch @@ -0,0 +1,25 @@ +From 4e1416ebff98155b07031790ec1afcb0035fb2ab Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Fri, 20 Oct 2023 04:49:54 +0000 +Subject: [PATCH 2/2] Enable build-id by default + +--- + src/Compilation.zig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Compilation.zig b/src/Compilation.zig +index a08c3e09f..95ade766a 100644 +--- a/src/Compilation.zig ++++ b/src/Compilation.zig +@@ -807,7 +807,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { + const unwind_tables = options.want_unwind_tables orelse + (link_libunwind or target_util.needUnwindTables(options.target)); + const link_eh_frame_hdr = options.link_eh_frame_hdr or unwind_tables; +- const build_id = options.build_id orelse .none; ++ const build_id = options.build_id orelse .sha1; + + // Make a decision on whether to use LLD or our own linker. + const use_lld = options.use_lld orelse blk: { +-- +2.41.0 + diff --git a/macros.zig b/macros.zig index 0b2b767..dcb6059 100644 --- a/macros.zig +++ b/macros.zig @@ -21,7 +21,7 @@ # seperated build options %_zig_general_options --verbose -%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -Drelease-safe +%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -Doptimize=ReleaseSafe %_zig_advanced_options --cache-dir zig-cache %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_advanced_options} diff --git a/sources b/sources index 7a22812..16e07e6 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (zig-0.9.1.tar.xz) = 0b8a5f9b7e34e4252536f59bc91429f1e76b2bf8e01f024095919f6ecf34db56b5c86c554fbb94bdcb5255394c87f2c87519c8f34c631f53816927ec0882ae2d +SHA512 (zig-0.11.0.tar.xz) = c19a8ae6d440a16dd5e77941fc77c036d1f284f1784376625e63b65f30b4acad62f9f4217bc818c401f88c2c33f8722f26fc467c3e23c29a89178c4b1882d1c4 +SHA512 (zig-0.11.0.tar.xz.minisig) = 565dd1eacb7dd697e6b1ff54517adc1e4775d2523afaeb4f9a3dd404df871b187862211ecbbcf90b42e3a03853677fc1603e7fc8fc5ba7126a054679faa601ca diff --git a/zig-0.9.1.tar.xz.minisig b/zig-0.9.1.tar.xz.minisig deleted file mode 100644 index ff8c45d..0000000 --- a/zig-0.9.1.tar.xz.minisig +++ /dev/null @@ -1,4 +0,0 @@ -untrusted comment: signature from minisign secret key -RUSGOq2NVecA2cP4/GOO4uekp9HkLStSWbZ3j8twZWAOdJSobHaH9v7516KWmVeOb/yuCma//Xhx95jK4bFuW5RQGHKDENYODgE= -trusted comment: timestamp:1673851410 file:zig-0.9.1.tar.xz hashed -m6gIsJ5ibJxAx6ea9+Un6uJcfNNY4Ay4UP4mAzzB7Uq+vgHljM8mMsDnSSsmeJmBmbOPGqQj950nidNu2XMRDg== diff --git a/zig.spec b/zig.spec index a4230ee..845e50b 100644 --- a/zig.spec +++ b/zig.spec @@ -4,24 +4,22 @@ # Signing key from https://ziglang.org/download/ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U -%global llvm_version 13.0.0 -%define llvm_compat 13 - -%if 0%{?fedora} >= 38 -# documentation and tests do not build due to an unsupported glibc version -%bcond_with docs -%else -%bcond_without docs +# note here at which Fedora or EL release we need to use compat LLVM packages +%if 0%{?fedora} >= 39 || 0%{?rhel} >= 9 +%define llvm_compat 16 %endif -%bcond_without macro -# Issues with tests stop them from completing successfully -# https://github.com/ziglang/zig/issues/9738 -%bcond_with test +%global llvm_version 16.0.0 + + +%bcond bootstrap 0 +%bcond docs %{without bootstrap} +%bcond macro %{without bootstrap} +%bcond test 1 Name: zig -Version: 0.9.1 -Release: 6%{?dist} +Version: 0.11.0 +Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -29,9 +27,11 @@ URL: https://ziglang.org Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig Source2: macros.%{name} -# prevent native directories from polluting the rpath -# https://github.com/ziglang/zig/pull/10621 -Patch0: 0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch +# Support clean build of stage3 with temporary bootstrapped package +Patch: 0001-Fedora-bootstrap-and-extra-build-flags-support.patch +# There's no global option for build-id so enable it by default +# instead of patching every project's build.zig +Patch: 0002-Enable-build-id-by-default.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -39,13 +39,14 @@ BuildRequires: cmake BuildRequires: llvm%{?llvm_compat}-devel BuildRequires: clang%{?llvm_compat}-devel BuildRequires: lld%{?llvm_compat}-devel +BuildRequires: zlib-devel # for man page generation BuildRequires: help2man # for signature verification BuildRequires: minisign -%if 0%{?llvm_compat} -BuildRequires: sed +%if %{without bootstrap} +BuildRequires: %{name} = %{version} %endif %if %{with test} @@ -58,22 +59,22 @@ Requires: %{name}-libs = %{version} # These packages are bundled as source -# NCSA +# Apache-2.0 WITH LLVM-exception OR NCSA OR MIT Provides: bundled(compiler-rt) = %{llvm_version} # LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL Provides: bundled(glibc) = 2.34 -# NCSA +# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxx) = %{llvm_version} -# NCSA +# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxxabi) = %{llvm_version} # NCSA Provides: bundled(libunwind) = %{llvm_version} # BSD, LGPG, ZPL -Provides: bundled(mingw) = 9.0.0 +Provides: bundled(mingw) = 10.0.0 # MIT -Provides: bundled(musl) = 1.2.2 -# CC0, BSD, MIT, Apache2, Apache2 with exceptions -Provides: bundled(wasi-libc) = 82fc2c4f449e56319112f6f2583195c7f4e714b1 +Provides: bundled(musl) = 1.2.4 +# Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause +Provides: bundled(wasi-libc) = 3189cd1ceec8771e8f27faab58ad05d4d6c369ef ExclusiveArch: %{zig_arches} @@ -81,7 +82,7 @@ ExclusiveArch: %{zig_arches} Zig is an open-source programming language designed for robustness, optimality, and clarity. This package provides the zig compiler and the associated runtime. -# the standard library contains only plain text +# The Zig stdlib only contains uncompiled code %package libs Summary: %{name} Standard Library BuildArch: noarch @@ -113,27 +114,33 @@ This package contains common RPM macros for %{name}. /usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} %autosetup -p1 - -%if 0%{?llvm_compat} - sed -i "s|/usr/lib/llvm-13|%{_libdir}/llvm%{llvm_compat}|g" cmake/Find{clang,lld,llvm}.cmake +%if %{without bootstrap} +# Ensure that the pre-build stage1 binary is not used +rm -f stage1/zig1.wasm %endif %build - +# C_FLAGS: wasm2c output generates a lot of noise with -Wunused. +# EXTRA_BUILD_ARGS: apply --build-id=sha1 even if running unpatched stage2 compiler. %cmake \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - -DZIG_PREFER_CLANG_CPP_DYLIB=true \ - -DZIG_VERSION:STRING="%{version}" -%cmake_build + -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ + -DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;-Dbuild-id=sha1" \ + -DZIG_SHARED_LLVM:BOOL=true \ + -DZIG_TARGET_MCPU:STRING=baseline \ + -DZIG_TARGET_TRIPLE:STRING=native \ + -DZIG_VERSION:STRING="%{version}" \ + %{!?with_bootstrap:-DZIG_EXECUTABLE:STRING="/usr/bin/zig"} +# Build only stage3 and dependencies. Skips stage1/2 if using /usr/bin/zig +%cmake_build --target stage3 # Zig has no official manpage # https://github.com/ziglang/zig/issues/715 -help2man --no-discard-stderr "%{__cmake_builddir}/zig" --version-option=version --output=%{name}.1 - -ln -s lib "%{__cmake_builddir}/" +help2man --no-discard-stderr --no-info "%{__cmake_builddir}/stage3/bin/zig" --version-option=version --output=%{name}.1 %if %{with docs} -%{__cmake_builddir}/zig build docs --verbose -Dversion-string="%{version}" +"%{__cmake_builddir}/stage3/bin/zig" build docs --verbose -Dversion-string="%{version}" %endif %install @@ -147,7 +154,8 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %if %{with test} %check -%{__cmake_builddir}/zig build test --verbose +# Run reduced set of tests, based on the Zig CI +"%{__cmake_builddir}/stage3/bin/zig" test test/behavior.zig -Itest %endif %files @@ -161,7 +169,8 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %if %{with docs} %files doc %doc README.md -%doc zig-cache/langref.html +%doc zig-out/doc/langref.html +%doc zig-out/doc/std %endif %if %{with macro} @@ -170,6 +179,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat Jan 27 2024 Aleksei Bavshin - 0.11.0-1 +- Update to 0.11.0 + * Sat Jan 27 2024 Aleksei Bavshin - 0.9.1-6 - Fix build with `--without macro` - Skip %%check and test dependencies when tests are disabled From d8a8ae5c937932d7176338d6d2d0ff28330ab794 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 21 Feb 2024 21:50:11 +0100 Subject: [PATCH 09/59] Rebuild for bootstrapping --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 845e50b..cd5c9fd 100644 --- a/zig.spec +++ b/zig.spec @@ -19,7 +19,7 @@ Name: zig Version: 0.11.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -179,6 +179,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Wed Feb 21 2024 Jan Drögehoff - 0.11.0-2 +- Rebuilt for bootstrapping + * Sat Jan 27 2024 Aleksei Bavshin - 0.11.0-1 - Update to 0.11.0 From 7048d6186733fc22cf94cea511566c198360ff90 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 10:57:05 +0200 Subject: [PATCH 10/59] Update to 0.12.0 --- .gitignore | 4 +- ...tstrap-and-extra-build-flags-support.patch | 27 ++++---- 0002-Enable-build-id-by-default.patch | 22 +++---- ...event-global-cache-from-being-copied.patch | 61 +++++++++++++++++++ macros.zig | 44 ++++++++----- sources | 4 +- zig.spec | 39 +++++++----- 7 files changed, 143 insertions(+), 58 deletions(-) create mode 100644 0003-fetch-prevent-global-cache-from-being-copied.patch diff --git a/.gitignore b/.gitignore index 2476d59..023b23f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/zig-0.11.0.tar.xz -/zig-0.11.0.tar.xz.minisig +/zig-*.tar.xz +/zig-*.tar.xz.minisig diff --git a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch index 61537c7..cc20f3b 100644 --- a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch +++ b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch @@ -1,29 +1,31 @@ -From 83a3cf50d81b65809d4a4619502295b4b5ff8636 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 20 Oct 2023 04:49:46 +0000 -Subject: [PATCH 1/2] Fedora: bootstrap and extra build flags support +Subject: [PATCH] Fedora: bootstrap and extra build flags support - Allow passing ZIG_EXTRA_BUILD_FLAGS for stage3 build. - Allow redefining ZIG_EXECUTABLE and short-circuiting to stage3 build when using a prebuilt compiler from bootstrap package. - Bump required CMake version to 3.14 to enable generator expression expansion in `install(CODE ...)`. + +Signed-off-by: Jan200101 --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index f1289e20b..031654dee 100644 +index e677ee0947..1fb4821b60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.14) + include(CheckSymbolExists) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING -@@ -859,6 +859,10 @@ else() - set(ZIG_PIE_ARG "") +@@ -910,6 +910,10 @@ else() + set(ZIG_DYNAMIC_LINKER_ARG "-Ddynamic-linker=${ZIG_TARGET_DYNAMIC_LINKER}") endif() +# Fedora customizations @@ -31,17 +33,17 @@ index f1289e20b..031654dee 100644 +set(ZIG_EXECUTABLE "$" CACHE STRING "Compiler command to use for stage3 build") + # -Dno-langref is currently hardcoded because building the langref takes too damn long - # -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation - # that prevents it from working. -@@ -877,6 +881,7 @@ set(ZIG_BUILD_ARGS - "-Dtarget=${ZIG_TARGET_TRIPLE}" + # To obtain these two forms of documentation, run zig build against stage3 rather than stage2. + set(ZIG_BUILD_ARGS +@@ -926,6 +930,7 @@ set(ZIG_BUILD_ARGS "-Dcpu=${ZIG_TARGET_MCPU}" + ${ZIG_DYNAMIC_LINKER_ARG} "-Dversion-string=${RESOLVED_ZIG_VERSION}" + ${ZIG_EXTRA_BUILD_ARGS} ) add_custom_target(stage3 ALL -@@ -885,17 +890,12 @@ add_custom_target(stage3 ALL +@@ -934,17 +939,12 @@ add_custom_target(stage3 ALL add_custom_command( OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig" @@ -61,6 +63,3 @@ index f1289e20b..031654dee 100644 install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")") install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")") install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")") --- -2.41.0 - diff --git a/0002-Enable-build-id-by-default.patch b/0002-Enable-build-id-by-default.patch index dc955dc..e29227c 100644 --- a/0002-Enable-build-id-by-default.patch +++ b/0002-Enable-build-id-by-default.patch @@ -1,25 +1,23 @@ -From 4e1416ebff98155b07031790ec1afcb0035fb2ab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 20 Oct 2023 04:49:54 +0000 -Subject: [PATCH 2/2] Enable build-id by default +Subject: [PATCH] Enable build-id by default +Signed-off-by: Jan200101 --- src/Compilation.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compilation.zig b/src/Compilation.zig -index a08c3e09f..95ade766a 100644 +index 7af3d7bfd1..78bc2b65c8 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig -@@ -807,7 +807,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { - const unwind_tables = options.want_unwind_tables orelse - (link_libunwind or target_util.needUnwindTables(options.target)); - const link_eh_frame_hdr = options.link_eh_frame_hdr or unwind_tables; +@@ -1230,7 +1230,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil + const any_sanitize_thread = options.config.any_sanitize_thread or options.root_mod.sanitize_thread; + + const link_eh_frame_hdr = options.link_eh_frame_hdr or any_unwind_tables; - const build_id = options.build_id orelse .none; + const build_id = options.build_id orelse .sha1; - // Make a decision on whether to use LLD or our own linker. - const use_lld = options.use_lld orelse blk: { --- -2.41.0 - + const link_libc = options.config.link_libc; + diff --git a/0003-fetch-prevent-global-cache-from-being-copied.patch b/0003-fetch-prevent-global-cache-from-being-copied.patch new file mode 100644 index 0000000..df7b041 --- /dev/null +++ b/0003-fetch-prevent-global-cache-from-being-copied.patch @@ -0,0 +1,61 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Sun, 12 May 2024 18:20:19 +0200 +Subject: [PATCH] fetch: prevent global cache from being copied + +Signed-off-by: Jan200101 +--- + src/Package/Fetch.zig | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig +index 506075e921..ca11f4c579 100644 +--- a/src/Package/Fetch.zig ++++ b/src/Package/Fetch.zig +@@ -1248,6 +1248,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac + + fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void { + const gpa = f.arena.child_allocator; ++ const cache_root = f.job_queue.global_cache; + // Recursive directory copy. + var it = try dir.walk(gpa); + defer it.deinit(); +@@ -1255,18 +1256,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void + switch (entry.kind) { + .directory => {}, // omit empty directories + .file => { +- dir.copyFile( +- entry.path, +- tmp_dir, +- entry.path, +- .{}, +- ) catch |err| switch (err) { +- error.FileNotFound => { +- if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname); +- try dir.copyFile(entry.path, tmp_dir, entry.path, .{}); +- }, +- else => |e| return e, +- }; ++ const full_path = try dir.realpathAlloc(gpa, entry.path); ++ defer gpa.free(full_path); ++ ++ const cache_path = try cache_root.handle.realpathAlloc(gpa, "."); ++ defer gpa.free(cache_path); ++ ++ if (!std.mem.startsWith(u8, full_path, cache_path)) { ++ dir.copyFile( ++ entry.path, ++ tmp_dir, ++ entry.path, ++ .{}, ++ ) catch |err| switch (err) { ++ error.FileNotFound => { ++ if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname); ++ try dir.copyFile(entry.path, tmp_dir, entry.path, .{}); ++ }, ++ else => |e| return e, ++ }; ++ } + }, + .sym_link => { + var buf: [fs.MAX_PATH_BYTES]u8 = undefined; diff --git a/macros.zig b/macros.zig index dcb6059..969c861 100644 --- a/macros.zig +++ b/macros.zig @@ -1,6 +1,8 @@ %zig_arches x86_64 aarch64 riscv64 %{mips64} -%zig /usr/bin/zig +%zig %{_bindir}/zig + +%_zig_cache_dir zig-cache # expected features for each arch when targeting baseline # found in https://github.com/ziglang/zig/tree/master/lib/std/target @@ -18,24 +20,38 @@ # mips32 %_zig_cpu baseline %_zig_target native +%_zig_release_mode safe # seperated build options -%_zig_general_options --verbose -%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -Doptimize=ReleaseSafe -%_zig_advanced_options --cache-dir zig-cache +%_zig_general_options --verbose --release=%{_zig_release_mode} +%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} +%_zig_system_integration --system %{_zig_cache_dir} +%_zig_advanced_options --cache-dir %{_zig_cache_dir} --global-cache-dir %{_zig_cache_dir} -%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_advanced_options} +%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?%_zig_system_integration} %{?_zig_advanced_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" +%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} -%zig_build %zig \\\ - build \\\ - %{?_zig_build_options} +%zig_build %{shrink: \ + %zig \ + build \ + %{?_zig_build_options} \ +} -%zig_install \ - DESTDIR="%{buildroot}" %zig_build \\\ - install \\\ - %{?_zig_install_options} +%zig_install %{shrink: \ + DESTDIR="%{buildroot}" \ + %zig_build \ + install \ + %{?_zig_install_options} \ +} -%zig_test \ - %zig_build \\\ +%zig_fetch %{shrink: \ + %zig \ + fetch \ + %{?_zig_fetch_options} \ +} + +%zig_test %{shrink: \ + %zig_build \ test +} diff --git a/sources b/sources index 16e07e6..ab9f6ae 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.11.0.tar.xz) = c19a8ae6d440a16dd5e77941fc77c036d1f284f1784376625e63b65f30b4acad62f9f4217bc818c401f88c2c33f8722f26fc467c3e23c29a89178c4b1882d1c4 -SHA512 (zig-0.11.0.tar.xz.minisig) = 565dd1eacb7dd697e6b1ff54517adc1e4775d2523afaeb4f9a3dd404df871b187862211ecbbcf90b42e3a03853677fc1603e7fc8fc5ba7126a054679faa601ca +SHA512 (zig-0.12.0.tar.xz) = 0c3d9396fea4905245c7e32ce6bd9b4ff140f061cd8a957929e4c84cf105f5bbcbf2e7c030013ac649edb569e909f65d928b3e8a86f35c9076fb62e996feea14 +SHA512 (zig-0.12.0.tar.xz.minisig) = 6e14c1e1926beeb249cb88fb2247ff401f679b64785c3ec8a924e33c894174deb77b48286469a863761bce0ca57524f904995eacf544919dda387c140e6e829e diff --git a/zig.spec b/zig.spec index cd5c9fd..3014311 100644 --- a/zig.spec +++ b/zig.spec @@ -1,25 +1,23 @@ -# https://ziglang.org/download/%{version}/release-notes.html#Support-Table -# 32 bit builds currently run out of memory https://github.com/ziglang/zig/issues/6485 +# https://ziglang.org/download/VERSION/release-notes.html#Support-Table %global zig_arches x86_64 aarch64 riscv64 %{mips64} # Signing key from https://ziglang.org/download/ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 39 || 0%{?rhel} >= 9 -%define llvm_compat 16 +%if 0%{?fedora} >= 40 || 0%{?rhel} >= 9 +%define llvm_compat 17 %endif -%global llvm_version 16.0.0 - +%global llvm_version 17.0.0 %bcond bootstrap 0 -%bcond docs %{without bootstrap} -%bcond macro %{without bootstrap} -%bcond test 1 +%bcond docs %{without bootstrap} +%bcond macro %{without bootstrap} +%bcond test 1 Name: zig -Version: 0.11.0 -Release: 2%{?dist} +Version: 0.12.0 +Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -32,6 +30,9 @@ Patch: 0001-Fedora-bootstrap-and-extra-build-flags-support.patch # There's no global option for build-id so enable it by default # instead of patching every project's build.zig Patch: 0002-Enable-build-id-by-default.patch +# Zig fetch will recurse onto the cache directory, prevent that from happening. +# https://github.com/ziglang/zig/pull/19951 +Patch: 0003-fetch-prevent-global-cache-from-being-copied.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -62,7 +63,7 @@ Requires: %{name}-libs = %{version} # Apache-2.0 WITH LLVM-exception OR NCSA OR MIT Provides: bundled(compiler-rt) = %{llvm_version} # LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL -Provides: bundled(glibc) = 2.34 +Provides: bundled(glibc) = 2.38 # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxx) = %{llvm_version} # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA @@ -70,7 +71,7 @@ Provides: bundled(libcxxabi) = %{llvm_version} # NCSA Provides: bundled(libunwind) = %{llvm_version} # BSD, LGPG, ZPL -Provides: bundled(mingw) = 10.0.0 +Provides: bundled(mingw) = 0bac2d3cdb122dadcdee90009f7e24a69d56939f # MIT Provides: bundled(musl) = 1.2.4 # Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause @@ -126,10 +127,14 @@ rm -f stage1/zig1.wasm -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ + \ -DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;-Dbuild-id=sha1" \ -DZIG_SHARED_LLVM:BOOL=true \ + -DZIG_PIE:BOOL=true \ + \ -DZIG_TARGET_MCPU:STRING=baseline \ -DZIG_TARGET_TRIPLE:STRING=native \ + \ -DZIG_VERSION:STRING="%{version}" \ %{!?with_bootstrap:-DZIG_EXECUTABLE:STRING="/usr/bin/zig"} # Build only stage3 and dependencies. Skips stage1/2 if using /usr/bin/zig @@ -140,7 +145,10 @@ rm -f stage1/zig1.wasm help2man --no-discard-stderr --no-info "%{__cmake_builddir}/stage3/bin/zig" --version-option=version --output=%{name}.1 %if %{with docs} -"%{__cmake_builddir}/stage3/bin/zig" build docs --verbose -Dversion-string="%{version}" +"%{__cmake_builddir}/stage3/bin/zig" build docs \ + --verbose \ + --global-cache-dir zig-cache \ + -Dversion-string="%{version}" %endif %install @@ -179,6 +187,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat May 25 2024 Jan200101 - 0.12.0-1 +- Update to 0.12.0 + * Wed Feb 21 2024 Jan Drögehoff - 0.11.0-2 - Rebuilt for bootstrapping From 932de196c3c192bb92845f697578b5f50acd776c Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 10:56:01 +0200 Subject: [PATCH 11/59] Update to 0.12.1 --- sources | 4 ++-- zig.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index ab9f6ae..f41a951 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.12.0.tar.xz) = 0c3d9396fea4905245c7e32ce6bd9b4ff140f061cd8a957929e4c84cf105f5bbcbf2e7c030013ac649edb569e909f65d928b3e8a86f35c9076fb62e996feea14 -SHA512 (zig-0.12.0.tar.xz.minisig) = 6e14c1e1926beeb249cb88fb2247ff401f679b64785c3ec8a924e33c894174deb77b48286469a863761bce0ca57524f904995eacf544919dda387c140e6e829e +SHA512 (zig-0.12.1.tar.xz) = 6242b37420954792834f48b27b6d325e78908e51fcf4d05cd2f5c65b82209a38cf1fef2914630846d40b57cc55d64adbfd67f88e939d2e493b58bc0f1ef3520b +SHA512 (zig-0.12.1.tar.xz.minisig) = 12da0f1a92f980fa04506b97f348aaf9cb18880e1047fc41e6cff01066a3c54dc36146ac4bd1bcc3110d6ebcb3d7cd36f7b3e434e9a5953d6a274681434ff173 diff --git a/zig.spec b/zig.spec index 3014311..8acb9dc 100644 --- a/zig.spec +++ b/zig.spec @@ -16,7 +16,7 @@ %bcond test 1 Name: zig -Version: 0.12.0 +Version: 0.12.1 Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software @@ -187,6 +187,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat Jun 08 2024 Jan200101 - 0.12.1-1 +- Update to 0.12.1 + * Sat May 25 2024 Jan200101 - 0.12.0-1 - Update to 0.12.0 From 7a78a337a52ccac6efb6f2c75a296a7400492073 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 14:03:34 +0200 Subject: [PATCH 12/59] Update to 0.13.0 --- ...tstrap-and-extra-build-flags-support.patch | 48 ++++++++----------- 0002-Enable-build-id-by-default.patch | 2 +- ...event-global-cache-from-being-copied.patch | 6 +-- ...E-support-detection-add-error-output.patch | 31 ++++++++++++ ...ve-native-lib-directories-from-rpath.patch | 30 ++++++++++++ sources | 4 +- zig.spec | 15 ++++-- 7 files changed, 98 insertions(+), 38 deletions(-) create mode 100644 0004-cmake-correct-PIE-support-detection-add-error-output.patch create mode 100644 0005-remove-native-lib-directories-from-rpath.patch diff --git a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch index cc20f3b..7bf71bf 100644 --- a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch +++ b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch @@ -11,55 +11,49 @@ Subject: [PATCH] Fedora: bootstrap and extra build flags support Signed-off-by: Jan200101 --- - CMakeLists.txt | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) + CMakeLists.txt | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index e677ee0947..1fb4821b60 100644 +index 22051f1902..06df068919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.5) -+cmake_minimum_required(VERSION 3.14) - include(CheckSymbolExists) - - if(NOT CMAKE_BUILD_TYPE) -@@ -910,6 +910,10 @@ else() - set(ZIG_DYNAMIC_LINKER_ARG "-Ddynamic-linker=${ZIG_TARGET_DYNAMIC_LINKER}") +@@ -922,6 +922,9 @@ if(MSVC OR MINGW) + target_link_libraries(zig2 LINK_PUBLIC version) endif() +# Fedora customizations +set(ZIG_EXTRA_BUILD_ARGS "" CACHE STRING "Extra flags for stage3 build") +set(ZIG_EXECUTABLE "$" CACHE STRING "Compiler command to use for stage3 build") -+ - # -Dno-langref is currently hardcoded because building the langref takes too damn long + + # "-Dno-langref" and "-Dstd-docs=false" are hardcoded because they take too long to build. # To obtain these two forms of documentation, run zig build against stage3 rather than stage2. - set(ZIG_BUILD_ARGS -@@ -926,6 +930,7 @@ set(ZIG_BUILD_ARGS - "-Dcpu=${ZIG_TARGET_MCPU}" - ${ZIG_DYNAMIC_LINKER_ARG} - "-Dversion-string=${RESOLVED_ZIG_VERSION}" +@@ -937,6 +940,8 @@ set(ZIG_BUILD_ARGS + + -Dno-langref + -Dstd-docs=false ++ + ${ZIG_EXTRA_BUILD_ARGS} ) - add_custom_target(stage3 ALL -@@ -934,17 +939,12 @@ add_custom_target(stage3 ALL + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +@@ -976,17 +981,12 @@ set(ZIG2_WORKING_DIR "${PROJECT_SOURCE_DIR}") add_custom_command( - OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig" -- COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} -+ COMMAND ${ZIG_EXECUTABLE} build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} + OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig" +- COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} ++ COMMAND ${ZIG_EXECUTABLE} build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} COMMENT STATUS "Building stage3" + DEPENDS zigcpp - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + WORKING_DIRECTORY "${ZIG2_WORKING_DIR}" ) -if(WIN32) -- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2.exe") +- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2.exe") -else() -- set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2") +- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2") -endif() - install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")") install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")") - install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")") + install(CODE "set(ZIG2_WORKING_DIR \"${ZIG2_WORKING_DIR}\")") diff --git a/0002-Enable-build-id-by-default.patch b/0002-Enable-build-id-by-default.patch index e29227c..d77f74e 100644 --- a/0002-Enable-build-id-by-default.patch +++ b/0002-Enable-build-id-by-default.patch @@ -9,7 +9,7 @@ Signed-off-by: Jan200101 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compilation.zig b/src/Compilation.zig -index 7af3d7bfd1..78bc2b65c8 100644 +index 507cbfc6d5..d946956b05 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1230,7 +1230,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil diff --git a/0003-fetch-prevent-global-cache-from-being-copied.patch b/0003-fetch-prevent-global-cache-from-being-copied.patch index df7b041..22c5ce1 100644 --- a/0003-fetch-prevent-global-cache-from-being-copied.patch +++ b/0003-fetch-prevent-global-cache-from-being-copied.patch @@ -9,10 +9,10 @@ Signed-off-by: Jan200101 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig -index 506075e921..ca11f4c579 100644 +index f45a5cc93e..f21409ae76 100644 --- a/src/Package/Fetch.zig +++ b/src/Package/Fetch.zig -@@ -1248,6 +1248,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac +@@ -1343,6 +1343,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void { const gpa = f.arena.child_allocator; @@ -20,7 +20,7 @@ index 506075e921..ca11f4c579 100644 // Recursive directory copy. var it = try dir.walk(gpa); defer it.deinit(); -@@ -1255,18 +1256,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void +@@ -1350,18 +1351,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void switch (entry.kind) { .directory => {}, // omit empty directories .file => { diff --git a/0004-cmake-correct-PIE-support-detection-add-error-output.patch b/0004-cmake-correct-PIE-support-detection-add-error-output.patch new file mode 100644 index 0000000..ef2bd89 --- /dev/null +++ b/0004-cmake-correct-PIE-support-detection-add-error-output.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Sun, 26 May 2024 15:13:33 +0200 +Subject: [PATCH] cmake: correct PIE support detection, add error output for + debugging `check_pie_supported` only uses the `OUTPUT_VARIABLE` to to signify + errors if PIE is actually supported is signaled by + `CMAKE__LINK_PIE_SUPPORTED`. + +Checking if `OUTPUT_VARIABLE` is empty is not enough either since the check +is bypassed if its results are cached but the output variable is not cached. + +Signed-off-by: Jan200101 +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06df068919..a1b8aa57a0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -125,8 +125,8 @@ check_pie_supported( + OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE + LANGUAGES C CXX + ) +-if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE) +- message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target") ++if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED) ++ message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}") + endif() + + diff --git a/0005-remove-native-lib-directories-from-rpath.patch b/0005-remove-native-lib-directories-from-rpath.patch new file mode 100644 index 0000000..36e62b4 --- /dev/null +++ b/0005-remove-native-lib-directories-from-rpath.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Tue, 11 Jun 2024 13:35:37 +0200 +Subject: [PATCH] remove native lib directories from rpath + +Signed-off-by: Jan200101 +--- + src/main.zig | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/main.zig b/src/main.zig +index 21f7281d74..854dfb48cc 100644 +--- a/src/main.zig ++++ b/src/main.zig +@@ -3740,6 +3740,15 @@ fn createModule( + try create_module.framework_dirs.appendSlice(arena, paths.framework_dirs.items); + try create_module.lib_dirs.appendSlice(arena, paths.lib_dirs.items); + try create_module.rpath_list.appendSlice(arena, paths.rpaths.items); ++ ++ for (paths.lib_dirs.items) |native_lib_dir| { ++ for (0.., create_module.rpath_list.items) |i, rpath_dir| { ++ if (std.mem.eql(u8, native_lib_dir, rpath_dir)) { ++ _ = create_module.rpath_list.orderedRemove(i); ++ break; ++ } ++ } ++ } + } + + if (create_module.libc_paths_file) |paths_file| { diff --git a/sources b/sources index f41a951..f69b37f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.12.1.tar.xz) = 6242b37420954792834f48b27b6d325e78908e51fcf4d05cd2f5c65b82209a38cf1fef2914630846d40b57cc55d64adbfd67f88e939d2e493b58bc0f1ef3520b -SHA512 (zig-0.12.1.tar.xz.minisig) = 12da0f1a92f980fa04506b97f348aaf9cb18880e1047fc41e6cff01066a3c54dc36146ac4bd1bcc3110d6ebcb3d7cd36f7b3e434e9a5953d6a274681434ff173 +SHA512 (zig-0.13.0.tar.xz) = 6f5f31f4ba71a11d8b16c7a5a613e124095e503fa6b02d2b77e5b177674c739287e81d98d96dc261fed24bc836caf196f71c3fcc7a6518387df86ba9e03df4dd +SHA512 (zig-0.13.0.tar.xz.minisig) = 21c6139c06cba6c5e23a3305fed0c0f1b9b32d9140bd686c26365ce0279d5f53cd081894eaba29f0c1ed51b2e831edf7bd4ae6a7eaee5018a252e312e9b65507 diff --git a/zig.spec b/zig.spec index 8acb9dc..2c673f0 100644 --- a/zig.spec +++ b/zig.spec @@ -4,11 +4,11 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 40 || 0%{?rhel} >= 9 -%define llvm_compat 17 +%if 0%{?fedora} >= 42 || 0%{?rhel} >= 9 +%define llvm_compat 18 %endif -%global llvm_version 17.0.0 +%global llvm_version 18.0.0 %bcond bootstrap 0 %bcond docs %{without bootstrap} @@ -16,8 +16,8 @@ %bcond test 1 Name: zig -Version: 0.12.1 -Release: 1%{?dist} +Version: 0.13.0 +Release: 0%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -33,6 +33,11 @@ Patch: 0002-Enable-build-id-by-default.patch # Zig fetch will recurse onto the cache directory, prevent that from happening. # https://github.com/ziglang/zig/pull/19951 Patch: 0003-fetch-prevent-global-cache-from-being-copied.patch +# Fix broken PIE capability detection +# https://github.com/ziglang/zig/pull/20072 +Patch: 0004-cmake-correct-PIE-support-detection-add-error-output.patch +# Remove native libr directories from rpath +Patch: 0005-remove-native-lib-directories-from-rpath.patch BuildRequires: gcc BuildRequires: gcc-c++ From 8736cbd905ec4a251df79f7b12d0aee6aadd38c3 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 22:47:27 +0200 Subject: [PATCH 13/59] bump release --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 2c673f0..c336ff2 100644 --- a/zig.spec +++ b/zig.spec @@ -17,7 +17,7 @@ Name: zig Version: 0.13.0 -Release: 0%{?dist} +Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -192,6 +192,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Tue Jun 11 2024 Jan200101 - 0.13.0-1 +- Update to 0.13.0 + * Sat Jun 08 2024 Jan200101 - 0.12.1-1 - Update to 0.12.1 From 8a089228424c2b947123f165fb8c41ba96352c2d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 10:52:01 +0000 Subject: [PATCH 14/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index c336ff2..4af7eae 100644 --- a/zig.spec +++ b/zig.spec @@ -17,7 +17,7 @@ Name: zig Version: 0.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 @@ -192,6 +192,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 0.13.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jun 11 2024 Jan200101 - 0.13.0-1 - Update to 0.13.0 From cf62d59e741ec8a7af60acb62d5531c03eb7cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 4 Sep 2024 23:02:26 +0200 Subject: [PATCH 15/59] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- zig.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zig.spec b/zig.spec index 4af7eae..558c042 100644 --- a/zig.spec +++ b/zig.spec @@ -17,10 +17,11 @@ Name: zig Version: 0.13.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software -License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 +# Automatically converted from old format: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 - review is highly recommended. +License: LicenseRef-Callaway-MIT AND NCSA AND LicenseRef-Callaway-LGPLv2+ AND LGPL-2.1-or-later WITH Qwt-exception-1.0 AND GPL-2.0-or-later AND LicenseRef-Callaway-GPLv2+-with-exceptions AND LicenseRef-Callaway-BSD AND Inner-Net-2.0 AND ISC AND LicenseRef-Callaway-Public-Domain AND LicenseRef-Callaway-GFDL AND ZPL-2.1 URL: https://ziglang.org Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig @@ -192,6 +193,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Wed Sep 04 2024 Miroslav Suchý - 0.13.0-3 +- convert license to SPDX + * Sat Jul 20 2024 Fedora Release Engineering - 0.13.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From b72f379bfdbf2098ccfc9d025f2379583473d6fc Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 30 Dec 2024 00:13:43 +0100 Subject: [PATCH 16/59] update callaway licenses to follow SPDX --- zig.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zig.spec b/zig.spec index 558c042..4c077cf 100644 --- a/zig.spec +++ b/zig.spec @@ -20,8 +20,7 @@ Version: 0.13.0 Release: 3%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software -# Automatically converted from old format: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1 - review is highly recommended. -License: LicenseRef-Callaway-MIT AND NCSA AND LicenseRef-Callaway-LGPLv2+ AND LGPL-2.1-or-later WITH Qwt-exception-1.0 AND GPL-2.0-or-later AND LicenseRef-Callaway-GPLv2+-with-exceptions AND LicenseRef-Callaway-BSD AND Inner-Net-2.0 AND ISC AND LicenseRef-Callaway-Public-Domain AND LicenseRef-Callaway-GFDL AND ZPL-2.1 +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 URL: https://ziglang.org Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig @@ -68,7 +67,7 @@ Requires: %{name}-libs = %{version} # Apache-2.0 WITH LLVM-exception OR NCSA OR MIT Provides: bundled(compiler-rt) = %{llvm_version} -# LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL +# LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only Provides: bundled(glibc) = 2.38 # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxx) = %{llvm_version} From c8cfc2b53dd82650111a94a5facd984f9251b15c Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 30 Dec 2024 11:49:48 +0100 Subject: [PATCH 17/59] correct macro variables - zig does not handle relative paths passed to the first process so we need to specify an absolute path - system integration was accidentally broken by an extra % sign - system flag was used on cache instead of package directory --- macros.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macros.zig b/macros.zig index 969c861..856dd1b 100644 --- a/macros.zig +++ b/macros.zig @@ -2,7 +2,7 @@ %zig %{_bindir}/zig -%_zig_cache_dir zig-cache +%_zig_cache_dir %{builddir}/zig-cache # expected features for each arch when targeting baseline # found in https://github.com/ziglang/zig/tree/master/lib/std/target @@ -25,10 +25,10 @@ # seperated build options %_zig_general_options --verbose --release=%{_zig_release_mode} %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -%_zig_system_integration --system %{_zig_cache_dir} +%_zig_system_integration --system %{_zig_cache_dir}/p %_zig_advanced_options --cache-dir %{_zig_cache_dir} --global-cache-dir %{_zig_cache_dir} -%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?%_zig_system_integration} %{?_zig_advanced_options} +%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %_zig_fetch_options --global-cache-dir %{_zig_cache_dir} From c61f4bb7e8af6956e421999538e5582c7f50443f Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 30 Dec 2024 11:50:27 +0100 Subject: [PATCH 18/59] set llvm_compat for Fedora 41 Fedora 41 now ships llvm19 by default --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 4c077cf..ceee293 100644 --- a/zig.spec +++ b/zig.spec @@ -4,7 +4,7 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 42 || 0%{?rhel} >= 9 +%if 0%{?fedora} >= 41 || 0%{?rhel} >= 9 %define llvm_compat 18 %endif From 5087b7f0b06f31b6533c81f277561106931ff485 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 30 Dec 2024 12:08:21 +0100 Subject: [PATCH 19/59] bump release --- zig.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index ceee293..86e4747 100644 --- a/zig.spec +++ b/zig.spec @@ -17,7 +17,7 @@ Name: zig Version: 0.13.0 -Release: 3%{?dist} +Release: 4%{?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 @@ -192,6 +192,11 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sun Dec 29 2024 Jan200101 - 0.13.0-4 +- correct macro variables +- set llvm_compat for F41 +- update callaway licenses to follow SPDX + * Wed Sep 04 2024 Miroslav Suchý - 0.13.0-3 - convert license to SPDX From f0f8c54d66797e6666abb574d015cfec65e24b00 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 1 Jan 2025 13:20:03 +0100 Subject: [PATCH 20/59] update baseline list, add summary flag to general options the summary flag outputs a complete build summary of the whole build tree output in an orderly tree structure, very useful for inspecting what the build system actually did --- macros.zig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/macros.zig b/macros.zig index 856dd1b..1a765ad 100644 --- a/macros.zig +++ b/macros.zig @@ -5,25 +5,26 @@ %_zig_cache_dir %{builddir}/zig-cache # expected features for each arch when targeting baseline -# found in https://github.com/ziglang/zig/tree/master/lib/std/target +# found in https://github.com/ziglang/zig/tree/master/lib/std/Target # # aarch64: -# ete, fuse_aes, neon, perfmon, use_postra_scheduler, +# enable_select_opt, ete, fuse_adrp_add, fuse_aes, neon, use_postra_scheduler, # # x86_64: -# cx8 idivq_to_divl macrofusion slow_3ops_lea slow_incdec vzeroupper x87 +# cmov, cx8, fxsr, idivq_to_divl, macrofusion, mmx, nopl, slow_3ops_lea, slow_incdec, sse2, vzeroupper, x87 # # riscv64: -# a, c, d, m +# a, c, d, i, m # # mips64: -# mips32 +# mips64r2 +# %_zig_cpu baseline %_zig_target native %_zig_release_mode safe # seperated build options -%_zig_general_options --verbose --release=%{_zig_release_mode} +%_zig_general_options --verbose --release=%{_zig_release_mode} --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} %_zig_system_integration --system %{_zig_cache_dir}/p %_zig_advanced_options --cache-dir %{_zig_cache_dir} --global-cache-dir %{_zig_cache_dir} From ceb0aad27a973017af6cd458ad3ae34fe174c245 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 1 Jan 2025 14:37:31 +0100 Subject: [PATCH 21/59] quote paths to prevent any accidents --- macros.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.zig b/macros.zig index 1a765ad..8261587 100644 --- a/macros.zig +++ b/macros.zig @@ -26,8 +26,8 @@ # seperated build options %_zig_general_options --verbose --release=%{_zig_release_mode} --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -%_zig_system_integration --system %{_zig_cache_dir}/p -%_zig_advanced_options --cache-dir %{_zig_cache_dir} --global-cache-dir %{_zig_cache_dir} +%_zig_system_integration --system "%{_zig_cache_dir}/p" +%_zig_advanced_options --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" From 72e170e8d68d96e6b0670b9cfc7effddc448bafc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 16:46:02 +0000 Subject: [PATCH 22/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 86e4747..22e6096 100644 --- a/zig.spec +++ b/zig.spec @@ -17,7 +17,7 @@ Name: zig Version: 0.13.0 -Release: 4%{?dist} +Release: 5%{?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 @@ -192,6 +192,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 0.13.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sun Dec 29 2024 Jan200101 - 0.13.0-4 - correct macro variables - set llvm_compat for F41 From 6150a6d460831de5a4df2511bc3da5051f6e7c4b Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 23 Jan 2025 18:36:02 +0100 Subject: [PATCH 23/59] rebuild against fixed llvm --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 22e6096..37195b0 100644 --- a/zig.spec +++ b/zig.spec @@ -17,7 +17,7 @@ Name: zig Version: 0.13.0 -Release: 5%{?dist} +Release: 6%{?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 @@ -192,6 +192,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Thu Jan 23 2025 Jan200101 - 0.13.0-6 +- rebuild against fixed llvm + * Sun Jan 19 2025 Fedora Release Engineering - 0.13.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 2bbfea5a46716ed2ab0a4f54435332369cd1fd2a Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 10:01:34 +0100 Subject: [PATCH 24/59] separate package dir from cache dir, add prepare macro `zig build --system` fails if the given path does not exist this hasn't been an issue for river or ghostty since they pull in dependencies which makes zig create the given path, but ncdu doesn't have any dependencies. --- macros.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/macros.zig b/macros.zig index 8261587..b5265d0 100644 --- a/macros.zig +++ b/macros.zig @@ -3,6 +3,7 @@ %zig %{_bindir}/zig %_zig_cache_dir %{builddir}/zig-cache +%_zig_package_dir %{_zig_cache_dir}/p # expected features for each arch when targeting baseline # found in https://github.com/ziglang/zig/tree/master/lib/std/Target @@ -26,13 +27,20 @@ # seperated build options %_zig_general_options --verbose --release=%{_zig_release_mode} --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -%_zig_system_integration --system "%{_zig_cache_dir}/p" +%_zig_system_integration --system "%{_zig_package_dir}" %_zig_advanced_options --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %_zig_fetch_options --global-cache-dir %{_zig_cache_dir} + +%zig_prep %{shrink: \ + mkdir -p \ + %{_zig_cache_dir} \ + %{_zig_package_dir} \ +} + %zig_build %{shrink: \ %zig \ build \ From e48280957a5682c5f01a8c79434001d06a584830 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 10:04:03 +0100 Subject: [PATCH 25/59] drop unused patch the patch was originally introduced to fix some hash related issues where the artifacts created by zig may influence the hash creation. This is only an issue when the build.zig.zon of a project specifies "" as a path, which means "include the whole project foler" including any sort of output or build cache. While this hasn't caused any issues for anyone this is undesired behavior and changes how zig operates its best to start a discussion with upstream how this best be dealt with --- ...event-global-cache-from-being-copied.patch | 61 ------------------- zig.spec | 3 - 2 files changed, 64 deletions(-) delete mode 100644 0003-fetch-prevent-global-cache-from-being-copied.patch diff --git a/0003-fetch-prevent-global-cache-from-being-copied.patch b/0003-fetch-prevent-global-cache-from-being-copied.patch deleted file mode 100644 index 22c5ce1..0000000 --- a/0003-fetch-prevent-global-cache-from-being-copied.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Sun, 12 May 2024 18:20:19 +0200 -Subject: [PATCH] fetch: prevent global cache from being copied - -Signed-off-by: Jan200101 ---- - src/Package/Fetch.zig | 33 +++++++++++++++++++++------------ - 1 file changed, 21 insertions(+), 12 deletions(-) - -diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig -index f45a5cc93e..f21409ae76 100644 ---- a/src/Package/Fetch.zig -+++ b/src/Package/Fetch.zig -@@ -1343,6 +1343,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac - - fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void { - const gpa = f.arena.child_allocator; -+ const cache_root = f.job_queue.global_cache; - // Recursive directory copy. - var it = try dir.walk(gpa); - defer it.deinit(); -@@ -1350,18 +1351,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void - switch (entry.kind) { - .directory => {}, // omit empty directories - .file => { -- dir.copyFile( -- entry.path, -- tmp_dir, -- entry.path, -- .{}, -- ) catch |err| switch (err) { -- error.FileNotFound => { -- if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname); -- try dir.copyFile(entry.path, tmp_dir, entry.path, .{}); -- }, -- else => |e| return e, -- }; -+ const full_path = try dir.realpathAlloc(gpa, entry.path); -+ defer gpa.free(full_path); -+ -+ const cache_path = try cache_root.handle.realpathAlloc(gpa, "."); -+ defer gpa.free(cache_path); -+ -+ if (!std.mem.startsWith(u8, full_path, cache_path)) { -+ dir.copyFile( -+ entry.path, -+ tmp_dir, -+ entry.path, -+ .{}, -+ ) catch |err| switch (err) { -+ error.FileNotFound => { -+ if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname); -+ try dir.copyFile(entry.path, tmp_dir, entry.path, .{}); -+ }, -+ else => |e| return e, -+ }; -+ } - }, - .sym_link => { - var buf: [fs.MAX_PATH_BYTES]u8 = undefined; diff --git a/zig.spec b/zig.spec index 37195b0..7736ad0 100644 --- a/zig.spec +++ b/zig.spec @@ -30,9 +30,6 @@ Patch: 0001-Fedora-bootstrap-and-extra-build-flags-support.patch # There's no global option for build-id so enable it by default # instead of patching every project's build.zig Patch: 0002-Enable-build-id-by-default.patch -# Zig fetch will recurse onto the cache directory, prevent that from happening. -# https://github.com/ziglang/zig/pull/19951 -Patch: 0003-fetch-prevent-global-cache-from-being-copied.patch # Fix broken PIE capability detection # https://github.com/ziglang/zig/pull/20072 Patch: 0004-cmake-correct-PIE-support-detection-add-error-output.patch From a70f7390949b1e1d5743339a182b60a5edccb9a2 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 11:03:01 +0100 Subject: [PATCH 26/59] add user provided options to the end of the build and install options --- macros.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.zig b/macros.zig index b5265d0..2233d7e 100644 --- a/macros.zig +++ b/macros.zig @@ -30,8 +30,8 @@ %_zig_system_integration --system "%{_zig_package_dir}" %_zig_advanced_options --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" -%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} -%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" +%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options} +%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options} %_zig_fetch_options --global-cache-dir %{_zig_cache_dir} From 8cc224672eca7e55a8fdf963d9585bd9560ecf98 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 13:59:52 +0100 Subject: [PATCH 27/59] build stage 3 using zig build system --- .gitignore | 1 + zig.spec | 55 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 023b23f..f1e9e44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/*-build /zig-*.tar.xz /zig-*.tar.xz.minisig diff --git a/zig.spec b/zig.spec index 7736ad0..ecadfef 100644 --- a/zig.spec +++ b/zig.spec @@ -15,6 +15,31 @@ %bcond macro %{without bootstrap} %bcond test 1 +%global zig_cache_dir %{builddir}/zig-cache + +%global zig_build_options %{shrink: \ + --verbose \ + --release=safe \ + --summary all \ + \ + -Dtarget=native \ + -Dcpu=baseline \ + \ + --cache-dir "%{zig_cache_dir}" \ + --global-cache-dir "%{zig_cache_dir}" \ + \ + -Dversion-string="%{version}" \ + -Dstatic-llvm=false \ + -Denable-llvm=true \ + -Dno-langref=true \ + -Dstd-docs=false \ + -Dbuild-id="sha1" \ + -Dconfig_h="%{__cmake_builddir}/config.h" \ +} +%global zig_install_options %zig_build_options %{shrink: \ + --prefix "%{_prefix}" \ +} + Name: zig Version: 0.13.0 Release: 6%{?dist} @@ -123,6 +148,10 @@ rm -f stage1/zig1.wasm %endif %build + +# zig doesn't know how to dynamically link llvm on its own so we need cmake to generate a header ahead of time +# if we provice the header we need to also build zigcpp + # C_FLAGS: wasm2c output generates a lot of noise with -Wunused. # EXTRA_BUILD_ARGS: apply --build-id=sha1 even if running unpatched stage2 compiler. %cmake \ @@ -137,24 +166,34 @@ rm -f stage1/zig1.wasm -DZIG_TARGET_MCPU:STRING=baseline \ -DZIG_TARGET_TRIPLE:STRING=native \ \ - -DZIG_VERSION:STRING="%{version}" \ - %{!?with_bootstrap:-DZIG_EXECUTABLE:STRING="/usr/bin/zig"} -# Build only stage3 and dependencies. Skips stage1/2 if using /usr/bin/zig + -DZIG_VERSION:STRING="%{version}" + +%if %{with bootstrap} %cmake_build --target stage3 +%else +%cmake_build --target zigcpp +zig build %{zig_build_options} # Zig has no official manpage # https://github.com/ziglang/zig/issues/715 -help2man --no-discard-stderr --no-info "%{__cmake_builddir}/stage3/bin/zig" --version-option=version --output=%{name}.1 +help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=%{name}.1 +%endif + %if %{with docs} -"%{__cmake_builddir}/stage3/bin/zig" build docs \ +# Use the newly made stage 3 compiler to generate docs +./zig-out/bin/zig build docs \ --verbose \ - --global-cache-dir zig-cache \ + --global-cache-dir "%{zig_cache_dir}" \ -Dversion-string="%{version}" %endif %install +%if %{with bootstrap} %cmake_install +%else +DESTDIR="%{buildroot}" zig build install %{zig_install_options} +%endif install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ %{name}.1 @@ -165,13 +204,15 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %if %{with test} %check # Run reduced set of tests, based on the Zig CI -"%{__cmake_builddir}/stage3/bin/zig" test test/behavior.zig -Itest +"%{buildroot}%{_bindir}/zig" test test/behavior.zig -Itest %endif %files %license LICENSE %{_bindir}/zig +%if %{without bootstrap} %{_mandir}/man1/%{name}.1.* +%endif %files libs %{_prefix}/lib/%{name} From 3f349af1dfe0dcfb37ae42d061df5cfe3bbbe99d Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 12:34:01 +0100 Subject: [PATCH 28/59] bump release --- zig.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index ecadfef..cc1b699 100644 --- a/zig.spec +++ b/zig.spec @@ -42,7 +42,7 @@ Name: zig Version: 0.13.0 -Release: 6%{?dist} +Release: 7%{?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 @@ -230,6 +230,10 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Mon Jan 27 2025 Jan200101 - 0.13.0-7 +- build stage 3 using zig build system +- add user provided options to the end of the build and install options + * Thu Jan 23 2025 Jan200101 - 0.13.0-6 - rebuild against fixed llvm From 3220db0cdf48e2b53097dca3d48afe0dc697bec2 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 15:21:36 +0100 Subject: [PATCH 29/59] enable position independent executable for the zig build --- zig.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index cc1b699..6d9d509 100644 --- a/zig.spec +++ b/zig.spec @@ -33,8 +33,9 @@ -Denable-llvm=true \ -Dno-langref=true \ -Dstd-docs=false \ - -Dbuild-id="sha1" \ + -Dpie \ -Dconfig_h="%{__cmake_builddir}/config.h" \ + -Dbuild-id="sha1" \ } %global zig_install_options %zig_build_options %{shrink: \ --prefix "%{_prefix}" \ From fecba593ad2239a6b2b5a1a0bc99edde083203ca Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 15:46:08 +0100 Subject: [PATCH 30/59] use release fast instead of release safe this doesn't match how how we build other zig projects but it matches how stage3 is build using cmake. I hope this brings the aarch64 memory usage down far enough for it to compile --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 6d9d509..a229369 100644 --- a/zig.spec +++ b/zig.spec @@ -19,7 +19,7 @@ %global zig_build_options %{shrink: \ --verbose \ - --release=safe \ + --release=fast \ --summary all \ \ -Dtarget=native \ From 901fbb9f17ed88bcfb64a9bd6c28738e2107d7d3 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 16:34:37 +0100 Subject: [PATCH 31/59] specify to build against local zig stdlib directory --- zig.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/zig.spec b/zig.spec index a229369..c644acd 100644 --- a/zig.spec +++ b/zig.spec @@ -24,6 +24,7 @@ \ -Dtarget=native \ -Dcpu=baseline \ + --zig-lib-dir lib \ \ --cache-dir "%{zig_cache_dir}" \ --global-cache-dir "%{zig_cache_dir}" \ From d0f0b383da960bbfc282d7150a37c1a260d33c4b Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 27 Jan 2025 16:35:42 +0100 Subject: [PATCH 32/59] bump release --- zig.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index c644acd..213eae9 100644 --- a/zig.spec +++ b/zig.spec @@ -44,7 +44,7 @@ Name: zig Version: 0.13.0 -Release: 7%{?dist} +Release: 8%{?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 @@ -232,6 +232,11 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Mon Jan 27 2025 Jan200101 - 0.13.0-8 +- specify to build against local zig stdlib directory to ensure we are building against the newest stdlib +- use release fast instead of release safe to fix aarch64 builds from running out of memory +- enable position independent executable for the zig build + * Mon Jan 27 2025 Jan200101 - 0.13.0-7 - build stage 3 using zig build system - add user provided options to the end of the build and install options From 284dc4f1a35554e9b25802a206c3be7476f06629 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 1 Feb 2025 19:21:24 +0100 Subject: [PATCH 33/59] add user provided test and fetch options --- macros.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macros.zig b/macros.zig index 2233d7e..005a86d 100644 --- a/macros.zig +++ b/macros.zig @@ -32,7 +32,8 @@ %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options} -%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} +%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} %{zig_fetch_options} +%_zig_test_options %{?zig_test_options} %zig_prep %{shrink: \ @@ -62,5 +63,6 @@ %zig_test %{shrink: \ %zig_build \ - test + test \ + %{?%_zig_test_options} \ } From 0a50d1817b2cf871163db78875ca57488092ff71 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 13 Apr 2025 20:15:51 +0200 Subject: [PATCH 34/59] Update to 0.14.0 --- ...tstrap-and-extra-build-flags-support.patch | 59 ------------- ...ve-native-lib-directories-from-rpath.patch | 10 +-- 0002-Enable-build-id-by-default.patch | 23 ----- 0002-std.Build-add-build-id-option.patch | 87 +++++++++++++++++++ ...E-support-detection-add-error-output.patch | 31 ------- zig.spec | 56 ++++++------ 6 files changed, 123 insertions(+), 143 deletions(-) delete mode 100644 0001-Fedora-bootstrap-and-extra-build-flags-support.patch rename 0005-remove-native-lib-directories-from-rpath.patch => 0001-remove-native-lib-directories-from-rpath.patch (71%) delete mode 100644 0002-Enable-build-id-by-default.patch create mode 100644 0002-std.Build-add-build-id-option.patch delete mode 100644 0004-cmake-correct-PIE-support-detection-add-error-output.patch diff --git a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch b/0001-Fedora-bootstrap-and-extra-build-flags-support.patch deleted file mode 100644 index 7bf71bf..0000000 --- a/0001-Fedora-bootstrap-and-extra-build-flags-support.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Fri, 20 Oct 2023 04:49:46 +0000 -Subject: [PATCH] Fedora: bootstrap and extra build flags support - -- Allow passing ZIG_EXTRA_BUILD_FLAGS for stage3 build. -- Allow redefining ZIG_EXECUTABLE and short-circuiting to stage3 build - when using a prebuilt compiler from bootstrap package. -- Bump required CMake version to 3.14 to enable generator expression - expansion in `install(CODE ...)`. - -Signed-off-by: Jan200101 ---- - CMakeLists.txt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 22051f1902..06df068919 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -922,6 +922,9 @@ if(MSVC OR MINGW) - target_link_libraries(zig2 LINK_PUBLIC version) - endif() - -+# Fedora customizations -+set(ZIG_EXTRA_BUILD_ARGS "" CACHE STRING "Extra flags for stage3 build") -+set(ZIG_EXECUTABLE "$" CACHE STRING "Compiler command to use for stage3 build") - - # "-Dno-langref" and "-Dstd-docs=false" are hardcoded because they take too long to build. - # To obtain these two forms of documentation, run zig build against stage3 rather than stage2. -@@ -937,6 +940,8 @@ set(ZIG_BUILD_ARGS - - -Dno-langref - -Dstd-docs=false -+ -+ ${ZIG_EXTRA_BUILD_ARGS} - ) - - if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") -@@ -976,17 +981,12 @@ set(ZIG2_WORKING_DIR "${PROJECT_SOURCE_DIR}") - - add_custom_command( - OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig" -- COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} -+ COMMAND ${ZIG_EXECUTABLE} build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} - COMMENT STATUS "Building stage3" -+ DEPENDS zigcpp - WORKING_DIRECTORY "${ZIG2_WORKING_DIR}" - ) - --if(WIN32) -- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2.exe") --else() -- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2") --endif() -- - install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")") - install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")") - install(CODE "set(ZIG2_WORKING_DIR \"${ZIG2_WORKING_DIR}\")") diff --git a/0005-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch similarity index 71% rename from 0005-remove-native-lib-directories-from-rpath.patch rename to 0001-remove-native-lib-directories-from-rpath.patch index 36e62b4..a999ded 100644 --- a/0005-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -9,13 +9,13 @@ Signed-off-by: Jan200101 1 file changed, 9 insertions(+) diff --git a/src/main.zig b/src/main.zig -index 21f7281d74..854dfb48cc 100644 +index 1075993846..dd9ab8febd 100644 --- a/src/main.zig +++ b/src/main.zig -@@ -3740,6 +3740,15 @@ fn createModule( - try create_module.framework_dirs.appendSlice(arena, paths.framework_dirs.items); - try create_module.lib_dirs.appendSlice(arena, paths.lib_dirs.items); - try create_module.rpath_list.appendSlice(arena, paths.rpaths.items); +@@ -4033,6 +4033,15 @@ fn createModule( + + try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len); + for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(&create_module.lib_directories, path, true); + + for (paths.lib_dirs.items) |native_lib_dir| { + for (0.., create_module.rpath_list.items) |i, rpath_dir| { diff --git a/0002-Enable-build-id-by-default.patch b/0002-Enable-build-id-by-default.patch deleted file mode 100644 index d77f74e..0000000 --- a/0002-Enable-build-id-by-default.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aleksei Bavshin -Date: Fri, 20 Oct 2023 04:49:54 +0000 -Subject: [PATCH] Enable build-id by default - -Signed-off-by: Jan200101 ---- - src/Compilation.zig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Compilation.zig b/src/Compilation.zig -index 507cbfc6d5..d946956b05 100644 ---- a/src/Compilation.zig -+++ b/src/Compilation.zig -@@ -1230,7 +1230,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil - const any_sanitize_thread = options.config.any_sanitize_thread or options.root_mod.sanitize_thread; - - const link_eh_frame_hdr = options.link_eh_frame_hdr or any_unwind_tables; -- const build_id = options.build_id orelse .none; -+ const build_id = options.build_id orelse .sha1; - - const link_libc = options.config.link_libc; - diff --git a/0002-std.Build-add-build-id-option.patch b/0002-std.Build-add-build-id-option.patch new file mode 100644 index 0000000..8aaa560 --- /dev/null +++ b/0002-std.Build-add-build-id-option.patch @@ -0,0 +1,87 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Fri, 17 Jan 2025 20:53:30 +0100 +Subject: [PATCH] std.Build: add build-id option + +Signed-off-by: Jan200101 +--- + build.zig | 6 ------ + lib/compiler/build_runner.zig | 13 +++++++++++++ + lib/std/Build.zig | 2 ++ + lib/std/Build/Step/Compile.zig | 2 +- + 4 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/build.zig b/build.zig +index 2d196041b3..c7dec601b4 100644 +--- a/build.zig ++++ b/build.zig +@@ -197,12 +197,6 @@ pub fn build(b: *std.Build) !void { + exe.pie = pie; + exe.entitlements = entitlements; + +- exe.build_id = b.option( +- std.zig.BuildId, +- "build-id", +- "Request creation of '.note.gnu.build-id' section", +- ); +- + if (no_bin) { + b.getInstallStep().dependOn(&exe.step); + } else { +diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig +index 8702acb329..81393610be 100644 +--- a/lib/compiler/build_runner.zig ++++ b/lib/compiler/build_runner.zig +@@ -202,6 +202,15 @@ pub fn main() !void { + next_arg, @errorName(err), + }); + }; ++ } else if (mem.eql(u8, arg, "--build-id")) { ++ builder.build_id = .fast; ++ } else if (mem.startsWith(u8, arg, "--build-id=")) { ++ const style = arg["--build-id=".len..]; ++ builder.build_id = std.zig.BuildId.parse(style) catch |err| { ++ fatal("unable to parse --build-id style '{s}': {s}", .{ ++ style, @errorName(err), ++ }); ++ }; + } else if (mem.eql(u8, arg, "--debounce")) { + const next_arg = nextArg(args, &arg_idx) orelse + fatalWithHint("expected u16 after '{s}'", .{arg}); +@@ -1364,6 +1373,10 @@ fn usage(b: *std.Build, out_stream: anytype) !void { + \\ --zig-lib-dir [arg] Override path to Zig lib directory + \\ --build-runner [file] Override path to build runner + \\ --seed [integer] For shuffling dependency traversal order (default: random) ++ \\ --build-id[=style] At a minor link-time expense, coordinates stripped binaries ++ \\ fast, uuid, sha1, md5 with debug symbols via a '.note.gnu.build-id' section ++ \\ 0x[hexstring] Maximum 32 bytes ++ \\ none (default) Disable build-id + \\ --debug-log [scope] Enable debugging the compiler + \\ --debug-pkg-config Fail if unknown pkg-config flags encountered + \\ --debug-rt Debug compiler runtime libraries +diff --git a/lib/std/Build.zig b/lib/std/Build.zig +index 4afdcd2bff..d31d9f3ee0 100644 +--- a/lib/std/Build.zig ++++ b/lib/std/Build.zig +@@ -94,6 +94,8 @@ available_deps: AvailableDeps, + + release_mode: ReleaseMode, + ++build_id: ?std.zig.BuildId = null, ++ + pub const ReleaseMode = enum { + off, + any, +diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig +index 616e8f76b4..f70410f612 100644 +--- a/lib/std/Build/Step/Compile.zig ++++ b/lib/std/Build/Step/Compile.zig +@@ -1681,7 +1681,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { + + try addFlag(&zig_args, "each-lib-rpath", compile.each_lib_rpath); + +- if (compile.build_id) |build_id| { ++ if (compile.build_id orelse b.build_id) |build_id| { + try zig_args.append(switch (build_id) { + .hexstring => |hs| b.fmt("--build-id=0x{s}", .{ + std.fmt.fmtSliceHexLower(hs.toSlice()), diff --git a/0004-cmake-correct-PIE-support-detection-add-error-output.patch b/0004-cmake-correct-PIE-support-detection-add-error-output.patch deleted file mode 100644 index ef2bd89..0000000 --- a/0004-cmake-correct-PIE-support-detection-add-error-output.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Sun, 26 May 2024 15:13:33 +0200 -Subject: [PATCH] cmake: correct PIE support detection, add error output for - debugging `check_pie_supported` only uses the `OUTPUT_VARIABLE` to to signify - errors if PIE is actually supported is signaled by - `CMAKE__LINK_PIE_SUPPORTED`. - -Checking if `OUTPUT_VARIABLE` is empty is not enough either since the check -is bypassed if its results are cached but the output variable is not cached. - -Signed-off-by: Jan200101 ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 06df068919..a1b8aa57a0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -125,8 +125,8 @@ check_pie_supported( - OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE - LANGUAGES C CXX - ) --if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE) -- message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target") -+if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED) -+ message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}") - endif() - - diff --git a/zig.spec b/zig.spec index 213eae9..8e14685 100644 --- a/zig.spec +++ b/zig.spec @@ -4,11 +4,11 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 41 || 0%{?rhel} >= 9 -%define llvm_compat 18 +%if 0%{?fedora} >= 44 || 0%{?rhel} >= 9 +%define llvm_compat 19 %endif -%global llvm_version 18.0.0 +%global llvm_version 19.0.0 %bcond bootstrap 0 %bcond docs %{without bootstrap} @@ -25,6 +25,7 @@ -Dtarget=native \ -Dcpu=baseline \ --zig-lib-dir lib \ + --build-id=sha1 \ \ --cache-dir "%{zig_cache_dir}" \ --global-cache-dir "%{zig_cache_dir}" \ @@ -36,15 +37,14 @@ -Dstd-docs=false \ -Dpie \ -Dconfig_h="%{__cmake_builddir}/config.h" \ - -Dbuild-id="sha1" \ } %global zig_install_options %zig_build_options %{shrink: \ --prefix "%{_prefix}" \ } Name: zig -Version: 0.13.0 -Release: 8%{?dist} +Version: 0.14.0 +Release: 1%{?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 @@ -52,16 +52,17 @@ URL: https://ziglang.org Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig Source2: macros.%{name} -# Support clean build of stage3 with temporary bootstrapped package -Patch: 0001-Fedora-bootstrap-and-extra-build-flags-support.patch -# There's no global option for build-id so enable it by default -# instead of patching every project's build.zig -Patch: 0002-Enable-build-id-by-default.patch -# Fix broken PIE capability detection -# https://github.com/ziglang/zig/pull/20072 -Patch: 0004-cmake-correct-PIE-support-detection-add-error-output.patch -# Remove native libr directories from rpath -Patch: 0005-remove-native-lib-directories-from-rpath.patch +# Remove native lib directories from rpath +# this is unlikely to be upstreamed in its current state because upstream +# wants to work around the shortcomings of NixOS +Patch: 0001-remove-native-lib-directories-from-rpath.patch +# Adds a build option for setting the build-id +# some projects are not programmed to handle a build-id's +# by having it as a flag we can make sure no developer runs into +# any trouble because of packaging demands +# https://github.com/ziglang/zig/pull/22516 +Patch: 0002-std.Build-add-build-id-option.patch + BuildRequires: gcc BuildRequires: gcc-c++ @@ -70,6 +71,7 @@ BuildRequires: llvm%{?llvm_compat}-devel BuildRequires: clang%{?llvm_compat}-devel BuildRequires: lld%{?llvm_compat}-devel BuildRequires: zlib-devel +BuildRequires: libxml2-devel # for man page generation BuildRequires: help2man # for signature verification @@ -92,7 +94,7 @@ Requires: %{name}-libs = %{version} # Apache-2.0 WITH LLVM-exception OR NCSA OR MIT Provides: bundled(compiler-rt) = %{llvm_version} # LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only -Provides: bundled(glibc) = 2.38 +Provides: bundled(glibc) = 2.41 # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxx) = %{llvm_version} # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA @@ -100,11 +102,11 @@ Provides: bundled(libcxxabi) = %{llvm_version} # NCSA Provides: bundled(libunwind) = %{llvm_version} # BSD, LGPG, ZPL -Provides: bundled(mingw) = 0bac2d3cdb122dadcdee90009f7e24a69d56939f +Provides: bundled(mingw) = 3839e21b08807479a31d5a9764666f82ae2f0356 # MIT -Provides: bundled(musl) = 1.2.4 +Provides: bundled(musl) = 1.2.5 # Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause -Provides: bundled(wasi-libc) = 3189cd1ceec8771e8f27faab58ad05d4d6c369ef +Provides: bundled(wasi-libc) = d03829489904d38c624f6de9983190f1e5e7c9c5 ExclusiveArch: %{zig_arches} @@ -152,16 +154,16 @@ rm -f stage1/zig1.wasm %build # zig doesn't know how to dynamically link llvm on its own so we need cmake to generate a header ahead of time -# if we provice the header we need to also build zigcpp +# if we provide the header we need to also build zigcpp # C_FLAGS: wasm2c output generates a lot of noise with -Wunused. -# EXTRA_BUILD_ARGS: apply --build-id=sha1 even if running unpatched stage2 compiler. +# EXTRA_BUILD_ARGS: explicitly specify a build-id %cmake \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ \ - -DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;-Dbuild-id=sha1" \ + -DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;--build-id=sha1" \ -DZIG_SHARED_LLVM:BOOL=true \ -DZIG_PIE:BOOL=true \ \ @@ -178,7 +180,7 @@ zig build %{zig_build_options} # Zig has no official manpage # https://github.com/ziglang/zig/issues/715 -help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=%{name}.1 +help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=zig.1 %endif @@ -195,9 +197,10 @@ help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=vers %cmake_install %else DESTDIR="%{buildroot}" zig build install %{zig_install_options} + +install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ zig.1 %endif -install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ %{name}.1 %if %{with macro} install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} @@ -232,6 +235,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Thu Mar 06 2025 Jan200101 - 0.14.0-1 +- Update to 0.14.0 + * Mon Jan 27 2025 Jan200101 - 0.13.0-8 - specify to build against local zig stdlib directory to ensure we are building against the newest stdlib - use release fast instead of release safe to fix aarch64 builds from running out of memory From c7d17d37d7e1ce73548e84714d398759ee827dc3 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 21 Apr 2025 21:14:52 +0200 Subject: [PATCH 35/59] upload new sources --- sources | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index f69b37f..310b440 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.13.0.tar.xz) = 6f5f31f4ba71a11d8b16c7a5a613e124095e503fa6b02d2b77e5b177674c739287e81d98d96dc261fed24bc836caf196f71c3fcc7a6518387df86ba9e03df4dd -SHA512 (zig-0.13.0.tar.xz.minisig) = 21c6139c06cba6c5e23a3305fed0c0f1b9b32d9140bd686c26365ce0279d5f53cd081894eaba29f0c1ed51b2e831edf7bd4ae6a7eaee5018a252e312e9b65507 +SHA512 (zig-0.14.0.tar.xz) = 046462526ec16d56e8dcead8f8b680e99101090766c443f512f308c25860e8416f6fb2be15d4a387baa94f63a6fea6255374874c1ccf19144facbc02226a503b +SHA512 (zig-0.14.0.tar.xz.minisig) = a5d0946f136b2a28efbfde77f6052cd8745147df64bb70ed30d1d79bad27a52af451631750d592134e1933763ebe5e24215459481864bec0a969c1730527dc2c From 0c6022a5636a82cf7a2f015c8130e51fd68e01fa Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 21 Apr 2025 21:30:25 +0200 Subject: [PATCH 36/59] set fedora llvm compat version to 42 this flew past me --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 8e14685..8d9f513 100644 --- a/zig.spec +++ b/zig.spec @@ -4,7 +4,7 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 44 || 0%{?rhel} >= 9 +%if 0%{?fedora} >= 42 || 0%{?rhel} >= 9 %define llvm_compat 19 %endif From 21b8f7dff6b9b6a4b3a2803f454f14a4a29c30bf Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 21 Apr 2025 23:40:41 +0200 Subject: [PATCH 37/59] add patch to bump memory limits this should fix an issue not previously observed with aarch64 builds --- ...ve-native-lib-directories-from-rpath.patch | 7 +++-- 0002-std.Build-add-build-id-option.patch | 7 +++-- ...-bounds-of-main-zig-executable-to-9G.patch | 28 +++++++++++++++++++ zig.spec | 7 ++++- 4 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index a999ded..971c4d3 100644 --- a/0001-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 874ce2357bb7e7398115fc6f37f3f3817a9116ba Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 13:35:37 +0200 -Subject: [PATCH] remove native lib directories from rpath +Subject: [PATCH 1/3] remove native lib directories from rpath Signed-off-by: Jan200101 --- @@ -28,3 +28,6 @@ index 1075993846..dd9ab8febd 100644 } if (create_module.libc_paths_file) |paths_file| { +-- +2.49.0 + diff --git a/0002-std.Build-add-build-id-option.patch b/0002-std.Build-add-build-id-option.patch index 8aaa560..ba806f0 100644 --- a/0002-std.Build-add-build-id-option.patch +++ b/0002-std.Build-add-build-id-option.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From fd127fafb534eade533655688c4977ae4f7cebe0 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 17 Jan 2025 20:53:30 +0100 -Subject: [PATCH] std.Build: add build-id option +Subject: [PATCH 2/3] std.Build: add build-id option Signed-off-by: Jan200101 --- @@ -85,3 +85,6 @@ index 616e8f76b4..f70410f612 100644 try zig_args.append(switch (build_id) { .hexstring => |hs| b.fmt("--build-id=0x{s}", .{ std.fmt.fmtSliceHexLower(hs.toSlice()), +-- +2.49.0 + 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 new file mode 100644 index 0000000..81dfe00 --- /dev/null +++ b/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch @@ -0,0 +1,28 @@ +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 + +On Fedora 42 aarch64 memory usage peaked at 8736403456 bytes + +Signed-off-by: Jan200101 +--- + build.zig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build.zig b/build.zig +index c7dec601b4..bc08eed298 100644 +--- a/build.zig ++++ b/build.zig +@@ -704,7 +704,7 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St + + const exe = b.addExecutable(.{ + .name = "zig", +- .max_rss = 7_800_000_000, ++ .max_rss = 9_000_000_000, + .root_module = compiler_mod, + }); + exe.stack_size = stack_size; +-- +2.49.0 + diff --git a/zig.spec b/zig.spec index 8d9f513..76002ec 100644 --- a/zig.spec +++ b/zig.spec @@ -62,7 +62,12 @@ Patch: 0001-remove-native-lib-directories-from-rpath.patch # any trouble because of packaging demands # https://github.com/ziglang/zig/pull/22516 Patch: 0002-std.Build-add-build-id-option.patch - +# Zig has a feature that allows the developer to specify max memory usage +# during compilation, this allows the compiler to split up tasks efficiently- +# Annoyingly if any singular step goes above this it will fail after completion +# 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.patc BuildRequires: gcc BuildRequires: gcc-c++ From f60ca2269eaff5c69539e42041f227063d3743f5 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 22 Apr 2025 00:01:00 +0200 Subject: [PATCH 38/59] fix patch name --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 76002ec..bd2708a 100644 --- a/zig.spec +++ b/zig.spec @@ -67,7 +67,7 @@ Patch: 0002-std.Build-add-build-id-option.patch # Annoyingly if any singular step goes above this it will fail after completion # 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.patc +Patch: 0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch BuildRequires: gcc BuildRequires: gcc-c++ From 0ec1977ad7b71a299596487779ff11ca00a70212 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 22 Apr 2025 09:26:41 +0200 Subject: [PATCH 39/59] add default build-id to macro, correctly handle undefined macro thanks alebastr for pointing this out, unsure why I hadn't run into this myself --- macros.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.zig b/macros.zig index 005a86d..0ab227e 100644 --- a/macros.zig +++ b/macros.zig @@ -25,14 +25,14 @@ %_zig_release_mode safe # seperated build options -%_zig_general_options --verbose --release=%{_zig_release_mode} --summary all +%_zig_general_options --verbose --release=%{_zig_release_mode} --build-id=sha1 --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} %_zig_system_integration --system "%{_zig_package_dir}" %_zig_advanced_options --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options} -%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} %{zig_fetch_options} +%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} %{?zig_fetch_options} %_zig_test_options %{?zig_test_options} From e2e82e488a224e38af223939b433828ca897c409 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 22 Apr 2025 10:01:52 +0200 Subject: [PATCH 40/59] reuse same build options when building docs --- zig.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zig.spec b/zig.spec index bd2708a..d5ff34e 100644 --- a/zig.spec +++ b/zig.spec @@ -191,10 +191,7 @@ help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=vers %if %{with docs} # Use the newly made stage 3 compiler to generate docs -./zig-out/bin/zig build docs \ - --verbose \ - --global-cache-dir "%{zig_cache_dir}" \ - -Dversion-string="%{version}" +./zig-out/bin/zig build docs %{zig_build_options} %endif %install From 9dbb6c1d28c7f56587b59e3676baf8e201f540ea Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 22 Apr 2025 10:32:26 +0200 Subject: [PATCH 41/59] disable docs docs fail to generate because the build runner is unable to find the zig lib directory, despite it being present. it will be skipped for the initial build and included again once its figured out --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index d5ff34e..85a2f22 100644 --- a/zig.spec +++ b/zig.spec @@ -11,7 +11,7 @@ %global llvm_version 19.0.0 %bcond bootstrap 0 -%bcond docs %{without bootstrap} +%bcond docs 0 %bcond macro %{without bootstrap} %bcond test 1 From 098a032507fc49dd50cffb41b821139ac88b3e52 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Thu, 24 Apr 2025 18:31:29 +0200 Subject: [PATCH 42/59] 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 From 3f9c4abd5e3cd8c366866dad4f5c1bb30eae1752 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 10 May 2025 01:36:39 +0200 Subject: [PATCH 43/59] add gcc to runtime dependencies zig invokes the C compiler to figure out system info like where system --- zig.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 4333762..f56d714 100644 --- a/zig.spec +++ b/zig.spec @@ -44,7 +44,7 @@ Name: zig Version: 0.14.0 -Release: 2%{?dist} +Release: 3%{?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 @@ -74,6 +74,8 @@ Patch: 0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch # https://github.com/ziglang/zig/pull/23644 Patch: 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch +# Zig invokes the C compiler to figure out system info +Requires: gcc BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake @@ -242,6 +244,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Fri May 09 2025 Jan200101 - 0.14.0-3 +- add gcc to runtime dependencies + * Thu Apr 24 2025 Jan200101 - 0.14.0-2 - fix and re-enable documentation From 5466b3ff26a3fb918bf143febf2233a19c8d6c76 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 27 May 2025 16:16:32 +0200 Subject: [PATCH 44/59] add patch to add library directories --- ...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 | 2 +- ...t-directory-of-libraries-to-linker-p.patch | 40 +++++++++++++++++++ zig.spec | 15 +++++-- 6 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index a026bfc..ae39355 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/4] remove native lib directories from rpath +Subject: [PATCH 1/5] 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 4cef24a..3541011 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/4] std.Build: add build-id option +Subject: [PATCH 2/5] 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 b23c4f3..207cc73 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/4] increase upper bounds of main zig executable to 9G +Subject: [PATCH 3/5] 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 index c5f1c72..f91eb91 100644 --- 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 @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 4/5] build: pass zig lib dir as directory instead of as string Signed-off-by: Jan200101 --- diff --git a/0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch b/0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch new file mode 100644 index 0000000..4bfc87d --- /dev/null +++ b/0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch @@ -0,0 +1,40 @@ +From 48aa23307d1a47b444854fc09478da6d4ee8e624 Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Sun, 11 May 2025 01:09:41 +0200 +Subject: [PATCH 5/5] link.Elf: add root directory of libraries to linker path + +all the given dynamic shared objects will be linked with an absolute path however they may link to other dynamic shared objects which won't have an absolute path, for this we need to add the library path so that lld can resolve it + +Signed-off-by: Jan200101 +--- + src/link/Elf.zig | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/link/Elf.zig b/src/link/Elf.zig +index 53f88101b1..fe2b7abd48 100644 +--- a/src/link/Elf.zig ++++ b/src/link/Elf.zig +@@ -1938,9 +1938,19 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s + // Positional arguments to the linker such as object files. + var whole_archive = false; + ++ var lib_directories = std.StringArrayHashMap(void).init(gpa); ++ defer lib_directories.deinit(); ++ + for (self.base.comp.link_inputs) |link_input| switch (link_input) { + .res => unreachable, // Windows-only +- .dso => continue, ++ .dso => |dso| { ++ if (dso.path.root_dir.path) |root_dir| { ++ const lib_dir = try lib_directories.getOrPut(root_dir); ++ if (lib_dir.found_existing) continue; ++ try argv.append("-L"); ++ try argv.append(root_dir); ++ } ++ }, + .object, .archive => |obj| { + if (obj.must_link and !whole_archive) { + try argv.append("-whole-archive"); +-- +2.49.0 + diff --git a/zig.spec b/zig.spec index f56d714..e1afe52 100644 --- a/zig.spec +++ b/zig.spec @@ -44,7 +44,7 @@ Name: zig Version: 0.14.0 -Release: 3%{?dist} +Release: 4%{?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 @@ -71,11 +71,17 @@ 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 +# This patch was superseded by https://github.com/ziglang/zig/pull/23894 which +# implements a proper fix, but for our use case this is good enough. # https://github.com/ziglang/zig/pull/23644 Patch: 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch +# lld will try to resolve every libary of a shared object thats used for this we need +# add specify the library directories, this patch adds them back. +# This wasn't an issue with the cc binary present because zig will call it to figure +# out more system paths. +# https://github.com/ziglang/zig/pull/23850 +Patch: 0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch -# Zig invokes the C compiler to figure out system info -Requires: gcc BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake @@ -244,6 +250,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Tue May 27 2025 Jan200101 - 0.14.0-4 +- add patch to add library directories + * Fri May 09 2025 Jan200101 - 0.14.0-3 - add gcc to runtime dependencies From a298b2a8fbb7bc891b90e974a8f7da77e66421b6 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 9 Jun 2025 18:31:46 +0200 Subject: [PATCH 45/59] Update to 0.14.1 --- ...ve-native-lib-directories-from-rpath.patch | 8 ++-- 0002-std.Build-add-build-id-option.patch | 14 +++--- ...-bounds-of-main-zig-executable-to-9G.patch | 28 ----------- ...-errors-for-exceeding-max_rss-to-war.patch | 46 +++++++++++++++++++ ...ib-dir-as-directory-instead-of-as-st.patch | 33 ------------- ...t-directory-of-libraries-to-linker-p.patch | 8 ++-- sources | 4 +- zig.spec | 30 ++++++------ 8 files changed, 76 insertions(+), 95 deletions(-) delete mode 100644 0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch create mode 100644 0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch delete mode 100644 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch rename 0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch => 0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch (86%) diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index ae39355..b429dfc 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 a80398bc4c83c9f2c7249e6237df2d8ef90ec322 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 13:35:37 +0200 -Subject: [PATCH 1/5] remove native lib directories from rpath +Subject: [PATCH 1/4] remove native lib directories from rpath Signed-off-by: Jan200101 --- @@ -9,10 +9,10 @@ Signed-off-by: Jan200101 1 file changed, 9 insertions(+) diff --git a/src/main.zig b/src/main.zig -index 1075993846..dd9ab8febd 100644 +index 911e1dc1af..228c1b73ae 100644 --- a/src/main.zig +++ b/src/main.zig -@@ -4033,6 +4033,15 @@ fn createModule( +@@ -4048,6 +4048,15 @@ fn createModule( try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len); for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(&create_module.lib_directories, path, true); diff --git a/0002-std.Build-add-build-id-option.patch b/0002-std.Build-add-build-id-option.patch index 3541011..c57d37d 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 80955809c64d3e83a475f26ca9d17ea2e2fb6da7 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 17 Jan 2025 20:53:30 +0100 -Subject: [PATCH 2/5] std.Build: add build-id option +Subject: [PATCH 2/4] std.Build: add build-id option Signed-off-by: Jan200101 --- @@ -12,7 +12,7 @@ Signed-off-by: Jan200101 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig -index 2d196041b3..c7dec601b4 100644 +index 8967906d7b..7aedcdaa93 100644 --- a/build.zig +++ b/build.zig @@ -197,12 +197,6 @@ pub fn build(b: *std.Build) !void { @@ -29,7 +29,7 @@ index 2d196041b3..c7dec601b4 100644 b.getInstallStep().dependOn(&exe.step); } else { diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig -index 8702acb329..81393610be 100644 +index b649c0103b..6b6b14f0e9 100644 --- a/lib/compiler/build_runner.zig +++ b/lib/compiler/build_runner.zig @@ -202,6 +202,15 @@ pub fn main() !void { @@ -48,7 +48,7 @@ index 8702acb329..81393610be 100644 } else if (mem.eql(u8, arg, "--debounce")) { const next_arg = nextArg(args, &arg_idx) orelse fatalWithHint("expected u16 after '{s}'", .{arg}); -@@ -1364,6 +1373,10 @@ fn usage(b: *std.Build, out_stream: anytype) !void { +@@ -1360,6 +1369,10 @@ fn usage(b: *std.Build, out_stream: anytype) !void { \\ --zig-lib-dir [arg] Override path to Zig lib directory \\ --build-runner [file] Override path to build runner \\ --seed [integer] For shuffling dependency traversal order (default: random) @@ -73,10 +73,10 @@ index 4afdcd2bff..d31d9f3ee0 100644 off, any, diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig -index 616e8f76b4..f70410f612 100644 +index c401a840ba..ae2faf24ba 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig -@@ -1681,7 +1681,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { +@@ -1685,7 +1685,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { try addFlag(&zig_args, "each-lib-rpath", compile.each_lib_rpath); 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 deleted file mode 100644 index 207cc73..0000000 --- a/0003-increase-upper-bounds-of-main-zig-executable-to-9G.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e4b31d2e6cba763f4427bc689c7aa27978d47f49 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Mon, 21 Apr 2025 23:28:27 +0200 -Subject: [PATCH 3/5] increase upper bounds of main zig executable to 9G - -On Fedora 42 aarch64 memory usage peaked at 8736403456 bytes - -Signed-off-by: Jan200101 ---- - build.zig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build.zig b/build.zig -index c7dec601b4..bc08eed298 100644 ---- a/build.zig -+++ b/build.zig -@@ -704,7 +704,7 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St - - const exe = b.addExecutable(.{ - .name = "zig", -- .max_rss = 7_800_000_000, -+ .max_rss = 9_000_000_000, - .root_module = compiler_mod, - }); - exe.stack_size = stack_size; --- -2.49.0 - diff --git a/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch b/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch new file mode 100644 index 0000000..aa1d762 --- /dev/null +++ b/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch @@ -0,0 +1,46 @@ +From e8398fa0049f4152c5de157f495bd2955a246113 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= +Date: Mon, 2 Jun 2025 20:55:01 +0200 +Subject: [PATCH 3/4] std.Build: Demote errors for exceeding max_rss to + warnings. + +We have no control over memory usage on arbitrary systems in the wild. But we +would still like to get the warnings so we can adjust the values based on +observations in the official ZSF CI. + +Closes #23254. +Closes #23638. + +Signed-off-by: Jan200101 +--- + lib/compiler/build_runner.zig | 1 - + lib/std/Build/Step.zig | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig +index 6b6b14f0e9..8eb5c87cd3 100644 +--- a/lib/compiler/build_runner.zig ++++ b/lib/compiler/build_runner.zig +@@ -596,7 +596,6 @@ fn prepare( + if (run.max_rss_is_default) { + std.debug.print("note: use --maxrss to override the default", .{}); + } +- return uncleanExit(); + } + } + } +diff --git a/lib/std/Build/Step.zig b/lib/std/Build/Step.zig +index 125b3e7947..9cf0ca475e 100644 +--- a/lib/std/Build/Step.zig ++++ b/lib/std/Build/Step.zig +@@ -247,7 +247,6 @@ pub fn make(s: *Step, options: MakeOptions) error{ MakeFailed, MakeSkipped }!voi + s.result_peak_rss, s.max_rss, + }) catch @panic("OOM"); + s.result_error_msgs.append(arena, msg) catch @panic("OOM"); +- return error.MakeFailed; + } + } + +-- +2.49.0 + 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 deleted file mode 100644 index f91eb91..0000000 --- a/0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2f379308820b58049cfe0aaca1eb4f77700d0047 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Thu, 24 Apr 2025 17:35:29 +0200 -Subject: [PATCH 4/5] 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/0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch b/0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch similarity index 86% rename from 0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch rename to 0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch index 4bfc87d..91e1d98 100644 --- a/0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch +++ b/0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch @@ -1,7 +1,7 @@ -From 48aa23307d1a47b444854fc09478da6d4ee8e624 Mon Sep 17 00:00:00 2001 +From 10b03d510d753746435f0feb7a1ed6d6f8e2213a Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 11 May 2025 01:09:41 +0200 -Subject: [PATCH 5/5] link.Elf: add root directory of libraries to linker path +Subject: [PATCH 4/4] link.Elf: add root directory of libraries to linker path all the given dynamic shared objects will be linked with an absolute path however they may link to other dynamic shared objects which won't have an absolute path, for this we need to add the library path so that lld can resolve it @@ -11,10 +11,10 @@ Signed-off-by: Jan200101 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/link/Elf.zig b/src/link/Elf.zig -index 53f88101b1..fe2b7abd48 100644 +index 591786cfbc..98ed6fd919 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig -@@ -1938,9 +1938,19 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s +@@ -1932,9 +1932,19 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s // Positional arguments to the linker such as object files. var whole_archive = false; diff --git a/sources b/sources index 310b440..576a429 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.14.0.tar.xz) = 046462526ec16d56e8dcead8f8b680e99101090766c443f512f308c25860e8416f6fb2be15d4a387baa94f63a6fea6255374874c1ccf19144facbc02226a503b -SHA512 (zig-0.14.0.tar.xz.minisig) = a5d0946f136b2a28efbfde77f6052cd8745147df64bb70ed30d1d79bad27a52af451631750d592134e1933763ebe5e24215459481864bec0a969c1730527dc2c +SHA512 (zig-0.14.1.tar.xz) = b2b96f241216a46503af95a1175c967ac869391cc87fcb42db2c29d9d513e7ab19c4f4ced2c078481c36aea95f412f3162a8b319aa86b5e2462af567554e8216 +SHA512 (zig-0.14.1.tar.xz.minisig) = 27b2edc29e12396c5f57e6ef512aec10a31e59dc1ca7403769641b95782df47d975ae3bdc23d3becc52323067533b2e6dc4beaece95d1d5c382b1aec6dc8000f diff --git a/zig.spec b/zig.spec index e1afe52..52e39c0 100644 --- a/zig.spec +++ b/zig.spec @@ -43,8 +43,8 @@ } Name: zig -Version: 0.14.0 -Release: 4%{?dist} +Version: 0.14.1 +Release: 1%{?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 @@ -63,24 +63,17 @@ Patch: 0001-remove-native-lib-directories-from-rpath.patch # https://github.com/ziglang/zig/pull/22516 Patch: 0002-std.Build-add-build-id-option.patch # Zig has a feature that allows the developer to specify max memory usage -# during compilation, this allows the compiler to split up tasks efficiently- +# during compilation, this allows the compiler to split up tasks efficiently. # Annoyingly if any singular step goes above this it will fail after completion -# 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 -# This patch was superseded by https://github.com/ziglang/zig/pull/23894 which -# implements a proper fix, but for our use case this is good enough. -# https://github.com/ziglang/zig/pull/23644 -Patch: 0004-build-pass-zig-lib-dir-as-directory-instead-of-as-st.patch -# lld will try to resolve every libary of a shared object thats used for this we need -# add specify the library directories, this patch adds them back. +# this patch has been merged upstream and turns the error into a warning +# https://github.com/ziglang/zig/pull/23894 +Patch: 0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch +# lld will try to resolve every dependency of a shared object that is used directly +# but by default zig won't add any library directories, this patch adds them back. # This wasn't an issue with the cc binary present because zig will call it to figure # out more system paths. # https://github.com/ziglang/zig/pull/23850 -Patch: 0005-link.Elf-add-root-directory-of-libraries-to-linker-p.patch +Patch: 0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -96,7 +89,7 @@ BuildRequires: help2man BuildRequires: minisign %if %{without bootstrap} -BuildRequires: %{name} = %{version} +BuildRequires: (zig >= 0.14 with zig < 0.15) %endif %if %{with test} @@ -250,6 +243,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Mon Jun 09 2025 Jan200101 - 0.14.1-1 +- Update to 0.14.1 + * Tue May 27 2025 Jan200101 - 0.14.0-4 - add patch to add library directories From 638b1b872e01d28c6029442c121a1043f92b6bd4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:18:12 +0000 Subject: [PATCH 46/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 52e39c0..0882808 100644 --- a/zig.spec +++ b/zig.spec @@ -44,7 +44,7 @@ Name: zig Version: 0.14.1 -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 @@ -243,6 +243,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 0.14.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jun 09 2025 Jan200101 - 0.14.1-1 - Update to 0.14.1 From 55a3e42937dc7779a34b91c52d284fb401597f4c Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 12 Oct 2025 10:34:29 +0200 Subject: [PATCH 47/59] Update to 0.15.2 --- ...ve-native-lib-directories-from-rpath.patch | 10 +-- 0002-std.Build-add-build-id-option.patch | 90 ------------------- ...-errors-for-exceeding-max_rss-to-war.patch | 46 ---------- ...t-directory-of-libraries-to-linker-p.patch | 40 --------- macros.zig | 2 +- sources | 4 +- zig.spec | 39 +++----- 7 files changed, 22 insertions(+), 209 deletions(-) delete mode 100644 0002-std.Build-add-build-id-option.patch delete mode 100644 0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch delete mode 100644 0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index b429dfc..2691ac6 100644 --- a/0001-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -1,7 +1,7 @@ -From a80398bc4c83c9f2c7249e6237df2d8ef90ec322 Mon Sep 17 00:00:00 2001 +From 776181c3f8b3d3e34758f376979eb11acd3317e6 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 13:35:37 +0200 -Subject: [PATCH 1/4] remove native lib directories from rpath +Subject: [PATCH] remove native lib directories from rpath Signed-off-by: Jan200101 --- @@ -9,10 +9,10 @@ Signed-off-by: Jan200101 1 file changed, 9 insertions(+) diff --git a/src/main.zig b/src/main.zig -index 911e1dc1af..228c1b73ae 100644 +index 036adbf852..8410c05576 100644 --- a/src/main.zig +++ b/src/main.zig -@@ -4048,6 +4048,15 @@ fn createModule( +@@ -3945,6 +3945,15 @@ fn createModule( try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len); for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(&create_module.lib_directories, path, true); @@ -29,5 +29,5 @@ index 911e1dc1af..228c1b73ae 100644 if (create_module.libc_paths_file) |paths_file| { -- -2.49.0 +2.51.0 diff --git a/0002-std.Build-add-build-id-option.patch b/0002-std.Build-add-build-id-option.patch deleted file mode 100644 index c57d37d..0000000 --- a/0002-std.Build-add-build-id-option.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 80955809c64d3e83a475f26ca9d17ea2e2fb6da7 Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Fri, 17 Jan 2025 20:53:30 +0100 -Subject: [PATCH 2/4] std.Build: add build-id option - -Signed-off-by: Jan200101 ---- - build.zig | 6 ------ - lib/compiler/build_runner.zig | 13 +++++++++++++ - lib/std/Build.zig | 2 ++ - lib/std/Build/Step/Compile.zig | 2 +- - 4 files changed, 16 insertions(+), 7 deletions(-) - -diff --git a/build.zig b/build.zig -index 8967906d7b..7aedcdaa93 100644 ---- a/build.zig -+++ b/build.zig -@@ -197,12 +197,6 @@ pub fn build(b: *std.Build) !void { - exe.pie = pie; - exe.entitlements = entitlements; - -- exe.build_id = b.option( -- std.zig.BuildId, -- "build-id", -- "Request creation of '.note.gnu.build-id' section", -- ); -- - if (no_bin) { - b.getInstallStep().dependOn(&exe.step); - } else { -diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig -index b649c0103b..6b6b14f0e9 100644 ---- a/lib/compiler/build_runner.zig -+++ b/lib/compiler/build_runner.zig -@@ -202,6 +202,15 @@ pub fn main() !void { - next_arg, @errorName(err), - }); - }; -+ } else if (mem.eql(u8, arg, "--build-id")) { -+ builder.build_id = .fast; -+ } else if (mem.startsWith(u8, arg, "--build-id=")) { -+ const style = arg["--build-id=".len..]; -+ builder.build_id = std.zig.BuildId.parse(style) catch |err| { -+ fatal("unable to parse --build-id style '{s}': {s}", .{ -+ style, @errorName(err), -+ }); -+ }; - } else if (mem.eql(u8, arg, "--debounce")) { - const next_arg = nextArg(args, &arg_idx) orelse - fatalWithHint("expected u16 after '{s}'", .{arg}); -@@ -1360,6 +1369,10 @@ fn usage(b: *std.Build, out_stream: anytype) !void { - \\ --zig-lib-dir [arg] Override path to Zig lib directory - \\ --build-runner [file] Override path to build runner - \\ --seed [integer] For shuffling dependency traversal order (default: random) -+ \\ --build-id[=style] At a minor link-time expense, coordinates stripped binaries -+ \\ fast, uuid, sha1, md5 with debug symbols via a '.note.gnu.build-id' section -+ \\ 0x[hexstring] Maximum 32 bytes -+ \\ none (default) Disable build-id - \\ --debug-log [scope] Enable debugging the compiler - \\ --debug-pkg-config Fail if unknown pkg-config flags encountered - \\ --debug-rt Debug compiler runtime libraries -diff --git a/lib/std/Build.zig b/lib/std/Build.zig -index 4afdcd2bff..d31d9f3ee0 100644 ---- a/lib/std/Build.zig -+++ b/lib/std/Build.zig -@@ -94,6 +94,8 @@ available_deps: AvailableDeps, - - release_mode: ReleaseMode, - -+build_id: ?std.zig.BuildId = null, -+ - pub const ReleaseMode = enum { - off, - any, -diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig -index c401a840ba..ae2faf24ba 100644 ---- a/lib/std/Build/Step/Compile.zig -+++ b/lib/std/Build/Step/Compile.zig -@@ -1685,7 +1685,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { - - try addFlag(&zig_args, "each-lib-rpath", compile.each_lib_rpath); - -- if (compile.build_id) |build_id| { -+ if (compile.build_id orelse b.build_id) |build_id| { - try zig_args.append(switch (build_id) { - .hexstring => |hs| b.fmt("--build-id=0x{s}", .{ - std.fmt.fmtSliceHexLower(hs.toSlice()), --- -2.49.0 - diff --git a/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch b/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch deleted file mode 100644 index aa1d762..0000000 --- a/0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e8398fa0049f4152c5de157f495bd2955a246113 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= -Date: Mon, 2 Jun 2025 20:55:01 +0200 -Subject: [PATCH 3/4] std.Build: Demote errors for exceeding max_rss to - warnings. - -We have no control over memory usage on arbitrary systems in the wild. But we -would still like to get the warnings so we can adjust the values based on -observations in the official ZSF CI. - -Closes #23254. -Closes #23638. - -Signed-off-by: Jan200101 ---- - lib/compiler/build_runner.zig | 1 - - lib/std/Build/Step.zig | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig -index 6b6b14f0e9..8eb5c87cd3 100644 ---- a/lib/compiler/build_runner.zig -+++ b/lib/compiler/build_runner.zig -@@ -596,7 +596,6 @@ fn prepare( - if (run.max_rss_is_default) { - std.debug.print("note: use --maxrss to override the default", .{}); - } -- return uncleanExit(); - } - } - } -diff --git a/lib/std/Build/Step.zig b/lib/std/Build/Step.zig -index 125b3e7947..9cf0ca475e 100644 ---- a/lib/std/Build/Step.zig -+++ b/lib/std/Build/Step.zig -@@ -247,7 +247,6 @@ pub fn make(s: *Step, options: MakeOptions) error{ MakeFailed, MakeSkipped }!voi - s.result_peak_rss, s.max_rss, - }) catch @panic("OOM"); - s.result_error_msgs.append(arena, msg) catch @panic("OOM"); -- return error.MakeFailed; - } - } - --- -2.49.0 - diff --git a/0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch b/0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch deleted file mode 100644 index 91e1d98..0000000 --- a/0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 10b03d510d753746435f0feb7a1ed6d6f8e2213a Mon Sep 17 00:00:00 2001 -From: Jan200101 -Date: Sun, 11 May 2025 01:09:41 +0200 -Subject: [PATCH 4/4] link.Elf: add root directory of libraries to linker path - -all the given dynamic shared objects will be linked with an absolute path however they may link to other dynamic shared objects which won't have an absolute path, for this we need to add the library path so that lld can resolve it - -Signed-off-by: Jan200101 ---- - src/link/Elf.zig | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/src/link/Elf.zig b/src/link/Elf.zig -index 591786cfbc..98ed6fd919 100644 ---- a/src/link/Elf.zig -+++ b/src/link/Elf.zig -@@ -1932,9 +1932,19 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s - // Positional arguments to the linker such as object files. - var whole_archive = false; - -+ var lib_directories = std.StringArrayHashMap(void).init(gpa); -+ defer lib_directories.deinit(); -+ - for (self.base.comp.link_inputs) |link_input| switch (link_input) { - .res => unreachable, // Windows-only -- .dso => continue, -+ .dso => |dso| { -+ if (dso.path.root_dir.path) |root_dir| { -+ const lib_dir = try lib_directories.getOrPut(root_dir); -+ if (lib_dir.found_existing) continue; -+ try argv.append("-L"); -+ try argv.append(root_dir); -+ } -+ }, - .object, .archive => |obj| { - if (obj.must_link and !whole_archive) { - try argv.append("-whole-archive"); --- -2.49.0 - diff --git a/macros.zig b/macros.zig index 0ab227e..3fc6792 100644 --- a/macros.zig +++ b/macros.zig @@ -28,7 +28,7 @@ %_zig_general_options --verbose --release=%{_zig_release_mode} --build-id=sha1 --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} %_zig_system_integration --system "%{_zig_package_dir}" -%_zig_advanced_options --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" +%_zig_advanced_options -fallow-so-scripts --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options} %_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options} diff --git a/sources b/sources index 576a429..b3ceab1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.14.1.tar.xz) = b2b96f241216a46503af95a1175c967ac869391cc87fcb42db2c29d9d513e7ab19c4f4ced2c078481c36aea95f412f3162a8b319aa86b5e2462af567554e8216 -SHA512 (zig-0.14.1.tar.xz.minisig) = 27b2edc29e12396c5f57e6ef512aec10a31e59dc1ca7403769641b95782df47d975ae3bdc23d3becc52323067533b2e6dc4beaece95d1d5c382b1aec6dc8000f +SHA512 (zig-0.15.2.tar.xz) = 56b0f2b14da8603bf86ab672fd1fe38c2b04d8d90512839104e85b0fbda94aaf07fecf76b238d7b17715f9fee24be46c1830a96a0b5993cff6adef91b83f3201 +SHA512 (zig-0.15.2.tar.xz.minisig) = d951c167561599a11ac1881c0c12d17be5d8ea3d214b96403acaa5b40f62a6bee48602dcbf963046897481525b801023fe419daca6d6811b495c44a242777a13 diff --git a/zig.spec b/zig.spec index 0882808..5af35f6 100644 --- a/zig.spec +++ b/zig.spec @@ -4,11 +4,11 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 42 || 0%{?rhel} >= 9 -%define llvm_compat 19 +%if 0%{?fedora} >= 43 || 0%{?rhel} >= 9 +%define llvm_compat 20 %endif -%global llvm_version 19.0.0 +%global llvm_version 20.0.0 %bcond bootstrap 0 %bcond docs %{without bootstrap} @@ -43,8 +43,8 @@ } Name: zig -Version: 0.14.1 -Release: 2%{?dist} +Version: 0.15.2 +Release: 1%{?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 @@ -56,24 +56,6 @@ Source2: macros.%{name} # this is unlikely to be upstreamed in its current state because upstream # wants to work around the shortcomings of NixOS Patch: 0001-remove-native-lib-directories-from-rpath.patch -# Adds a build option for setting the build-id -# some projects are not programmed to handle a build-id's -# by having it as a flag we can make sure no developer runs into -# any trouble because of packaging demands -# https://github.com/ziglang/zig/pull/22516 -Patch: 0002-std.Build-add-build-id-option.patch -# Zig has a feature that allows the developer to specify max memory usage -# during compilation, this allows the compiler to split up tasks efficiently. -# Annoyingly if any singular step goes above this it will fail after completion -# this patch has been merged upstream and turns the error into a warning -# https://github.com/ziglang/zig/pull/23894 -Patch: 0003-std.Build-Demote-errors-for-exceeding-max_rss-to-war.patch -# lld will try to resolve every dependency of a shared object that is used directly -# but by default zig won't add any library directories, this patch adds them back. -# This wasn't an issue with the cc binary present because zig will call it to figure -# out more system paths. -# https://github.com/ziglang/zig/pull/23850 -Patch: 0004-link.Elf-add-root-directory-of-libraries-to-linker-p.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -89,7 +71,7 @@ BuildRequires: help2man BuildRequires: minisign %if %{without bootstrap} -BuildRequires: (zig >= 0.14 with zig < 0.15) +BuildRequires: (zig >= 0.15 with zig < 0.16) %endif %if %{with test} @@ -164,6 +146,11 @@ rm -f stage1/zig1.wasm %build +# Fedora supports using ccache systemwide +# Zig generates a large C file for bootstrapping which does not +# behave well with ccache so we explicitly disable it. +export CCACHE_DISABLE=1 + # zig doesn't know how to dynamically link llvm on its own so we need cmake to generate a header ahead of time # if we provide the header we need to also build zigcpp @@ -243,6 +230,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sun Oct 12 2025 Jan200101 - 0.15.2-1 +- Update to 0.15.2 + * Fri Jul 25 2025 Fedora Release Engineering - 0.14.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild @@ -332,7 +322,6 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} * Sat Jan 22 2022 Fedora Release Engineering - 0.9.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - * Mon Dec 20 2021 Jan Drögehoff - 0.9.0-1 - Update to 0.9.0 From 28b9e0c24c298e69546f5cbbd19444ab7d078a2b Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 14 Dec 2025 13:34:27 +0100 Subject: [PATCH 48/59] verify filename in minisig signed comment this is an additional layer to protect against the wrong archive version being downloaded. --- zig.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zig.spec b/zig.spec index 5af35f6..7f7c4c9 100644 --- a/zig.spec +++ b/zig.spec @@ -5,7 +5,7 @@ # note here at which Fedora or EL release we need to use compat LLVM packages %if 0%{?fedora} >= 43 || 0%{?rhel} >= 9 -%define llvm_compat 20 +%global llvm_compat 20 %endif %global llvm_version 20.0.0 @@ -46,11 +46,13 @@ Name: zig Version: 0.15.2 Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software +# The minisign file references a specific archive name so we store for ease of use +%global archive_name %{name}-%{version}.tar.xz 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 URL: https://ziglang.org -Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz -Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig +Source0: %{url}/download/%{version}/%{archive_name} +Source1: %{url}/download/%{version}/%{archive_name}.minisig Source2: macros.%{name} # Remove native lib directories from rpath # this is unlikely to be upstreamed in its current state because upstream @@ -136,7 +138,7 @@ This package contains common RPM macros for %{name}. %endif %prep -/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} +/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep "file:%{archive_name}" %autosetup -p1 %if %{without bootstrap} From 0c4d9963b58046d6916c9dcf10a4d6d5f44b3063 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 15:56:00 +0100 Subject: [PATCH 49/59] force minisign check to be plaintext --- zig.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 7f7c4c9..815619c 100644 --- a/zig.spec +++ b/zig.spec @@ -138,7 +138,7 @@ This package contains common RPM macros for %{name}. %endif %prep -/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep "file:%{archive_name}" +/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" %autosetup -p1 %if %{without bootstrap} From 61f511df2191ffbdfcd209cae22ef5df0c0f74a7 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 15:26:23 +0100 Subject: [PATCH 50/59] add patch to strip out LLVM targets for EPEL support --- ...ve-native-lib-directories-from-rpath.patch | 4 +- ...ve-unsupported-LLVM-targets-for-EPEL.patch | 254 ++++++++++++++++++ zig.spec | 14 +- 3 files changed, 267 insertions(+), 5 deletions(-) create mode 100644 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index 2691ac6..68d498b 100644 --- a/0001-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -1,7 +1,7 @@ From 776181c3f8b3d3e34758f376979eb11acd3317e6 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 11 Jun 2024 13:35:37 +0200 -Subject: [PATCH] remove native lib directories from rpath +Subject: [PATCH 1/2] remove native lib directories from rpath Signed-off-by: Jan200101 --- @@ -29,5 +29,5 @@ index 036adbf852..8410c05576 100644 if (create_module.libc_paths_file) |paths_file| { -- -2.51.0 +2.52.0 diff --git a/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch b/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch new file mode 100644 index 0000000..1ce06be --- /dev/null +++ b/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch @@ -0,0 +1,254 @@ +From ab92fe5f0be7a49fa2c97957bebf6278a1b69aaf Mon Sep 17 00:00:00 2001 +From: Jan200101 +Date: Sun, 4 Jan 2026 12:41:39 +0100 +Subject: [PATCH 2/2] Remove unsupported LLVM targets for RHEL + +LLVM for RHEL is only build with a subset of targets +this blocks zig at the configuration stage. +This commit simply swaps them out with the one from +https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec + +Signed-off-by: Jan200101 +--- + cmake/Findllvm.cmake | 2 +- + src/codegen/llvm.zig | 97 ++++++++++---------------------------------- + src/target.zig | 43 +++++++++++--------- + 3 files changed, 45 insertions(+), 97 deletions(-) + +diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake +index 5ff5de869c..5430ef9d59 100644 +--- a/cmake/Findllvm.cmake ++++ b/cmake/Findllvm.cmake +@@ -83,7 +83,7 @@ if(ZIG_USE_LLVM_CONFIG) + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}") + +- set(ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;Mips;MSP430;NVPTX;PowerPC;RISCV;Sparc;SystemZ;VE;WebAssembly;X86;XCore") ++ set(ZIG_LLVM_REQUIRED_TARGETS "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly;RISCV") + + set(ZIG_LLVM_REQUIRED_TARGETS_ENABLED TRUE) + foreach(TARGET_NAME IN LISTS ZIG_LLVM_REQUIRED_TARGETS) +diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig +index bd2c7bd022..a98fbab47e 100644 +--- a/src/codegen/llvm.zig ++++ b/src/codegen/llvm.zig +@@ -13016,20 +13016,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + llvm.LLVMInitializeAMDGPUAsmPrinter(); + llvm.LLVMInitializeAMDGPUAsmParser(); + }, +- .thumb, .thumbeb, .arm, .armeb => { +- llvm.LLVMInitializeARMTarget(); +- llvm.LLVMInitializeARMTargetInfo(); +- llvm.LLVMInitializeARMTargetMC(); +- llvm.LLVMInitializeARMAsmPrinter(); +- llvm.LLVMInitializeARMAsmParser(); +- }, +- .avr => { +- llvm.LLVMInitializeAVRTarget(); +- llvm.LLVMInitializeAVRTargetInfo(); +- llvm.LLVMInitializeAVRTargetMC(); +- llvm.LLVMInitializeAVRAsmPrinter(); +- llvm.LLVMInitializeAVRAsmParser(); +- }, + .bpfel, .bpfeb => { + llvm.LLVMInitializeBPFTarget(); + llvm.LLVMInitializeBPFTargetInfo(); +@@ -13037,34 +13023,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + llvm.LLVMInitializeBPFAsmPrinter(); + llvm.LLVMInitializeBPFAsmParser(); + }, +- .hexagon => { +- llvm.LLVMInitializeHexagonTarget(); +- llvm.LLVMInitializeHexagonTargetInfo(); +- llvm.LLVMInitializeHexagonTargetMC(); +- llvm.LLVMInitializeHexagonAsmPrinter(); +- llvm.LLVMInitializeHexagonAsmParser(); +- }, +- .lanai => { +- llvm.LLVMInitializeLanaiTarget(); +- llvm.LLVMInitializeLanaiTargetInfo(); +- llvm.LLVMInitializeLanaiTargetMC(); +- llvm.LLVMInitializeLanaiAsmPrinter(); +- llvm.LLVMInitializeLanaiAsmParser(); +- }, +- .mips, .mipsel, .mips64, .mips64el => { +- llvm.LLVMInitializeMipsTarget(); +- llvm.LLVMInitializeMipsTargetInfo(); +- llvm.LLVMInitializeMipsTargetMC(); +- llvm.LLVMInitializeMipsAsmPrinter(); +- llvm.LLVMInitializeMipsAsmParser(); +- }, +- .msp430 => { +- llvm.LLVMInitializeMSP430Target(); +- llvm.LLVMInitializeMSP430TargetInfo(); +- llvm.LLVMInitializeMSP430TargetMC(); +- llvm.LLVMInitializeMSP430AsmPrinter(); +- llvm.LLVMInitializeMSP430AsmParser(); +- }, + .nvptx, .nvptx64 => { + llvm.LLVMInitializeNVPTXTarget(); + llvm.LLVMInitializeNVPTXTargetInfo(); +@@ -13086,13 +13044,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + llvm.LLVMInitializeRISCVAsmPrinter(); + llvm.LLVMInitializeRISCVAsmParser(); + }, +- .sparc, .sparc64 => { +- llvm.LLVMInitializeSparcTarget(); +- llvm.LLVMInitializeSparcTargetInfo(); +- llvm.LLVMInitializeSparcTargetMC(); +- llvm.LLVMInitializeSparcAsmPrinter(); +- llvm.LLVMInitializeSparcAsmParser(); +- }, + .s390x => { + llvm.LLVMInitializeSystemZTarget(); + llvm.LLVMInitializeSystemZTargetInfo(); +@@ -13123,13 +13074,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + llvm.LLVMInitializeXtensaAsmParser(); + } + }, +- .xcore => { +- llvm.LLVMInitializeXCoreTarget(); +- llvm.LLVMInitializeXCoreTargetInfo(); +- llvm.LLVMInitializeXCoreTargetMC(); +- llvm.LLVMInitializeXCoreAsmPrinter(); +- // There is no LLVMInitializeXCoreAsmParser function. +- }, + .m68k => { + if (build_options.llvm_has_m68k) { + llvm.LLVMInitializeM68kTarget(); +@@ -13148,13 +13092,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + llvm.LLVMInitializeCSKYAsmParser(); + } + }, +- .ve => { +- llvm.LLVMInitializeVETarget(); +- llvm.LLVMInitializeVETargetInfo(); +- llvm.LLVMInitializeVETargetMC(); +- llvm.LLVMInitializeVEAsmPrinter(); +- llvm.LLVMInitializeVEAsmParser(); +- }, + .arc => { + if (build_options.llvm_has_arc) { + llvm.LLVMInitializeARCTarget(); +@@ -13164,21 +13101,29 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + // There is no LLVMInitializeARCAsmParser function. + } + }, +- .loongarch32, .loongarch64 => { +- llvm.LLVMInitializeLoongArchTarget(); +- llvm.LLVMInitializeLoongArchTargetInfo(); +- llvm.LLVMInitializeLoongArchTargetMC(); +- llvm.LLVMInitializeLoongArchAsmPrinter(); +- llvm.LLVMInitializeLoongArchAsmParser(); +- }, ++ ++ // Disabled LLVM targets ++ .thumb, ++ .thumbeb, ++ .arm, ++ .armeb, ++ .avr, ++ .hexagon, ++ .lanai, ++ .mips, ++ .mipsel, ++ .mips64, ++ .mips64el, ++ .msp430, ++ .sparc, ++ .sparc64, ++ .xcore, ++ .ve, ++ .loongarch32, ++ .loongarch64, + .spirv32, + .spirv64, +- => { +- llvm.LLVMInitializeSPIRVTarget(); +- llvm.LLVMInitializeSPIRVTargetInfo(); +- llvm.LLVMInitializeSPIRVTargetMC(); +- llvm.LLVMInitializeSPIRVAsmPrinter(); +- }, ++ => unreachable, + + // LLVM does does not have a backend for these. + .kalimba, +diff --git a/src/target.zig b/src/target.zig +index f8201d691b..8491912bd5 100644 +--- a/src/target.zig ++++ b/src/target.zig +@@ -166,23 +166,12 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) + } + + return switch (target.cpu.arch) { +- .arm, +- .armeb, + .aarch64, + .aarch64_be, + .arc, +- .avr, + .bpfel, + .bpfeb, +- .hexagon, +- .loongarch32, +- .loongarch64, + .m68k, +- .mips, +- .mipsel, +- .mips64, +- .mips64el, +- .msp430, + .powerpc, + .powerpcle, + .powerpc64, +@@ -190,24 +179,38 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) + .amdgcn, + .riscv32, + .riscv64, +- .sparc, +- .sparc64, +- .spirv32, +- .spirv64, + .s390x, +- .thumb, +- .thumbeb, + .x86, + .x86_64, +- .xcore, + .nvptx, + .nvptx64, +- .lanai, + .wasm32, + .wasm64, +- .ve, + => true, + ++ // Disabled LLVM targets ++ .thumb, ++ .thumbeb, ++ .arm, ++ .armeb, ++ .avr, ++ .hexagon, ++ .lanai, ++ .mips, ++ .mipsel, ++ .mips64, ++ .mips64el, ++ .msp430, ++ .sparc, ++ .sparc64, ++ .xcore, ++ .ve, ++ .loongarch32, ++ .loongarch64, ++ .spirv32, ++ .spirv64, ++ => false, ++ + // LLVM backend exists but can produce neither assembly nor object files. + .csky, + .xtensa, +-- +2.52.0 + diff --git a/zig.spec b/zig.spec index 815619c..cd26f63 100644 --- a/zig.spec +++ b/zig.spec @@ -4,7 +4,7 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 43 || 0%{?rhel} >= 9 +%if 0%{?fedora} >= 43 || 0%{?rhel} >= 11 %global llvm_compat 20 %endif @@ -57,7 +57,10 @@ Source2: macros.%{name} # Remove native lib directories from rpath # this is unlikely to be upstreamed in its current state because upstream # wants to work around the shortcomings of NixOS -Patch: 0001-remove-native-lib-directories-from-rpath.patch +Patch0: 0001-remove-native-lib-directories-from-rpath.patch +# LLVM on RHEL/EPEL only provides fewer targets so we patch the required targets down +# Targets come from https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec +Patch1: 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -140,7 +143,12 @@ This package contains common RPM macros for %{name}. %prep /usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" -%autosetup -p1 +%autosetup -N +%patch 0 -p1 +%if 0%{?rhel} +%patch 1 -p1 +%endif + %if %{without bootstrap} # Ensure that the pre-build stage1 binary is not used rm -f stage1/zig1.wasm From 393d1df9485fa960e346845738ef3d90d16c07d0 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 15:54:15 +0100 Subject: [PATCH 51/59] limit architectures for EPEL Zig depends on a C compiler (gcc for EPEL/fedora) during bootstraping by transpiling itself to C then compiling that. The C code that is generated runs into edge cases with older gcc versions that triggers unique errors on more exotic hardware such as RISC or ARM changes to this need to be copied into zig-srpm-macros --- zig.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zig.spec b/zig.spec index cd26f63..2a566b7 100644 --- a/zig.spec +++ b/zig.spec @@ -1,5 +1,11 @@ +%if 0%{?rhel} +# Zig depends on a C compiler (gcc) during bootstraping +# older versions of gcc fail to compile the transpiled source so we limit it to x86_64 +%global zig_arches x86_64 +%else # https://ziglang.org/download/VERSION/release-notes.html#Support-Table %global zig_arches x86_64 aarch64 riscv64 %{mips64} +%endif # Signing key from https://ziglang.org/download/ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U From b9abbed4a8af4cc471ac2e6daeb36b5ee4f8510d Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 17:22:54 +0100 Subject: [PATCH 52/59] use relative cache dir, put cache into vpath for clean separation The zig cache dir used to be specified as an absolute path because of an issue with build processes for local subdependencies changing the current working directory incorrectly, this has since been fixed. Additionally %{builddir} is a new construct that is not available under EPEL, %{_builddir}/%{?buildsubdir} was considered however there is no need for an absolute path at this time. The generated objects should never match on different architectures due to how the cache system is designed however there this may cause confusion while debugging so its been put under %{_vpath_builddir}. Specifying a direct cache name would be possible however I think _vpath_builddir has become pretty well known to maintainers and would best be suited for this. --- macros.zig | 2 +- zig.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.zig b/macros.zig index 3fc6792..8f43673 100644 --- a/macros.zig +++ b/macros.zig @@ -2,7 +2,7 @@ %zig %{_bindir}/zig -%_zig_cache_dir %{builddir}/zig-cache +%_zig_cache_dir %{_vpath_builddir}/zig-cache %_zig_package_dir %{_zig_cache_dir}/p # expected features for each arch when targeting baseline diff --git a/zig.spec b/zig.spec index 2a566b7..378fb17 100644 --- a/zig.spec +++ b/zig.spec @@ -21,7 +21,7 @@ %bcond macro %{without bootstrap} %bcond test 1 -%global zig_cache_dir %{builddir}/zig-cache +%global zig_cache_dir %{_vpath_builddir}/zig-cache %global zig_build_options %{shrink: \ --verbose \ From 38f18f6459e4d0b40fdd5a1d49e6833576e370bf Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 17:56:04 +0100 Subject: [PATCH 53/59] Rebuilt for EPEL --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 378fb17..35a3366 100644 --- a/zig.spec +++ b/zig.spec @@ -50,7 +50,7 @@ Name: zig Version: 0.15.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software # The minisign file references a specific archive name so we store for ease of use %global archive_name %{name}-%{version}.tar.xz @@ -246,6 +246,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sun Jan 04 2026 Jan200101 - 0.15.2-2 +- Rebuilt for EPEL + * Sun Oct 12 2025 Jan200101 - 0.15.2-1 - Update to 0.15.2 From b5b6b37ec0d53a1704e681f7e6de6b90c631a2c8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:08:07 +0000 Subject: [PATCH 54/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index 35a3366..8bd9acb 100644 --- a/zig.spec +++ b/zig.spec @@ -50,7 +50,7 @@ Name: zig Version: 0.15.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software # The minisign file references a specific archive name so we store for ease of use %global archive_name %{name}-%{version}.tar.xz @@ -246,6 +246,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 0.15.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Sun Jan 04 2026 Jan200101 - 0.15.2-2 - Rebuilt for EPEL From 1ffefc4662fefa18cc95b427acff7d8c08de4553 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 25 Apr 2026 14:34:50 +0200 Subject: [PATCH 55/59] Update to 0.16.0 --- ...ve-native-lib-directories-from-rpath.patch | 12 +- ...ve-unsupported-LLVM-targets-for-EPEL.patch | 174 +++++++++--------- macros.zig | 12 +- sources | 4 +- zig.spec | 32 +++- 5 files changed, 128 insertions(+), 106 deletions(-) diff --git a/0001-remove-native-lib-directories-from-rpath.patch b/0001-remove-native-lib-directories-from-rpath.patch index 68d498b..24db582 100644 --- a/0001-remove-native-lib-directories-from-rpath.patch +++ b/0001-remove-native-lib-directories-from-rpath.patch @@ -1,6 +1,6 @@ -From 776181c3f8b3d3e34758f376979eb11acd3317e6 Mon Sep 17 00:00:00 2001 +From a865b3569ace118cc1c1cd8d5d130ec316b0307d Mon Sep 17 00:00:00 2001 From: Jan200101 -Date: Tue, 11 Jun 2024 13:35:37 +0200 +Date: Tue, 14 Apr 2026 19:04:40 +0200 Subject: [PATCH 1/2] remove native lib directories from rpath Signed-off-by: Jan200101 @@ -9,13 +9,13 @@ Signed-off-by: Jan200101 1 file changed, 9 insertions(+) diff --git a/src/main.zig b/src/main.zig -index 036adbf852..8410c05576 100644 +index 0395a21a5f..86b6d9f86b 100644 --- a/src/main.zig +++ b/src/main.zig -@@ -3945,6 +3945,15 @@ fn createModule( +@@ -4102,6 +4102,15 @@ fn createModule( try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len); - for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(&create_module.lib_directories, path, true); + for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(io, &create_module.lib_directories, path, true); + + for (paths.lib_dirs.items) |native_lib_dir| { + for (0.., create_module.rpath_list.items) |i, rpath_dir| { @@ -29,5 +29,5 @@ index 036adbf852..8410c05576 100644 if (create_module.libc_paths_file) |paths_file| { -- -2.52.0 +2.53.0 diff --git a/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch b/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch index 1ce06be..a8b942f 100644 --- a/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch +++ b/0002-Remove-unsupported-LLVM-targets-for-EPEL.patch @@ -1,6 +1,6 @@ -From ab92fe5f0be7a49fa2c97957bebf6278a1b69aaf Mon Sep 17 00:00:00 2001 +From 803935baf6a4730426afbb746adfd00c0ffc0f39 Mon Sep 17 00:00:00 2001 From: Jan200101 -Date: Sun, 4 Jan 2026 12:41:39 +0100 +Date: Tue, 14 Apr 2026 19:20:26 +0200 Subject: [PATCH 2/2] Remove unsupported LLVM targets for RHEL LLVM for RHEL is only build with a subset of targets @@ -16,130 +16,130 @@ Signed-off-by: Jan200101 3 files changed, 45 insertions(+), 97 deletions(-) diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake -index 5ff5de869c..5430ef9d59 100644 +index 0c08d4f0ac..ed4da12044 100644 --- a/cmake/Findllvm.cmake +++ b/cmake/Findllvm.cmake @@ -83,7 +83,7 @@ if(ZIG_USE_LLVM_CONFIG) OUTPUT_STRIP_TRAILING_WHITESPACE) string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}") -- set(ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;Mips;MSP430;NVPTX;PowerPC;RISCV;Sparc;SystemZ;VE;WebAssembly;X86;XCore") +- set(ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;Mips;MSP430;NVPTX;PowerPC;RISCV;SPIRV;Sparc;SystemZ;VE;WebAssembly;X86;XCore") + set(ZIG_LLVM_REQUIRED_TARGETS "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly;RISCV") set(ZIG_LLVM_REQUIRED_TARGETS_ENABLED TRUE) foreach(TARGET_NAME IN LISTS ZIG_LLVM_REQUIRED_TARGETS) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig -index bd2c7bd022..a98fbab47e 100644 +index 1ba3b272da..1ac1f6adc8 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig -@@ -13016,20 +13016,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { - llvm.LLVMInitializeAMDGPUAsmPrinter(); - llvm.LLVMInitializeAMDGPUAsmParser(); +@@ -4736,20 +4736,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeAMDGPUAsmPrinter(); + bindings.LLVMInitializeAMDGPUAsmParser(); }, - .thumb, .thumbeb, .arm, .armeb => { -- llvm.LLVMInitializeARMTarget(); -- llvm.LLVMInitializeARMTargetInfo(); -- llvm.LLVMInitializeARMTargetMC(); -- llvm.LLVMInitializeARMAsmPrinter(); -- llvm.LLVMInitializeARMAsmParser(); +- bindings.LLVMInitializeARMTarget(); +- bindings.LLVMInitializeARMTargetInfo(); +- bindings.LLVMInitializeARMTargetMC(); +- bindings.LLVMInitializeARMAsmPrinter(); +- bindings.LLVMInitializeARMAsmParser(); - }, - .avr => { -- llvm.LLVMInitializeAVRTarget(); -- llvm.LLVMInitializeAVRTargetInfo(); -- llvm.LLVMInitializeAVRTargetMC(); -- llvm.LLVMInitializeAVRAsmPrinter(); -- llvm.LLVMInitializeAVRAsmParser(); +- bindings.LLVMInitializeAVRTarget(); +- bindings.LLVMInitializeAVRTargetInfo(); +- bindings.LLVMInitializeAVRTargetMC(); +- bindings.LLVMInitializeAVRAsmPrinter(); +- bindings.LLVMInitializeAVRAsmParser(); - }, .bpfel, .bpfeb => { - llvm.LLVMInitializeBPFTarget(); - llvm.LLVMInitializeBPFTargetInfo(); -@@ -13037,34 +13023,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { - llvm.LLVMInitializeBPFAsmPrinter(); - llvm.LLVMInitializeBPFAsmParser(); + bindings.LLVMInitializeBPFTarget(); + bindings.LLVMInitializeBPFTargetInfo(); +@@ -4757,34 +4743,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeBPFAsmPrinter(); + bindings.LLVMInitializeBPFAsmParser(); }, - .hexagon => { -- llvm.LLVMInitializeHexagonTarget(); -- llvm.LLVMInitializeHexagonTargetInfo(); -- llvm.LLVMInitializeHexagonTargetMC(); -- llvm.LLVMInitializeHexagonAsmPrinter(); -- llvm.LLVMInitializeHexagonAsmParser(); +- bindings.LLVMInitializeHexagonTarget(); +- bindings.LLVMInitializeHexagonTargetInfo(); +- bindings.LLVMInitializeHexagonTargetMC(); +- bindings.LLVMInitializeHexagonAsmPrinter(); +- bindings.LLVMInitializeHexagonAsmParser(); - }, - .lanai => { -- llvm.LLVMInitializeLanaiTarget(); -- llvm.LLVMInitializeLanaiTargetInfo(); -- llvm.LLVMInitializeLanaiTargetMC(); -- llvm.LLVMInitializeLanaiAsmPrinter(); -- llvm.LLVMInitializeLanaiAsmParser(); +- bindings.LLVMInitializeLanaiTarget(); +- bindings.LLVMInitializeLanaiTargetInfo(); +- bindings.LLVMInitializeLanaiTargetMC(); +- bindings.LLVMInitializeLanaiAsmPrinter(); +- bindings.LLVMInitializeLanaiAsmParser(); - }, - .mips, .mipsel, .mips64, .mips64el => { -- llvm.LLVMInitializeMipsTarget(); -- llvm.LLVMInitializeMipsTargetInfo(); -- llvm.LLVMInitializeMipsTargetMC(); -- llvm.LLVMInitializeMipsAsmPrinter(); -- llvm.LLVMInitializeMipsAsmParser(); +- bindings.LLVMInitializeMipsTarget(); +- bindings.LLVMInitializeMipsTargetInfo(); +- bindings.LLVMInitializeMipsTargetMC(); +- bindings.LLVMInitializeMipsAsmPrinter(); +- bindings.LLVMInitializeMipsAsmParser(); - }, - .msp430 => { -- llvm.LLVMInitializeMSP430Target(); -- llvm.LLVMInitializeMSP430TargetInfo(); -- llvm.LLVMInitializeMSP430TargetMC(); -- llvm.LLVMInitializeMSP430AsmPrinter(); -- llvm.LLVMInitializeMSP430AsmParser(); +- bindings.LLVMInitializeMSP430Target(); +- bindings.LLVMInitializeMSP430TargetInfo(); +- bindings.LLVMInitializeMSP430TargetMC(); +- bindings.LLVMInitializeMSP430AsmPrinter(); +- bindings.LLVMInitializeMSP430AsmParser(); - }, .nvptx, .nvptx64 => { - llvm.LLVMInitializeNVPTXTarget(); - llvm.LLVMInitializeNVPTXTargetInfo(); -@@ -13086,13 +13044,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { - llvm.LLVMInitializeRISCVAsmPrinter(); - llvm.LLVMInitializeRISCVAsmParser(); + bindings.LLVMInitializeNVPTXTarget(); + bindings.LLVMInitializeNVPTXTargetInfo(); +@@ -4806,13 +4764,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeRISCVAsmPrinter(); + bindings.LLVMInitializeRISCVAsmParser(); }, - .sparc, .sparc64 => { -- llvm.LLVMInitializeSparcTarget(); -- llvm.LLVMInitializeSparcTargetInfo(); -- llvm.LLVMInitializeSparcTargetMC(); -- llvm.LLVMInitializeSparcAsmPrinter(); -- llvm.LLVMInitializeSparcAsmParser(); +- bindings.LLVMInitializeSparcTarget(); +- bindings.LLVMInitializeSparcTargetInfo(); +- bindings.LLVMInitializeSparcTargetMC(); +- bindings.LLVMInitializeSparcAsmPrinter(); +- bindings.LLVMInitializeSparcAsmParser(); - }, .s390x => { - llvm.LLVMInitializeSystemZTarget(); - llvm.LLVMInitializeSystemZTargetInfo(); -@@ -13123,13 +13074,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { - llvm.LLVMInitializeXtensaAsmParser(); + bindings.LLVMInitializeSystemZTarget(); + bindings.LLVMInitializeSystemZTargetInfo(); +@@ -4843,13 +4794,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeXtensaAsmParser(); } }, - .xcore => { -- llvm.LLVMInitializeXCoreTarget(); -- llvm.LLVMInitializeXCoreTargetInfo(); -- llvm.LLVMInitializeXCoreTargetMC(); -- llvm.LLVMInitializeXCoreAsmPrinter(); +- bindings.LLVMInitializeXCoreTarget(); +- bindings.LLVMInitializeXCoreTargetInfo(); +- bindings.LLVMInitializeXCoreTargetMC(); +- bindings.LLVMInitializeXCoreAsmPrinter(); - // There is no LLVMInitializeXCoreAsmParser function. - }, .m68k => { if (build_options.llvm_has_m68k) { - llvm.LLVMInitializeM68kTarget(); -@@ -13148,13 +13092,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { - llvm.LLVMInitializeCSKYAsmParser(); + bindings.LLVMInitializeM68kTarget(); +@@ -4868,13 +4812,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeCSKYAsmParser(); } }, - .ve => { -- llvm.LLVMInitializeVETarget(); -- llvm.LLVMInitializeVETargetInfo(); -- llvm.LLVMInitializeVETargetMC(); -- llvm.LLVMInitializeVEAsmPrinter(); -- llvm.LLVMInitializeVEAsmParser(); +- bindings.LLVMInitializeVETarget(); +- bindings.LLVMInitializeVETargetInfo(); +- bindings.LLVMInitializeVETargetMC(); +- bindings.LLVMInitializeVEAsmPrinter(); +- bindings.LLVMInitializeVEAsmParser(); - }, .arc => { if (build_options.llvm_has_arc) { - llvm.LLVMInitializeARCTarget(); -@@ -13164,21 +13101,29 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { + bindings.LLVMInitializeARCTarget(); +@@ -4884,21 +4821,29 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void { // There is no LLVMInitializeARCAsmParser function. } }, - .loongarch32, .loongarch64 => { -- llvm.LLVMInitializeLoongArchTarget(); -- llvm.LLVMInitializeLoongArchTargetInfo(); -- llvm.LLVMInitializeLoongArchTargetMC(); -- llvm.LLVMInitializeLoongArchAsmPrinter(); -- llvm.LLVMInitializeLoongArchAsmParser(); +- bindings.LLVMInitializeLoongArchTarget(); +- bindings.LLVMInitializeLoongArchTargetInfo(); +- bindings.LLVMInitializeLoongArchTargetMC(); +- bindings.LLVMInitializeLoongArchAsmPrinter(); +- bindings.LLVMInitializeLoongArchAsmParser(); - }, + + // Disabled LLVM targets @@ -164,20 +164,20 @@ index bd2c7bd022..a98fbab47e 100644 .spirv32, .spirv64, - => { -- llvm.LLVMInitializeSPIRVTarget(); -- llvm.LLVMInitializeSPIRVTargetInfo(); -- llvm.LLVMInitializeSPIRVTargetMC(); -- llvm.LLVMInitializeSPIRVAsmPrinter(); +- bindings.LLVMInitializeSPIRVTarget(); +- bindings.LLVMInitializeSPIRVTargetInfo(); +- bindings.LLVMInitializeSPIRVTargetMC(); +- bindings.LLVMInitializeSPIRVAsmPrinter(); - }, + => unreachable, // LLVM does does not have a backend for these. - .kalimba, + .alpha, diff --git a/src/target.zig b/src/target.zig -index f8201d691b..8491912bd5 100644 +index 3d04c06f5e..9e19836815 100644 --- a/src/target.zig +++ b/src/target.zig -@@ -166,23 +166,12 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) +@@ -185,23 +185,12 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) } return switch (target.cpu.arch) { @@ -201,10 +201,10 @@ index f8201d691b..8491912bd5 100644 .powerpc, .powerpcle, .powerpc64, -@@ -190,24 +179,38 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) - .amdgcn, - .riscv32, +@@ -211,24 +200,38 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) + .riscv32be, .riscv64, + .riscv64be, - .sparc, - .sparc64, - .spirv32, @@ -250,5 +250,5 @@ index f8201d691b..8491912bd5 100644 .csky, .xtensa, -- -2.52.0 +2.53.0 diff --git a/macros.zig b/macros.zig index 8f43673..990eddc 100644 --- a/macros.zig +++ b/macros.zig @@ -1,6 +1,6 @@ %zig_arches x86_64 aarch64 riscv64 %{mips64} -%zig %{_bindir}/zig +%__zig %{_bindir}/zig %_zig_cache_dir %{_vpath_builddir}/zig-cache %_zig_package_dir %{_zig_cache_dir}/p @@ -27,7 +27,10 @@ # seperated build options %_zig_general_options --verbose --release=%{_zig_release_mode} --build-id=sha1 --summary all %_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -%_zig_system_integration --system "%{_zig_package_dir}" +# 0.16.0 introduced packaging changes which install packages into this relative directory +# Will be ovewritable in 0.17.0 +# https://codeberg.org/ziglang/zig/pulls/31950 +%_zig_system_integration --system "zig-pkg" %_zig_advanced_options -fallow-so-scripts --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}" %_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options} @@ -40,10 +43,11 @@ mkdir -p \ %{_zig_cache_dir} \ %{_zig_package_dir} \ + "zig-pkg" \ } %zig_build %{shrink: \ - %zig \ + %__zig \ build \ %{?_zig_build_options} \ } @@ -56,7 +60,7 @@ } %zig_fetch %{shrink: \ - %zig \ + %__zig \ fetch \ %{?_zig_fetch_options} \ } diff --git a/sources b/sources index b3ceab1..d07a209 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zig-0.15.2.tar.xz) = 56b0f2b14da8603bf86ab672fd1fe38c2b04d8d90512839104e85b0fbda94aaf07fecf76b238d7b17715f9fee24be46c1830a96a0b5993cff6adef91b83f3201 -SHA512 (zig-0.15.2.tar.xz.minisig) = d951c167561599a11ac1881c0c12d17be5d8ea3d214b96403acaa5b40f62a6bee48602dcbf963046897481525b801023fe419daca6d6811b495c44a242777a13 +SHA512 (zig-0.16.0.tar.xz) = 1404a939c6f233d5f328a4833543d7a2b2d9f0f5081babe6e3ad43daed25bbb0844b28c01c900f64b5bb63ac62b5586457c05380b10494dfefb56f49b58d4a0a +SHA512 (zig-0.16.0.tar.xz.minisig) = 44a2d57061cbe8bd4e9ad587c247883e2e9abefa148ab375617665fe51500a106f488ceaaeaf038c0ff5ce1a70f4eb3b519a44f3211769ea1ebae5ad49b2f1b9 diff --git a/zig.spec b/zig.spec index 8bd9acb..ccb142a 100644 --- a/zig.spec +++ b/zig.spec @@ -10,17 +10,28 @@ %global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U # note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 43 || 0%{?rhel} >= 11 -%global llvm_compat 20 +%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11 +%global llvm_compat 21 %endif -%global llvm_version 20.0.0 +%global llvm_version 21.1.8 %bcond bootstrap 0 %bcond docs %{without bootstrap} %bcond macro %{without bootstrap} %bcond test 1 +# GCC < 16.0 miscompiles on RISC-V +%ifarch riscv64 +%if 0%{?fedora} < 44 +%bcond toolchain_clang 1 +%endif +%endif + +%if %{with toolchain_clang} +%global toolchain clang +%endif + %global zig_cache_dir %{_vpath_builddir}/zig-cache %global zig_build_options %{shrink: \ @@ -49,8 +60,8 @@ } Name: zig -Version: 0.15.2 -Release: 3%{?dist} +Version: 0.16.0 +Release: 1%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software # The minisign file references a specific archive name so we store for ease of use %global archive_name %{name}-%{version}.tar.xz @@ -68,8 +79,12 @@ Patch0: 0001-remove-native-lib-directories-from-rpath.patch # Targets come from https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec Patch1: 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch +%if %{without toolchain_clang} BuildRequires: gcc BuildRequires: gcc-c++ +%else +BuildRequires: clang +%endif BuildRequires: cmake BuildRequires: llvm%{?llvm_compat}-devel BuildRequires: clang%{?llvm_compat}-devel @@ -82,7 +97,7 @@ BuildRequires: help2man BuildRequires: minisign %if %{without bootstrap} -BuildRequires: (zig >= 0.15 with zig < 0.16) +BuildRequires: (zig >= 0.16 with zig < 0.17) %endif %if %{with test} @@ -98,7 +113,7 @@ Requires: %{name}-libs = %{version} # Apache-2.0 WITH LLVM-exception OR NCSA OR MIT Provides: bundled(compiler-rt) = %{llvm_version} # LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only -Provides: bundled(glibc) = 2.41 +Provides: bundled(glibc) = 2.43 # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA Provides: bundled(libcxx) = %{llvm_version} # Apache-2.0 WITH LLVM-exception OR MIT OR NCSA @@ -246,6 +261,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Wed Apr 15 2026 Jan200101 - 0.16.0-1 +- Update to 0.16.0 + * Sat Jan 17 2026 Fedora Release Engineering - 0.15.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 373fd58fba00a8bc01e887dc14988583ece6631a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:40:29 +0000 Subject: [PATCH 56/59] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- zig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zig.spec b/zig.spec index ccb142a..25373a5 100644 --- a/zig.spec +++ b/zig.spec @@ -61,7 +61,7 @@ Name: zig Version: 0.16.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Programming language for maintaining robust, optimal, and reusable software # The minisign file references a specific archive name so we store for ease of use %global archive_name %{name}-%{version}.tar.xz @@ -261,6 +261,9 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 0.16.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Wed Apr 15 2026 Jan200101 - 0.16.0-1 - Update to 0.16.0 From dc01a78c50f1e84069a3cac1f38fae2a3df3cfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nich=20Bon=20=C4=86iri=C4=87?= Date: Tue, 14 Jul 2026 23:53:27 -0600 Subject: [PATCH 57/59] refactor: migrate to rpmautospec and clean up spec headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrated zig.spec to utilize %autorelease and %autochangelog, removing the manual changelog section. Restructured and cleaned up the global variable and macro definitions using minimalist section headers. Replaced hardcoded /usr/bin/minisign with the guidelines-compliant %{_bindir}/minisign macro. Co-developed-by: Gemini AI Signed-off-by: Rénich Bon Ćirić --- zig.spec | 220 +++++++++++-------------------------------------------- 1 file changed, 42 insertions(+), 178 deletions(-) diff --git a/zig.spec b/zig.spec index 25373a5..952d4b2 100644 --- a/zig.spec +++ b/zig.spec @@ -1,27 +1,15 @@ +# architecture and toolchain + %if 0%{?rhel} -# Zig depends on a C compiler (gcc) during bootstraping -# older versions of gcc fail to compile the transpiled source so we limit it to x86_64 +# Zig depends on a C compiler (gcc) during bootstrapping. +# Older versions of gcc fail to compile the transpiled source, so limit to x86_64. %global zig_arches x86_64 %else -# https://ziglang.org/download/VERSION/release-notes.html#Support-Table +# Supported architectures: https://ziglang.org/download/VERSION/release-notes.html#Support-Table %global zig_arches x86_64 aarch64 riscv64 %{mips64} %endif -# Signing key from https://ziglang.org/download/ -%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U -# note here at which Fedora or EL release we need to use compat LLVM packages -%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11 -%global llvm_compat 21 -%endif - -%global llvm_version 21.1.8 - -%bcond bootstrap 0 -%bcond docs %{without bootstrap} -%bcond macro %{without bootstrap} -%bcond test 1 - -# GCC < 16.0 miscompiles on RISC-V +# GCC < 16.0 miscompiles on RISC-V; use Clang instead on older Fedora versions %ifarch riscv64 %if 0%{?fedora} < 44 %bcond toolchain_clang 1 @@ -32,8 +20,32 @@ %global toolchain clang %endif +# minisign public key for source verification (from https://ziglang.org/download/) +%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U + + +# dependency versions and cache + +# Compatible LLVM/Clang version definitions +%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11 +%global llvm_compat 21 +%endif +%global llvm_version 21.1.8 + +# Build cache directory configuration %global zig_cache_dir %{_vpath_builddir}/zig-cache + +# build conditionals + +%bcond bootstrap 0 +%bcond docs %{without bootstrap} +%bcond macro %{without bootstrap} +%bcond test 1 + + +# build and install options + %global zig_build_options %{shrink: \ --verbose \ --release=fast \ @@ -47,7 +59,7 @@ --cache-dir "%{zig_cache_dir}" \ --global-cache-dir "%{zig_cache_dir}" \ \ - -Dversion-string="%{version}" \ + -Dversion-string="%{?dev_version}%{!?dev_version:%{version}}" \ -Dstatic-llvm=false \ -Denable-llvm=true \ -Dno-langref=true \ @@ -55,14 +67,17 @@ -Dpie \ -Dconfig_h="%{__cmake_builddir}/config.h" \ } -%global zig_install_options %zig_build_options %{shrink: \ + +%global zig_install_options %{shrink: \ + %zig_build_options \ --prefix "%{_prefix}" \ } Name: zig Version: 0.16.0 -Release: 2%{?dist} +Release: %autorelease Summary: Programming language for maintaining robust, optimal, and reusable software + # The minisign file references a specific archive name so we store for ease of use %global archive_name %{name}-%{version}.tar.xz @@ -71,10 +86,12 @@ URL: https://ziglang.org Source0: %{url}/download/%{version}/%{archive_name} Source1: %{url}/download/%{version}/%{archive_name}.minisig Source2: macros.%{name} + # Remove native lib directories from rpath # this is unlikely to be upstreamed in its current state because upstream # wants to work around the shortcomings of NixOS Patch0: 0001-remove-native-lib-directories-from-rpath.patch + # LLVM on RHEL/EPEL only provides fewer targets so we patch the required targets down # Targets come from https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec Patch1: 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch @@ -162,7 +179,7 @@ This package contains common RPM macros for %{name}. %endif %prep -/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" +%{_bindir}/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" %autosetup -N %patch 0 -p1 @@ -199,7 +216,7 @@ export CCACHE_DISABLE=1 -DZIG_TARGET_MCPU:STRING=baseline \ -DZIG_TARGET_TRIPLE:STRING=native \ \ - -DZIG_VERSION:STRING="%{version}" + -DZIG_VERSION:STRING="%{?dev_version}%{!?dev_version:%{version}}" %if %{with bootstrap} %cmake_build --target stage3 @@ -214,7 +231,7 @@ help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=vers %if %{with docs} -# Use the newly made stage 3 compiler to generate docs +# Use the newly made stage 3 compiler to generate docs ./zig-out/bin/zig build docs %{zig_build_options} %endif @@ -261,157 +278,4 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %endif %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 0.16.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Wed Apr 15 2026 Jan200101 - 0.16.0-1 -- Update to 0.16.0 - -* Sat Jan 17 2026 Fedora Release Engineering - 0.15.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Sun Jan 04 2026 Jan200101 - 0.15.2-2 -- Rebuilt for EPEL - -* Sun Oct 12 2025 Jan200101 - 0.15.2-1 -- Update to 0.15.2 - -* Fri Jul 25 2025 Fedora Release Engineering - 0.14.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Mon Jun 09 2025 Jan200101 - 0.14.1-1 -- Update to 0.14.1 - -* Tue May 27 2025 Jan200101 - 0.14.0-4 -- add patch to add library directories - -* Fri May 09 2025 Jan200101 - 0.14.0-3 -- add gcc to runtime dependencies - -* 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 - -* Mon Jan 27 2025 Jan200101 - 0.13.0-8 -- specify to build against local zig stdlib directory to ensure we are building against the newest stdlib -- use release fast instead of release safe to fix aarch64 builds from running out of memory -- enable position independent executable for the zig build - -* Mon Jan 27 2025 Jan200101 - 0.13.0-7 -- build stage 3 using zig build system -- add user provided options to the end of the build and install options - -* Thu Jan 23 2025 Jan200101 - 0.13.0-6 -- rebuild against fixed llvm - -* Sun Jan 19 2025 Fedora Release Engineering - 0.13.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sun Dec 29 2024 Jan200101 - 0.13.0-4 -- correct macro variables -- set llvm_compat for F41 -- update callaway licenses to follow SPDX - -* Wed Sep 04 2024 Miroslav Suchý - 0.13.0-3 -- convert license to SPDX - -* Sat Jul 20 2024 Fedora Release Engineering - 0.13.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Tue Jun 11 2024 Jan200101 - 0.13.0-1 -- Update to 0.13.0 - -* Sat Jun 08 2024 Jan200101 - 0.12.1-1 -- Update to 0.12.1 - -* Sat May 25 2024 Jan200101 - 0.12.0-1 -- Update to 0.12.0 - -* Wed Feb 21 2024 Jan Drögehoff - 0.11.0-2 -- Rebuilt for bootstrapping - -* Sat Jan 27 2024 Aleksei Bavshin - 0.11.0-1 -- Update to 0.11.0 - -* Sat Jan 27 2024 Aleksei Bavshin - 0.9.1-6 -- Fix build with `--without macro` -- Skip %%check and test dependencies when tests are disabled -- Drop %%_zig_version macro - -* Sat Jan 27 2024 Benson Muite - 0.9.1-6 -- Verify source signature - -* Sat Jan 27 2024 Fedora Release Engineering - 0.9.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jul 22 2023 Fedora Release Engineering - 0.9.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 0.9.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 0.9.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Feb 18 2022 Jan Drögehoff - 0.9.1-1 -- Update to 0.9.1 - -* Thu Jan 27 2022 Jan Drögehoff - 0.9.0-3 -- Jan: add rpath patch -- Aleksei Bavshin: rpm macros: set default build flags - -* Sat Jan 22 2022 Fedora Release Engineering - 0.9.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Mon Dec 20 2021 Jan Drögehoff - 0.9.0-1 -- Update to 0.9.0 - -* Wed Nov 17 2021 Jan Drögehoff - 0.8.1-5 -- Enable documentation on Fedora 35 - -* Tue Nov 09 2021 Tom Stellard - 0.8.1-4 -- Rebuild for llvm-13.0.0 - -* Sat Oct 30 2021 Jan Drögehoff - 0.8.1-3 -- Update LLVM13 Patch - -* Thu Oct 07 2021 Tom Stellard - 0.8.1-2 -- Rebuild for llvm-13.0.0 - -* Sun Sep 12 2021 Jan Drögehoff - 0.8.1-1 -- Update to Zig 0.8.1, add LLVM 13 patch - -* Wed Aug 18 2021 Jan Drögehoff - 0.8.0-8 -- Rebuilt for lld soname bump - -* Fri Jul 23 2021 Fedora Release Engineering - 0.8.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jul 19 2021 Jan Drögehoff - 0.8.0-6 -- add native libc detection patch - -* Sun Jul 04 2021 Jan Drögehoff - 0.8.0-5 -- correct newline in macro that caused DESTDIR to be ignored - -* Mon Jun 28 2021 Jan Drögehoff - 0.8.0-4 -- correct macro once again to allow for proper packaging - -* Thu Jun 24 2021 Jan Drögehoff - 0.8.0-3 -- improve macro for using the zig binary - -* Thu Jun 24 2021 Jan Drögehoff - 0.8.0-2 -- Update patches, correct rpm macro - -* Sat Jun 05 2021 Jan Drögehoff - 0.8.0-1 -- Update to Zig 0.8.0 - -* Sun Dec 13 23:18:24 CET 2020 Jan Drögehoff - 0.7.1-1 -- Update to Zig 0.7.1 - -* Wed Nov 11 17:18:27 CET 2020 Jan Drögehoff - 0.7.0-1 -- Update to Zig 0.7.0 - -* Tue Aug 18 2020 Jan Drögehoff - 0.6.0-1 -- Initial zig spec +%autochangelog From 99107eeb746fd13ef1d8cf3c6a1db20b44f63f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nich=20Bon=20=C4=86iri=C4=87?= Date: Wed, 15 Jul 2026 02:31:17 -0600 Subject: [PATCH 58/59] style: remove redundant comment from zig.spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-developed-by: Gemini AI Signed-off-by: Rénich Bon Ćirić --- zig.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/zig.spec b/zig.spec index 952d4b2..4aad274 100644 --- a/zig.spec +++ b/zig.spec @@ -32,7 +32,6 @@ %endif %global llvm_version 21.1.8 -# Build cache directory configuration %global zig_cache_dir %{_vpath_builddir}/zig-cache From 57f3a79ce304a73eefe62f719bf5ac13cb15d9a3 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 8 Aug 2026 18:51:30 +0200 Subject: [PATCH 59/59] refactor: add changelog file and revert minisign macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the changelog file to preserve historical package changes for rpmautospec migration, as expected by packaging guidelines. Revert the minisign macro usage back to plain minisign, as macros should only refer to files installed by the current spec. Co-developed-by: Gemini AI Signed-off-by: Rénich Bon Ćirić --- changelog | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ zig.spec | 2 +- 2 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..cc53a32 --- /dev/null +++ b/changelog @@ -0,0 +1,154 @@ +* Fri Jul 17 2026 Fedora Release Engineering - 0.16.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Wed Apr 15 2026 Jan200101 - 0.16.0-1 +- Update to 0.16.0 + +* Sat Jan 17 2026 Fedora Release Engineering - 0.15.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Sun Jan 04 2026 Jan200101 - 0.15.2-2 +- Rebuilt for EPEL + +* Sun Oct 12 2025 Jan200101 - 0.15.2-1 +- Update to 0.15.2 + +* Fri Jul 25 2025 Fedora Release Engineering - 0.14.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Mon Jun 09 2025 Jan200101 - 0.14.1-1 +- Update to 0.14.1 + +* Tue May 27 2025 Jan200101 - 0.14.0-4 +- add patch to add library directories + +* Fri May 09 2025 Jan200101 - 0.14.0-3 +- add gcc to runtime dependencies + +* 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 + +* Mon Jan 27 2025 Jan200101 - 0.13.0-8 +- specify to build against local zig stdlib directory to ensure we are building against the newest stdlib +- use release fast instead of release safe to fix aarch64 builds from running out of memory +- enable position independent executable for the zig build + +* Mon Jan 27 2025 Jan200101 - 0.13.0-7 +- build stage 3 using zig build system +- add user provided options to the end of the build and install options + +* Thu Jan 23 2025 Jan200101 - 0.13.0-6 +- rebuild against fixed llvm + +* Sun Jan 19 2025 Fedora Release Engineering - 0.13.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sun Dec 29 2024 Jan200101 - 0.13.0-4 +- correct macro variables +- set llvm_compat for F41 +- update callaway licenses to follow SPDX + +* Wed Sep 04 2024 Miroslav Suchý - 0.13.0-3 +- convert license to SPDX + +* Sat Jul 20 2024 Fedora Release Engineering - 0.13.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Jun 11 2024 Jan200101 - 0.13.0-1 +- Update to 0.13.0 + +* Sat Jun 08 2024 Jan200101 - 0.12.1-1 +- Update to 0.12.1 + +* Sat May 25 2024 Jan200101 - 0.12.0-1 +- Update to 0.12.0 + +* Wed Feb 21 2024 Jan Drögehoff - 0.11.0-2 +- Rebuilt for bootstrapping + +* Sat Jan 27 2024 Aleksei Bavshin - 0.11.0-1 +- Update to 0.11.0 + +* Sat Jan 27 2024 Aleksei Bavshin - 0.9.1-6 +- Fix build with `--without macro` +- Skip %%check and test dependencies when tests are disabled +- Drop %%_zig_version macro + +* Sat Jan 27 2024 Benson Muite - 0.9.1-6 +- Verify source signature + +* Sat Jan 27 2024 Fedora Release Engineering - 0.9.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 0.9.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 0.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 0.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Feb 18 2022 Jan Drögehoff - 0.9.1-1 +- Update to 0.9.1 + +* Thu Jan 27 2022 Jan Drögehoff - 0.9.0-3 +- Jan: add rpath patch +- Aleksei Bavshin: rpm macros: set default build flags + +* Sat Jan 22 2022 Fedora Release Engineering - 0.9.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 20 2021 Jan Drögehoff - 0.9.0-1 +- Update to 0.9.0 + +* Wed Nov 17 2021 Jan Drögehoff - 0.8.1-5 +- Enable documentation on Fedora 35 + +* Tue Nov 09 2021 Tom Stellard - 0.8.1-4 +- Rebuild for llvm-13.0.0 + +* Sat Oct 30 2021 Jan Drögehoff - 0.8.1-3 +- Update LLVM13 Patch + +* Thu Oct 07 2021 Tom Stellard - 0.8.1-2 +- Rebuild for llvm-13.0.0 + +* Sun Sep 12 2021 Jan Drögehoff - 0.8.1-1 +- Update to Zig 0.8.1, add LLVM 13 patch + +* Wed Aug 18 2021 Jan Drögehoff - 0.8.0-8 +- Rebuilt for lld soname bump + +* Fri Jul 23 2021 Fedora Release Engineering - 0.8.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jul 19 2021 Jan Drögehoff - 0.8.0-6 +- add native libc detection patch + +* Sun Jul 04 2021 Jan Drögehoff - 0.8.0-5 +- correct newline in macro that caused DESTDIR to be ignored + +* Mon Jun 28 2021 Jan Drögehoff - 0.8.0-4 +- correct macro once again to allow for proper packaging + +* Thu Jun 24 2021 Jan Drögehoff - 0.8.0-3 +- improve macro for using the zig binary + +* Thu Jun 24 2021 Jan Drögehoff - 0.8.0-2 +- Update patches, correct rpm macro + +* Sat Jun 05 2021 Jan Drögehoff - 0.8.0-1 +- Update to Zig 0.8.0 + +* Sun Dec 13 23:18:24 CET 2020 Jan Drögehoff - 0.7.1-1 +- Update to Zig 0.7.1 + +* Wed Nov 11 17:18:27 CET 2020 Jan Drögehoff - 0.7.0-1 +- Update to Zig 0.7.0 + +* Tue Aug 18 2020 Jan Drögehoff - 0.6.0-1 +- Initial zig spec diff --git a/zig.spec b/zig.spec index 4aad274..6aea38e 100644 --- a/zig.spec +++ b/zig.spec @@ -178,7 +178,7 @@ This package contains common RPM macros for %{name}. %endif %prep -%{_bindir}/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" +minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}" %autosetup -N %patch 0 -p1