From b9abbed4a8af4cc471ac2e6daeb36b5ee4f8510d Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 4 Jan 2026 17:22:54 +0100 Subject: [PATCH] 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 \