40 Commits

Author SHA256 Message Date
b97859a14d Accepting request 1314099 from devel:tools:compiler
- Add RPM 4.20 declarative build system macros

These allow reducing most spec file boilerplate to a simple BuildSystem: zig (forwarded request 1313383 from mia)

OBS-URL: https://build.opensuse.org/request/show/1314099
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=10
2025-10-29 20:05:40 +00:00
f21863840d - Add RPM 4.20 declarative build system macros
These allow reducing most spec file boilerplate to a simple BuildSystem: zig

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=62
2025-10-28 14:39:50 +00:00
66658d58a3 Accepting request 1305271 from devel:tools:compiler
- Remove unused build requires (forwarded request 1305214 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1305271
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=9
2025-09-17 14:44:03 +00:00
15815f1459 - Remove unused build requires
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=60
2025-09-17 01:05:45 +00:00
313ccb8634 Accepting request 1302085 from devel:tools:compiler
OBS-URL: https://build.opensuse.org/request/show/1302085
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=8
2025-09-01 15:18:01 +00:00
Soc Virnyl Estela
50dc71abe9 Accepting request 1301851 from home:uncomfyhalomacro:branches:devel:tools:compiler
- Update to version 0.15.1:
  ** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.15.1/release-notes.html

OBS-URL: https://build.opensuse.org/request/show/1301851
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=58
2025-08-31 11:37:18 +00:00
47d984f034 Accepting request 1241564 from home:bmwiedemann:branches:devel:tools:compiler
- Add reproducible.patch to fix reproducible-builds issues (boo#1100677)
  https://github.com/ziglang/zig/issues/22663

This fixes river, stacktile, waylock, wayprompt and zls

only zig itself has some variations from ASLR left. Will debug later...

OBS-URL: https://build.opensuse.org/request/show/1241564
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=57
2025-02-10 10:30:00 +00:00
Soc Virnyl Estela
15a6207e77 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=56 2024-06-24 05:54:49 +00:00
Soc Virnyl Estela
0e97ce964c OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=55 2024-06-24 04:46:17 +00:00
Soc Virnyl Estela
d7f3e5387e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=54 2024-06-24 00:06:27 +00:00
Soc Virnyl Estela
916a8dfa48 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=53 2024-06-23 13:15:18 +00:00
Soc Virnyl Estela
3e800f8ae2 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=52 2024-06-23 08:42:37 +00:00
Soc Virnyl Estela
c87a233603 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=51 2024-06-23 08:36:36 +00:00
Soc Virnyl Estela
492cfa8a9d OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=50 2024-06-23 06:04:49 +00:00
Soc Virnyl Estela
93a60323ca OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=49 2024-06-23 03:58:08 +00:00
Soc Virnyl Estela
bf7918c042 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=48 2024-06-23 03:08:46 +00:00
Soc Virnyl Estela
3c0c285f5e - Add *debuginfo variants of build requirements for tests
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=47
2024-06-23 03:05:02 +00:00
Soc Virnyl Estela
9188254726 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=46 2024-06-23 02:21:44 +00:00
Soc Virnyl Estela
e39573411b - Workaround for test
* add vendored cache dependencies.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=45
2024-06-23 01:32:00 +00:00
Soc Virnyl Estela
bf208962e0 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=44 2024-06-23 00:47:24 +00:00
Soc Virnyl Estela
e5512844f1 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=43 2024-06-23 00:41:59 +00:00
Soc Virnyl Estela
aca4ce3fe6 - Fix check section for tests
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=42
2024-06-23 00:18:33 +00:00
Soc Virnyl Estela
7f741f0567 - Add -DZIG_USE_LLVM_CONFIG=ON option
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=41
2024-06-22 09:14:10 +00:00
Soc Virnyl Estela
f1ca18b3cd - Add elfutils and libelf-devel for test suites
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=40
2024-06-22 07:42:01 +00:00
Soc Virnyl Estela
7bd1d451f7 - Add patch skip-localhost-test.patch
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=39
2024-06-22 05:25:43 +00:00
Soc Virnyl Estela
56c37b6d1e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=38 2024-06-22 03:46:45 +00:00
Soc Virnyl Estela
e256911be3 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=37 2024-06-22 03:15:54 +00:00
Soc Virnyl Estela
af76719f06 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=36 2024-06-22 01:25:27 +00:00
Soc Virnyl Estela
cde208fffa - Add liburing-devel for test suites
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=35
2024-06-22 01:21:59 +00:00
Soc Virnyl Estela
80bb2641d0 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=34 2024-06-22 01:19:28 +00:00
Soc Virnyl Estela
9cb6508e6b OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=33 2024-06-22 01:12:15 +00:00
Soc Virnyl Estela
e51deb7f8a OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=32 2024-06-22 00:26:43 +00:00
Soc Virnyl Estela
d8d47ce95e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=31 2024-06-22 00:17:59 +00:00
Soc Virnyl Estela
eb8010870f - Set mold as linker. Efficient and fast at utilising computer resources
unlike GNU ld.
- Enable tests
- Specfile cleanup
  * remove some outdated comments

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=30
2024-06-22 00:11:57 +00:00
Soc Virnyl Estela
2eafc87a19 Accepting request 1180180 from home:Andreas_Schwab:Factory
- Reduce constraints

OBS-URL: https://build.opensuse.org/request/show/1180180
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=29
2024-06-13 11:50:22 +00:00
e13dfb3c9f Accepting request 1179408 from devel:tools:compiler
- Update patchsets for llvm18 changes
  ./0000-remove-lld-in-cmakelist.patch
  ./0001-invoke-lld.patch
- Update to version 0.13.0:
  ** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.12.0/release-notes.html
  * Release focuses more on the LLVM18 support

OBS-URL: https://build.opensuse.org/request/show/1179408
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=7
2024-06-09 18:22:22 +00:00
Soc Virnyl Estela
1af365e1e3 ./0001-invoke-lld.patch
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=27
2024-06-07 18:27:34 +00:00
Soc Virnyl Estela
9e5d0a8a54 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=26 2024-06-07 18:08:12 +00:00
Soc Virnyl Estela
86abd88865 - Update patchsets for llvm18 changes
./0000-remove-lld-in-cmakelist.patch

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=25
2024-06-07 17:57:56 +00:00
Soc Virnyl Estela
fb33ce16b6 - Update to version 0.13.0:
** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.12.0/release-notes.html
  * Release focuses more on the LLVM18 support

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=24
2024-06-07 17:36:53 +00:00
12 changed files with 269 additions and 129 deletions

View File

@@ -1,32 +1,26 @@
We invoke LLD so we also commented/remove it out as well.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92be8fb..e19d18e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,7 @@
diff -ruN zig-0.13.0.orig/CMakeLists.txt zig-0.13.0/CMakeLists.txt
--- zig-0.13.0.orig/CMakeLists.txt 2024-06-08 02:06:52.784489192 +0800
+++ zig-0.13.0/CMakeLists.txt 2024-06-08 02:07:26.458213443 +0800
@@ -139,7 +139,7 @@
find_package(llvm 17)
find_package(clang 17)
-find_package(lld 17)
+# find_package(lld 17)
find_package(llvm 20)
find_package(clang 20)
-find_package(lld 20)
+# find_package(lld 20)
if(ZIG_STATIC_ZLIB)
if (MSVC)
@@ -183,7 +183,7 @@
endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
include_directories(${LLVM_INCLUDE_DIRS})
-include_directories(${LLD_INCLUDE_DIRS})
+# include_directories(${LLD_INCLUDE_DIRS})
include_directories(${CLANG_INCLUDE_DIRS})
find_package(Threads)
@@ -707,7 +707,7 @@
target_link_libraries(zigcpp LINK_PUBLIC
@@ -736,11 +736,11 @@
target_include_directories(zigcpp PUBLIC
${CLANG_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
- ${LLD_INCLUDE_DIRS}
+# ${LLD_INCLUDE_DIRS}
)
target_link_libraries(zigcpp PUBLIC
${CLANG_LIBRARIES}
- ${LLD_LIBRARIES}
+ # ${LLD_LIBRARIES}
+# ${LLD_LIBRARIES}
${LLVM_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

View File

@@ -1,60 +1,56 @@
Based on Aaron Puchert's <aaronpuchert@alice-dsl.net> patch.
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index ae1f0242..c0010c77 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -60,15 +60,18 @@
diff -ruN zig-0.15.1.orig/src/zig_llvm.cpp zig-0.15.1/src/zig_llvm.cpp
--- zig-0.15.1.orig/src/zig_llvm.cpp 2025-08-27 22:13:38.418809910 +0800
+++ zig-0.15.1/src/zig_llvm.cpp 2025-08-27 22:53:09.408882779 +0800
@@ -62,7 +62,6 @@
#include <llvm/Transforms/Utils/CanonicalizeAliases.h>
#include <llvm/Transforms/Utils/NameAnonGlobals.h>
-#include <lld/Common/Driver.h>
-
#if __GNUC__ >= 9
#pragma GCC diagnostic pop
#endif
@@ -71,6 +70,10 @@
#include <new>
+#include <poll.h>
#include <stdlib.h>
+#include <spawn.h>
+#include <poll.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
using namespace llvm;
@@ -78,6 +81,85 @@ static const bool assertions_on = true;
@@ -80,6 +83,85 @@
static const bool assertions_on = false;
#endif
+namespace {
+ class Pipe {
+ public:
+ Pipe(llvm::raw_ostream *output) : output(output) {}
+ ~Pipe() {
+ if (fd[0] != -1) close(fd[0]);
+ if (fd[1] != -1) close(fd[1]);
+ }
+ bool open() { return pipe(fd) == 0; }
+ int getRead() const { return fd[0]; }
+ int getWrite() const { return fd[1]; }
+ void closeWrite() { close(fd[1]); fd[1] = -1; }
+ void flush() const {
+ constexpr size_t size = 1024;
+ char buf[size];
+ ssize_t ret;
+ do {
+ ret = read(getRead(), buf, size);
+ if (ret > 0 && output)
+ output->write(buf, ret);
+ } while (ret == size || (ret == -1 && errno == EINTR));
+ }
+ private:
+ int fd[2] = {-1, -1};
+ llvm::raw_ostream *output;
+ };
+} // anonymous namespace
+ class Pipe {
+ public:
+ Pipe(llvm::raw_ostream *output) : output(output) {}
+ ~Pipe() {
+ if (fd[0] != -1) close(fd[0]);
+ if (fd[1] != -1) close(fd[1]);
+ }
+ bool open() { return pipe(fd) == 0; }
+ int getRead() const { return fd[0]; }
+ int getWrite() const { return fd[1]; }
+ void closeWrite() { close(fd[1]); fd[1] = -1; }
+ void flush() const {
+ constexpr size_t size = 1024;
+ char buf[size];
+ ssize_t ret;
+ do {
+ ret = read(getRead(), buf, size);
+ if (ret > 0 && output)
+ output->write(buf, ret);
+ } while (ret == size || (ret == -1 && errno == EINTR));
+ }
+ private:
+ int fd[2] = {-1, -1};
+ llvm::raw_ostream *output;
+ };
+}
+
+static bool InvokeLld(const char *variant, llvm::ArrayRef<const char *> args,
+ llvm::raw_ostream &stdoutOS,
@@ -109,26 +105,25 @@ index ae1f0242..c0010c77 100644
+
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
@@ -558,18 +640,15 @@ namespace lld {
}
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMFloatABI float_abi,
@@ -560,17 +642,17 @@
bool ZigLLDLinkCOFF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
std::vector<const char *> args(argv, argv + argc);
- return lld::coff::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("lld-link-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
+ return InvokeLld("lld-link-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
bool ZigLLDLinkELF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
std::vector<const char *> args(argv, argv + argc);
- return lld::elf::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("ld.lld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
+ return InvokeLld("ld.lld-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
bool ZigLLDLinkWasm(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
std::vector<const char *> args(argv, argv + argc);
- return lld::wasm::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("wasm-ld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
+ return InvokeLld("wasm-ld-20", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
static_assert((Triple::ArchType)ZigLLVM_UnknownArch == Triple::UnknownArch, "");
static_assert((FloatABI::ABIType)ZigLLVMFloatABI_Default == FloatABI::ABIType::Default, "");

View File

@@ -1,52 +1,57 @@
Since we patched it to invoke LLD directly, we will have
to remove any mentions of LLD here.
diff --git a/build.zig b/build.zig
index 0e43b82f..14792f48 100644
--- a/build.zig
+++ b/build.zig
@@ -689,12 +689,12 @@ fn addCmakeCfgOptionsToExe(
diff -ruN zig-0.15.1.orig/build.zig zig-0.15.1/build.zig
--- zig-0.15.1.orig/build.zig 2025-08-27 22:13:38.504308190 +0800
+++ zig-0.15.1/build.zig 2025-08-27 23:06:14.149084513 +0800
@@ -205,7 +205,6 @@
const use_llvm = b.option(bool, "use-llvm", "Use the llvm backend");
exe.use_llvm = use_llvm;
- exe.use_lld = use_llvm;
if (no_bin) {
b.getInstallStep().dependOn(&exe.step);
@@ -559,7 +558,6 @@
}),
.filters = test_filters,
.use_llvm = use_llvm,
- .use_lld = use_llvm,
.zig_lib_dir = b.path("lib"),
});
if (link_libc) {
@@ -787,12 +785,9 @@
cfg.cmake_static_library_suffix,
}),
}) });
- assert(cfg.lld_include_dir.len != 0);
- exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
+ // assert(cfg.lld_include_dir.len != 0);
+ // exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
exe.addIncludePath(.{ .cwd_relative = cfg.llvm_include_dir });
exe.addLibraryPath(.{ .cwd_relative = cfg.llvm_lib_dir });
addCMakeLibraryList(exe, cfg.clang_libraries);
- addCMakeLibraryList(exe, cfg.lld_libraries);
+ // addCMakeLibraryList(exe, cfg.lld_libraries);
addCMakeLibraryList(exe, cfg.llvm_libraries);
- mod.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
mod.addIncludePath(.{ .cwd_relative = cfg.llvm_include_dir });
mod.addLibraryPath(.{ .cwd_relative = cfg.llvm_lib_dir });
addCMakeLibraryList(mod, cfg.clang_libraries);
- addCMakeLibraryList(mod, cfg.lld_libraries);
addCMakeLibraryList(mod, cfg.llvm_libraries);
if (use_zig_libcxx) {
@@ -862,8 +862,8 @@ const CMakeConfig = struct {
@@ -980,8 +975,6 @@
cmake_static_library_suffix: []const u8,
cxx_compiler: []const u8,
cxx_compiler_arg1: []const u8,
- lld_include_dir: []const u8,
- lld_libraries: []const u8,
+ // lld_include_dir: []const u8,
+ // lld_libraries: []const u8,
clang_libraries: []const u8,
llvm_lib_dir: []const u8,
llvm_include_dir: []const u8,
@@ -929,8 +929,8 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
@@ -1047,8 +1040,6 @@
.cmake_static_library_suffix = undefined,
.cxx_compiler = undefined,
.cxx_compiler_arg1 = "",
- .lld_include_dir = undefined,
- .lld_libraries = undefined,
+ // .lld_include_dir = undefined,
+ // .lld_libraries = undefined,
.clang_libraries = undefined,
.llvm_lib_dir = undefined,
.llvm_include_dir = undefined,
@@ -964,14 +964,14 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
.prefix = "#define ZIG_CXX_COMPILER_ARG1 ",
@@ -1083,14 +1074,6 @@
.field = "cxx_compiler_arg1",
},
- .{
.{
- .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
- .field = "lld_include_dir",
- },
@@ -54,14 +59,7 @@ index 0e43b82f..14792f48 100644
- .prefix = "#define ZIG_LLD_LIBRARIES ",
- .field = "lld_libraries",
- },
+ // .{
+ // .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
+ // .field = "lld_include_dir",
+ // },
+ // .{
+ // .prefix = "#define ZIG_LLD_LIBRARIES ",
+ // .field = "lld_libraries",
+ // },
.{
- .{
.prefix = "#define ZIG_CLANG_LIBRARIES ",
.field = "clang_libraries",
},

View File

@@ -7,12 +7,9 @@
<constraints>
<hardware>
<jobs>6</jobs>
<physicalmemory>
<size unit="G">16</size>
</physicalmemory>
<disk>
<size unit="G">35</size>
</disk>
<memory>
<size unit="G">8</size>
</memory>
</hardware>
<overwrite>
<!--
@@ -22,7 +19,6 @@
<conditions>
<arch>ppc</arch>
<arch>s390</arch>
<arch>riscv64</arch>
</conditions>
<hardware>
<disk>

View File

@@ -41,3 +41,8 @@
%zig_build \\\
test
# Declarative build system, requires RPM 4.20+ to work
# https://rpm-software-management.github.io/rpm/manual/buildsystem.html
%buildsystem_zig_build() %zig_build %*
%buildsystem_zig_install() %zig_install %*
%buildsystem_zig_check() %zig_test %*

29
reproducible.patch Normal file
View File

@@ -0,0 +1,29 @@
diff -ruN zig-0.15.1.orig/lib/compiler/build_runner.zig zig-0.15.1/lib/compiler/build_runner.zig
--- zig-0.15.1.orig/lib/compiler/build_runner.zig 2025-08-27 22:13:36.317431953 +0800
+++ zig-0.15.1/lib/compiler/build_runner.zig 2025-08-27 22:40:22.550530377 +0800
@@ -67,6 +67,14 @@
.handle = try std.fs.cwd().makeOpenPath(global_cache_root, .{}),
};
+ // Avoid using native binaries during build to not influence zig-cache hashes
+ const host_query: std.Target.Query = .{
+ .cpu_model = .baseline,
+ .os_tag = builtin.target.os.tag,
+ };
+
+
+
var graph: std.Build.Graph = .{
.arena = arena,
.cache = .{
@@ -78,8 +86,8 @@
.global_cache_root = global_cache_directory,
.zig_lib_directory = zig_lib_directory,
.host = .{
- .query = .{},
- .result = try std.zig.system.resolveTargetQuery(.{}),
+ .query = host_query,
+ .result = try std.zig.system.resolveTargetQuery(host_query),
},
.time_report = false,
};

10
skip-localhost-test.patch Normal file
View File

@@ -0,0 +1,10 @@
--- a/lib/std/net/test.zig 2023-08-20 22:44:38.000000000 +1000
+++ b/lib/std/net/test.zig 2023-08-21 17:03:51.996044571 +1000
@@ -119,6 +119,7 @@
{
const localhost_v4 = try net.Address.parseIp("127.0.0.1", 80);
const localhost_v6 = try net.Address.parseIp("::2", 80);
+ if (true) return error.SkipZigTest;
const result = try net.getAddressList(testing.allocator, "localhost", 80);
defer result.deinit();

3
vendor.tar.zst Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e31de34238c701f65e50cf6d3c2bacaa5081e5147835670b6d425cf808b7aeb9
size 3258706

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6744ef84b6716f976dad923075b2f54dc4f785f200ae6c8ea07997bd9d9bd9a
size 17099152

3
zig-0.15.1.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:816c0303ab313f59766ce2097658c9fff7fafd1504f61f80f9507cd11652865f
size 21359884

View File

@@ -1,3 +1,61 @@
-------------------------------------------------------------------
Fri Oct 24 10:43:53 UTC 2025 - Mia Herkt <mia@0x0.st>
- Add RPM 4.20 declarative build system macros
-------------------------------------------------------------------
Tue Sep 16 13:56:45 UTC 2025 - Andreas Schwab <schwab@suse.de>
- Remove unused build requires
-------------------------------------------------------------------
Wed Aug 27 14:05:32 UTC 2025 - Soc Virnyl Estela <uncomfyhalomacro@opensuse.org>
- Update to version 0.15.1:
** CHANGELOG TOO LONG **
See https://ziglang.org/download/0.15.1/release-notes.html
-------------------------------------------------------------------
Fri Jan 31 03:58:41 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible.patch to fix reproducible-builds issues (boo#1100677)
https://github.com/ziglang/zig/issues/22663
-------------------------------------------------------------------
Sun Jun 23 08:41:29 UTC 2024 - Soc Virnyl Estela <obs@uncomfyhalomacro.pl>
- Cleanup specfile
- Workaround for test
* add vendored cache dependencies.
- Fix check section for tests
- Add -DZIG_USE_LLVM_CONFIG=ON option
- Add patch skip-localhost-test.patch
- Add liburing-devel for test suites
- Set mold as linker. Efficient and fast at utilising computer resources
unlike GNU ld.
- Enable tests
- remove some outdated comments in specfile
-------------------------------------------------------------------
Wed Jun 12 11:45:34 UTC 2024 - Andreas Schwab <schwab@suse.de>
- Reduce constraints
-------------------------------------------------------------------
Fri Jun 7 17:56:48 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
- Update patchsets for llvm18 changes
./0000-remove-lld-in-cmakelist.patch
./0001-invoke-lld.patch
-------------------------------------------------------------------
Fri Jun 7 17:35:24 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
- Update to version 0.13.0:
** CHANGELOG TOO LONG **
See https://ziglang.org/download/0.13.0/release-notes.html
* Release focuses more on the LLVM18 support
-------------------------------------------------------------------
Sat May 4 15:13:58 UTC 2024 - Michael Burge <michael.burge77@gmail.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package zig
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -22,7 +22,7 @@
%bcond_without test
Name: zig
Version: 0.12.0
Version: 0.15.1
Release: 0
Summary: Compiler for the Zig language
License: MIT
@@ -30,23 +30,38 @@ Group: Development/Languages/Other
URL: https://ziglang.org/
Source0: https://ziglang.org/download/%{version}/%{name}-%{version}.tar.xz
Source1: macros.%{name}
Source2: zig-rpmlintrc
# The vendored tarball is for tests. This contains the
# cached deps. See https://en.opensuse.org/Zig#Packaging
Source2: vendor.tar.zst
Source3: zig-rpmlintrc
Patch0: 0000-remove-lld-in-cmakelist.patch
Patch1: 0001-invoke-lld.patch
Patch2: 0002-no-lld-libs-and-includes.patch
BuildRequires: clang17
BuildRequires: clang17-devel
# Just copying from Archlinux. Thanks
Patch3: https://gitlab.archlinux.org/archlinux/packaging/packages/zig/-/raw/main/skip-localhost-test.patch
# to improve reproducible-builds -- https://github.com/ziglang/zig/pull/22673
Patch4: reproducible.patch
BuildRequires: clang20
BuildRequires: clang20-devel
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: elfutils
BuildRequires: gcc-c++
BuildRequires: glibc
BuildRequires: glibc-devel
BuildRequires: glibc-devel-32bit
BuildRequires: help2man
BuildRequires: lld17
BuildRequires: llvm17-devel
BuildRequires: libelf-devel
BuildRequires: liburing-devel
BuildRequires: lld20
BuildRequires: llvm20-devel
BuildRequires: mold
BuildRequires: ninja
BuildRequires: zlib-devel
Requires: lld17
BuildRequires: zstd
BuildRequires: (gcc13-c++ if gcc13)
BuildRequires: (gcc14-c++ if gcc14)
BuildRequires: (gcc15-c++ if gcc15)
Requires: lld20
# llvm-config is missing targets for ppc and arm architectures.
# ExcludeArch: ppc64 ppc64le %%arm %%ix86
@@ -85,23 +100,48 @@ This package contains common RPM macros for %{name}.
%endif
%prep
%autosetup -n %{name}-%{version} -p1
%autosetup -n %{name}-%{version} -p1 -a2
%build
# NOTE: ix86 architectures will still fail to build due to OOM. Once 0.11.x lands,
# this won't be an issue anymore since that version does not use much memory
# CMAKE on Tumbleweed has the CMAKE_LINKER_TYPE option
%if 0%{?suse_version} > 1600
%cmake \
%ifarch aarch64 s390x
-DCMAKE_BUILD_TYPE=Release \
%endif
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER="clang-17" \
-DCMAKE_CXX_COMPILER="clang++-17" \
-DCMAKE_C_COMPILER="clang-20" \
-DCMAKE_CXX_COMPILER="clang++-20" \
-DCMAKE_LINKER_TYPE=MOLD \
-DZIG_SHARED_LLVM=On \
-DZIG_USE_LLVM_CONFIG=ON \
-DZIG_TARGET_MCPU="baseline" \
-DZIG_VERSION:STRING="%{version}"
%else
%cmake \
%ifarch aarch64 s390x
-DCMAKE_BUILD_TYPE=Release \
%endif
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER="clang-20" \
-DCMAKE_CXX_COMPILER="clang++-20" \
-DZIG_SHARED_LLVM=On \
-DZIG_USE_LLVM_CONFIG=ON \
-DZIG_TARGET_MCPU="baseline" \
-DZIG_VERSION:STRING="%{version}"
%endif
# Workaround since CMAKE on Leap does not have
# the CMAKE_LINKER_TYPE option
%if 0%{?suse_version} > 1600
%cmake_build
%else
mold -run %cmake_build
%endif
%install
%cmake_install
@@ -115,6 +155,18 @@ sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{
mv -v doc/langref.html.in doc/langref.html
%if 0%{?with test}
%check
./build/stage3/bin/zig build test -Dconfig_h=build/config.h \
-Dcpu=baseline \
-Dskip-debug \
-Dskip-release-safe \
-Dskip-release-small \
-Dstatic-llvm=false \
-Denable-llvm=true \
-Dskip-non-native=true
%endif
%files
%license LICENSE
%{_bindir}/zig