diff options
author | paulsnar | 2022-09-06 09:31:12 +0300 |
---|---|---|
committer | Techcable | 2022-09-06 00:20:46 -0700 |
commit | 87fa99ccddcb4473bc0df5647b461af95ca93f4f (patch) | |
tree | 14b4ade7c53e95791bc1e7577798244d55eeb295 | |
parent | 88ef61600851942cfa111ced965eece1ff75be08 (diff) | |
download | aur-87fa99ccddcb4473bc0df5647b461af95ca93f4f.tar.gz |
package: Cache build artifacts locally for zig run and test
> Secondarily, while I appreciate that check really makes sure that Zig works, the way it's implemented currently litters the default Zig cache (located under $HOME by default) with build products. If I may suggest, isolating Zig to either not use a build cache at all or to keep it confined to the build environment would be preferrable.
> - @paulsnar (on AUR)
Luckily paulsnar fixed his own bug report, by emailing me a patch ;)
Unfortunately, there is no way to disable caching right now
(see zig issue #12317), so using a local cache is the best option.
Elaborated-by: Techcable <Techcable@techcable.net>
-rw-r--r-- | PKGBUILD | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -79,11 +79,17 @@ RELATIVE_LANGREF_FILE="docs/langref.html"; RELATIVE_STDLIB_DOC_FILES=("docs/std/index.html" "docs/std/main.js" "docs/std/data.js"); check() { hello_file="$(realpath ../hello.zig)" + # Zig caches (both local and global) can use up a lot of space. + # For these hello world examples (in a frequently updated package), this is very wasteful. + # + # Right now there is no way to disable the cache (see Zig issue #12317) + # Instead we shove everything in a local directory + cache_dir="${srcdir}/zig-cache" cd "${srcdir}/zig-linux-${CARCH}-${pkgver//_/-}"; echo "Running Zig Hello World" - ./zig run "$hello_file" - ./zig test "$hello_file" - echo "Checking for docs...." + ./zig run --cache-dir "$cache_dir" --global-cache-dir "$cache_dir" "$hello_file" + ./zig test --cache-dir "$cache_dir" --global-cache-dir "$cache_dir" "$hello_file" + rm -rf "$cache_dir"; local missing_docs=(); # Zig has had long-running issues with the location # of the docs directory. |