Skip to content

Compilation: write CACHEDIR.TAG #24121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kevinboulain
Copy link
Contributor

This was previously attempted in #14875 but it was asked to make the file creation an asynchronous task like the others in performAllTheWork.
For context, see #8210. In my case it's motivated by the fact that my little project's .zig-cache is already 40+GB (I haven't checked why) and I'd like the backup utility to avoid backing up the intermediate artifacts. In #8210 it was also asked to tag zig-out but from a quick glance this might not be as simple because that's also the install prefix but also doesn't appear as large.

@kevinboulain
Copy link
Contributor Author

I can't tell whether the x86_64-linux-release CI failure is related to this patch while the others succeeded.

[14/20] Running zig1.wasm to produce /home/ci/actions-runner12/_work/zig/zig/build-new/zig2.c
FAILED: zig2.c /home/ci/actions-runner12/_work/zig/zig/build-new/zig2.c 
cd /home/ci/actions-runner12/_work/zig/zig && /home/ci/actions-runner12/_work/zig/zig/build-new/zig1 /home/ci/actions-runner12/_work/zig/zig/lib build-exe -ofmt=c -lc -OReleaseSmall --name zig2 -femit-bin="/home/ci/actions-runner12/_work/zig/zig/build-new/zig2.c" -target x86_64-linux --dep build_options --dep aro -Mroot=src/main.zig -Mbuild_options=/home/ci/actions-runner12/_work/zig/zig/build-new/config.zig -Maro=lib/compiler/aro/aro.zig
unimplemented
Aborted
[15/20] Running zig1.wasm to produce /home/ci/actions-runner12/_work/zig/zig/build-new/compiler_rt.c
FAILED: compiler_rt.c /home/ci/actions-runner12/_work/zig/zig/build-new/compiler_rt.c 
cd /home/ci/actions-runner12/_work/zig/zig && /home/ci/actions-runner12/_work/zig/zig/build-new/zig1 /home/ci/actions-runner12/_work/zig/zig/lib build-obj -ofmt=c -OReleaseSmall --name compiler_rt -femit-bin="/home/ci/actions-runner12/_work/zig/zig/build-new/compiler_rt.c" -target x86_64-linux -Mroot=lib/compiler_rt.zig
unimplemented
Aborted

@alexrp
Copy link
Member

alexrp commented Jun 8, 2025

It's probably related, and likely coming from stage1/wasi.c.

@kevinboulain kevinboulain marked this pull request as draft June 9, 2025 08:33
@kevinboulain
Copy link
Contributor Author

Thanks for the hint, that helps a bit.

Sadly, I can't seem to repro locally (the compilation goes past the failed CI steps), my cmake invocation is something along the lines of export ARCH=x86_64 TARGET=x86_64-linux-musl MCPU=baseline; mkdir build-release; cd build-release; cmake .. -DCMAKE_BUILD_TYPE=Release -DZIG_TARGET_TRIPLE=x86_64-linux-musl -DZIG_TARGET_MCPU=baseline -DZIG_STATIC=ON -DZIG_NO_LIB=ON -GNinja (taken from the logs).
The only major difference that I can spot from the logs is that the CI appears to be using a custom compiler build zig+llvm+lld+clang-x86_64-linux-musl-0.15.0-dev.233+7c85dc460 which is likely related to ziglang/zig-bootstrap@7493858. My uneducated guess is that something has changed since 7c85dc4, allowing my change to pass on my checkout? I'm kicking off a build of zig-boostrap from the linked commit but I guess it's going to take a while :)

At the very least, I'll push a commit later to make these "unimplemented" a little more helpful (hopefully it's not part of the cached build?).

kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 9, 2025
In ziglang#24121 the CI unhelpfully fails with:
  unimplemented
  Aborted
Change the panic function to a macro to report caller name and line:
  wasi_snapshot_preview1_fd_write:767: test
@kevinboulain
Copy link
Contributor Author

kevinboulain commented Jun 9, 2025

