Having zig available on Rocky 9.x would be a great convenience Reproducible: Always
+1 for EPEL 9 I can try to help if you want: may need to work out which commit can build.
In the future this would be great and help with it would be appreciated as I don't have a lot of experience with EPEL, but as is it stands the Zig package is in a rough state because LLVM, Zig and Fedora don't tend to line up. Those troubles are being documented at https://bugzilla.redhat.com/show_bug.cgi?id=2139038 I appreciate the commit to the repo Jens, but could you refrain from doing stray pushes like that? This one is rather simple but anything bigger could cause serious conflicts on anyone working on something. Pushing work-in-progress changes isn't always an option since Fedora puts restrictions on branches.
Sorry about that (I should have looked for activity in bz). In future will open a PR instead, my bad. (BTW %fedora isn't defined in rhel/epel, though in fairness the current package only targets Fedora, so one should use clucky things like 0%{?fedora} or %{defined fedora} instead)
I tried doing a scratch build for epel9, but alas it failed with: [100%] Linking CXX executable zig /usr/bin/cmake -E cmake_link_script CMakeFiles/zig.dir/link.txt --verbose=1 /usr/bin/g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -rdynamic CMakeFiles/zig.dir/src/stage1/empty.cpp.o zig1.o -o zig -Wl,-rpath,/usr/lib64/llvm13/lib: zigcpp/libzigstage1.a zigcpp/libopt_c_util.a zigcpp/libembedded_softfloat.a zigcpp/libzigcpp.a /usr/lib64/llvm13/lib/libclang-cpp.so /usr/lib64/llvm13/lib/liblldDriver.so /usr/lib64/llvm13/lib/liblldMinGW.so /usr/lib64/llvm13/lib/liblldELF.so /usr/lib64/llvm13/lib/liblldCOFF.so /usr/lib64/llvm13/lib/liblldWasm.so /usr/lib64/llvm13/lib/liblldMachO.so /usr/lib64/llvm13/lib/liblldReaderWriter.so /usr/lib64/llvm13/lib/liblldCore.so /usr/lib64/llvm13/lib/liblldYAML.so /usr/lib64/llvm13/lib/liblldCommon.so /usr/lib64/llvm13/lib/libLLVM-13.so /usr/bin/ld: zig1.o: in function `codegen.llvm.Object.create': zig1:(.text+0x80bb6): undefined reference to `LLVMInitializeSparcTarget' /usr/bin/ld: zig1:(.text+0x80bbb): undefined reference to `LLVMInitializeSparcTargetInfo' /usr/bin/ld: zig1:(.text+0x80bc0): undefined reference to `LLVMInitializeSparcTargetMC' /usr/bin/ld: zig1:(.text+0x80bc5): undefined reference to `LLVMInitializeSparcAsmPrinter' /usr/bin/ld: zig1:(.text+0x80bca): undefined reference to `LLVMInitializeSparcAsmParser' /usr/bin/ld: zig1:(.text+0x80bf2): undefined reference to `LLVMInitializeRISCVTarget' /usr/bin/ld: zig1:(.text+0x80bf7): undefined reference to `LLVMInitializeRISCVTargetInfo' /usr/bin/ld: zig1:(.text+0x80bfc): undefined reference to `LLVMInitializeRISCVTargetMC' /usr/bin/ld: zig1:(.text+0x80c01): undefined reference to `LLVMInitializeRISCVAsmPrinter' /usr/bin/ld: zig1:(.text+0x80c06): undefined reference to `LLVMInitializeRISCVAsmParser' /usr/bin/ld: zig1:(.text+0x80cb9): undefined reference to `LLVMInitializeAVRTarget' /usr/bin/ld: zig1:(.text+0x80cbe): undefined reference to `LLVMInitializeAVRTargetInfo' /usr/bin/ld: zig1:(.text+0x80cc3): undefined reference to `LLVMInitializeAVRTargetMC' /usr/bin/ld: zig1:(.text+0x80cc8): undefined reference to `LLVMInitializeAVRAsmPrinter' /usr/bin/ld: zig1:(.text+0x80ccd): undefined reference to `LLVMInitializeAVRAsmParser' /usr/bin/ld: zig1:(.text+0x80cd7): undefined reference to `LLVMInitializeHexagonTarget' /usr/bin/ld: zig1:(.text+0x80cdc): undefined reference to `LLVMInitializeHexagonTargetInfo' /usr/bin/ld: zig1:(.text+0x80ce1): undefined reference to `LLVMInitializeHexagonTargetMC' /usr/bin/ld: zig1:(.text+0x80ce6): undefined reference to `LLVMInitializeHexagonAsmPrinter' /usr/bin/ld: zig1:(.text+0x80ceb): undefined reference to `LLVMInitializeHexagonAsmParser' /usr/bin/ld: zig1:(.text+0x80cf5): undefined reference to `LLVMInitializeMSP430Target' /usr/bin/ld: zig1:(.text+0x80cfa): undefined reference to `LLVMInitializeMSP430TargetInfo' /usr/bin/ld: zig1:(.text+0x80cff): undefined reference to `LLVMInitializeMSP430TargetMC' /usr/bin/ld: zig1:(.text+0x80d04): undefined reference to `LLVMInitializeMSP430AsmPrinter' /usr/bin/ld: zig1:(.text+0x80d09): undefined reference to `LLVMInitializeMSP430AsmParser' /usr/bin/ld: zig1:(.text+0x80d4f): undefined reference to `LLVMInitializeXCoreTarget' /usr/bin/ld: zig1:(.text+0x80d54): undefined reference to `LLVMInitializeXCoreTargetInfo' /usr/bin/ld: zig1:(.text+0x80d59): undefined reference to `LLVMInitializeXCoreTargetMC' /usr/bin/ld: zig1:(.text+0x80d5e): undefined reference to `LLVMInitializeXCoreAsmPrinter' /usr/bin/ld: zig1:(.text+0x80d68): undefined reference to `LLVMInitializeLanaiTarget' /usr/bin/ld: zig1:(.text+0x80d6d): undefined reference to `LLVMInitializeLanaiTargetInfo' /usr/bin/ld: zig1:(.text+0x80d72): undefined reference to `LLVMInitializeLanaiTargetMC' /usr/bin/ld: zig1:(.text+0x80d77): undefined reference to `LLVMInitializeLanaiAsmPrinter' /usr/bin/ld: zig1:(.text+0x80d7c): undefined reference to `LLVMInitializeLanaiAsmParser' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/zig.dir/build.make:395: zig] Error 1 gmake[2]: Leaving directory '/builddir/build/BUILD/zig-0.9.1/redhat-linux-build'gmake[1]: Leaving directory '/builddir/build/BUILD/zig-0.9.1/redhat-linux-build'gmake[1]: *** [CMakeFiles/Makefile2:157: CMakeFiles/zig.dir/all] Error 2 gmake: *** [Makefile:139: all] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.Ux4YaB (%build) https://koji.fedoraproject.org/koji/taskinfo?taskID=111656611
RHEL/EPEL llvm packages are built with a reduced set of targets for cross-compilation, while zig requires all the targets, including experimental ones, to be enabled. %if 0%{?rhel} %global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" %global experimental_targets_to_build "" %else %global targets_to_build "all" %global experimental_targets_to_build "AVR" %endif 0.11.0 has a clear warning about that in CMakeLists.txt, but with 0.9.0 you'll only get this linking error.
I see, thank you, Aleksei I am actually also the Fedora/EPEL llvm13 maintainer now. In principle we could enable all the llvm13 targets for EPEL, right?
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21. Fedora Linux 38 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.