I've mucked around a bit: if i check out ziglang/zig-bootstrap@7493858, apply ziglang/zig-bootstrap@773262e, build with the host version:

nix-shell -p cmake ninja zstd zlib --run "export CC='`pwd`/../zig-bootstrap/out/host/bin/zig cc -target x86_64-linux-musl -mcpu=baseline'; export CXX='`pwd`/../zig-bootstrap/out
/host/bin/zig c++ -target x86_64-linux-musl -mcpu=baseline'; mkdir build-release; cd build-release; cmake .. -DCMAKE_PREFIX_PATH=`pwd`/../zig-bootstrap/out/host/ -DCMAKE_BUILD_TYPE=Release -D
ZIG_TARGET_TRIPLE=x86_64-linux-musl -DZIG_TARGET_MCPU=baseline -DZIG_STATIC=ON -DZIG_NO_LIB=ON -GNinja"
nix-shell -p ninja --run "cd build-release; ninja"

It goes further than the CI but fails when linking:

[18/19] Linking CXX executable zig2                                                                                                                                                            
FAILED: zig2                                                                                                                                                                                   
: && /srv/users/ether/sources/others/zig-bootstrap/out/host/bin/zig  c++ -target x86_64-linux-musl -mcpu=baseline -O3 -DNDEBUG -Wl,-z,stack-size=0x10000000 CMakeFiles/zig2.dir/zig2.c.o [...]
ld.lld: error: undefined symbol: llvm::raw_fd_ostream::raw_fd_ostream(llvm::StringRef, std::__1::error_code&, llvm::sys::fs::OpenFlags)                                                        
>>> referenced by zig_llvm.cpp:227 (/srv/users/ether/sources/others/zig/src/zig_llvm.cpp:227)                                                                                                  
>>>               zig_llvm.cpp.o:(ZigLLVMTargetMachineEmitToFile) in archive zigcpp/libzigcpp.a
[...]

Is it because I'm using the host version? I'm still waiting on zig-x86_64-linux-musl-baseline. I had a previous build and started from scratch when I hit the cmake issue (just in case something isn't cleanly rebuilt) but IIRC it was failing way earlier when invoking zig cc (something about aro not being able to compile C yet). EDIT: Actually, I can't seem to use zig-x86_64-linux-musl-baseline because cmake can't find LLVM (no lib/cmake in this directory). I guess I don't understand what I'm expected to use exactly.

So, to be honest I'm not quite sure what I'm chasing since this step seems to build for me? Some guidance would be appreciated if it's an issue on my side and not the CI's. In the meantime I've pushed an additional commit so I can actually tell which function isn't implemented (so I can at least cross reference against git history).

@kevinboulain kevinboulain marked this pull request as ready for review June 9, 2025 15:06
@kevinboulain kevinboulain marked this pull request as draft June 10, 2025 10:10
kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 10, 2025
In ziglang#24121 the CI unhelpfully fails with:
  unimplemented
  Aborted
Change the panic function to a macro to report caller name and line:
  wasi_snapshot_preview1_fd_write:767: test
kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 10, 2025
…_open

This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
@kevinboulain
Copy link
Contributor Author

kevinboulain commented Jun 10, 2025

Okay, my bad, I somehow missed the zig build update-zig1 that happens on the CI. That explains why only this particular instance is failing with the introduction of a new file (see commit).

@kevinboulain kevinboulain marked this pull request as ready for review June 10, 2025 13:28
kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 10, 2025
…_open

This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
@kevinboulain kevinboulain force-pushed the cachedirtag branch 2 times, most recently from 691639b to 27f4b7c Compare June 10, 2025 14:16
kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 10, 2025
…_open

This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
@@ -399,6 +399,49 @@ static void DirEntry_unlink(uint32_t de) {
des[de].host_path = NULL;
}

static enum wasi_errno FileDescriptor_open(uint32_t de, uint32_t oflags, uint64_t fs_rights_base, uint32_t fdflags, FILE **stream) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of hard to review the logic change here when it's combined with a refactor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I've separated the refactor commit from the logic change. It feels a bit artificial because it's a one line change that has no reason to be here once the new & existing entry flows are unified, but if it helps the review.

@kevinboulain
Copy link
Contributor Author

I dusted off an old macOS but I can't repro the CI failure (I hope I'm not being dense again):

export ZIG_HOST_TARGET_TRIPLE=x86_64-macos.10.11 # To avoid the __ulock_wait issue since this version is not supported.
export ZIG_GLOBAL_CACHE_DIR=/tmp/zig-global-cache
rm -rf "$ZIG_GLOBAL_CACHE_DIR"
export ZIG_LOCAL_CACHE_DIR=/tmp/zig-local-cache
rm -rf "$ZIG_LOCAL_CACHE_DIR"

git clean -fxd
git log --oneline -1
27f4b7c1ca (HEAD -> cachedirtag, origin/cachedirtag) Compilation: write CACHEDIR.TAG

cc -o bootstrap bootstrap.c
./bootstrap
clang -o zig-wasm2c stage1/wasm2c.c -O2 -std=c99
./zig-wasm2c stage1/zig1.wasm zig1.c
clang -o zig1 zig1.c stage1/wasi.c -std=c99 -Os -lm
./zig1 lib build-exe -ofmt=c -lc -OReleaseSmall --name zig2 -femit-bin=zig2.c -target x86_64-macos.10.11 --dep build_options --dep aro -Mroot=src/main.zig -Mbuild_options=config.zig -Maro=lib/compiler/aro/aro.zig
./zig1 lib build-obj -ofmt=c -OReleaseSmall --name compiler_rt -femit-bin=compiler_rt.c -target x86_64-macos.10.11 -Mroot=lib/compiler_rt.zig
clang -o zig2 zig2.c compiler_rt.c -std=c99 -O2 -fno-stack-protector -Istage1 -Wl,-stack_size,0x10000000 -pthread
zig2.c:436914:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 436914 |  t0.f1 = zig_mulo_u64(&t0.f0, a0, a1, UINT8_C(64));
        |                       ^~~~~~
stage1/zig.h:1022:43: note: passing argument to parameter 'res' here
 1022 | static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:436935:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 436935 |  t0.f1 = zig_addo_u64(&t0.f0, a0, a1, UINT8_C(64));
        |                       ^~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:542244:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 542244 |  t2.f1 = zig_addo_u64(&t2.f0, a0, a1, UINT8_C(64));
        |                       ^~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:1126172:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 1126172 |    t15.f1 = zig_addo_u64(&t15.f0, t9, t14, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:1622983:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 1622983 |  t5.f1 = zig_addo_u64(&t5.f0, t2, t4, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2096284:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2096284 |  t0.f1 = zig_subo_u64(&t0.f0, a0, a1, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2406528:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2406528 |   t13.f1 = zig_mulo_u64(&t13.f0, t9, t12, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:1022:43: note: passing argument to parameter 'res' here
 1022 | static inline bool zig_mulo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2601115:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2601115 |   t10.f1 = zig_addo_u64(&t10.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2601124:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2601124 |   t13.f1 = zig_addo_u64(&t13.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2601157:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2601157 |   t13.f1 = zig_addo_u64(&t13.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2710884:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2710884 |    t21.f1 = zig_addo_u64(&t21.f0, t12, t13, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2710950:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2710950 |    t21.f1 = zig_addo_u64(&t21.f0, t13, t12, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711126:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711126 |    t16.f1 = zig_subo_u64(&t16.f0, t6, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711174:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711174 |    t16.f1 = zig_subo_u64(&t16.f0, t6, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711241:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711241 |   t16.f1 = zig_subo_u64(&t16.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711248:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711248 |   t23.f1 = zig_subo_u64(&t23.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711256:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711256 |   t23.f1 = zig_addo_u64(&t23.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711289:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711289 |   t23.f1 = zig_subo_u64(&t23.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711295:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711295 |   t23.f1 = zig_addo_u64(&t23.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711452:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711452 |    t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711462:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711462 |    t15.f1 = zig_addo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711505:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711505 |    t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711553:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711553 |    t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711563:26: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711563 |    t15.f1 = zig_addo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                          ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711605:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711605 |   t15.f1 = zig_subo_u64(&t15.f0, t3, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711612:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711612 |   t23.f1 = zig_subo_u64(&t23.f0, t2, t3, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711620:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711620 |   t23.f1 = zig_addo_u64(&t23.f0, t2, t3, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711719:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711719 |   t13.f1 = zig_subo_u64(&t13.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711726:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711726 |   t14.f1 = zig_subo_u64(&t14.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711734:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711734 |   t14.f1 = zig_addo_u64(&t14.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711764:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711764 |   t14.f1 = zig_subo_u64(&t14.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2711770:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2711770 |   t14.f1 = zig_addo_u64(&t14.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2745038:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2745038 |   t21.f1 = zig_addo_u64(&t21.f0, t7, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2926885:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2926885 |   t10.f1 = zig_subo_u64(&t10.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2926894:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2926894 |   t13.f1 = zig_subo_u64(&t13.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:2926927:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 2926927 |   t13.f1 = zig_subo_u64(&t13.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3227776:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3227776 |  t1.f1 = zig_addo_u64(&t1.f0, a0, t0, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3227782:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3227782 |  t5.f1 = zig_addo_u64(&t5.f0, t4, t0, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3227976:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3227976 |   t14.f1 = zig_subo_u64(&t14.f0, t5, t4, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3228054:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3228054 |   t10.f1 = zig_addo_u64(&t10.f0, t2, t6, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3228063:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3228063 |   t13.f1 = zig_addo_u64(&t13.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3228107:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3228107 |   t13.f1 = zig_addo_u64(&t13.f0, t6, t2, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3416733:25: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3416733 |   t14.f1 = zig_addo_u64(&t14.f0, t5, t4, UINT8_C(64));
         |                         ^~~~~~~
stage1/zig.h:806:43: note: passing argument to parameter 'res' here
  806 | static inline bool zig_addo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3482408:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3482408 |  t1.f1 = zig_subo_u64(&t1.f0, a0, t0, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
zig2.c:3482414:23: warning: incompatible pointer types passing 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
 3482414 |  t5.f1 = zig_subo_u64(&t5.f0, t4, t0, UINT8_C(64));
         |                       ^~~~~~
stage1/zig.h:914:43: note: passing argument to parameter 'res' here
  914 | static inline bool zig_subo_u64(uint64_t *res, uint64_t lhs, uint64_t rhs, uint8_t bits) {
      |                                           ^
45 warnings generated.

./zig2 build -Dno-lib
echo $?
0

./zig-out/bin/zig test test/behavior.zig
[...]
1985 passed; 95 skipped; 0 failed.

kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 12, 2025
This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
kevinboulain added a commit to kevinboulain/zig that referenced this pull request Jun 12, 2025
This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
kevinboulain and others added 4 commits June 20, 2025 21:47
In ziglang#24121 the CI unhelpfully fails with:
  unimplemented
  Aborted
Change the panic function to a macro to report caller name and line:
  wasi_snapshot_preview1_fd_write:767: test
So that opening an existing or new file can share the same code path
(but opening an existing file isn't yet used elsewhere so this commit
should behave the same).
Timestamping is left to DirEntry_create, I believe it behaves the same.
This occurred in ziglang#24121 because the
global and local CACHEDIR.TAG are both /cache/CACHEDIR.TAG.
Write a CACHEDIR.TAG file in the global and local cache directories.
See ziglang#8210 for context and ziglang#14875 for a previous attempt.

Co-authored-by: Manlio Perillo <[email protected]>
@kevinboulain
Copy link
Contributor Author

kevinboulain commented Jun 20, 2025

Thanks for rerunning the CI. It passed (but I can't explain it).
Also, I've rebased since there were a few conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants