Skip to content
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

Using zap with BTRFS on Linux 6.5.0 causes a package hash mismatch #46

Open
MarcusWagberg opened this issue Sep 27, 2023 · 6 comments
Open
Labels

Comments

@MarcusWagberg
Copy link

MarcusWagberg commented Sep 27, 2023

Versions:
zig 0.11.0
zap 0.1.14-pre

Steps to reproduce:

  1. Create a new zig project with zig init-exe
  2. Create a build.zig.zon file from the example in the README:
.{
    .name = "My example project",
    .version = "0.0.1",

    .dependencies = .{
        // zap v0.1.14-pre
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.14-pre.tar.gz",
            .hash = "122067d12bc7abb93f7ce623f61b94cadfdb180cef12da6559d092e6b374202acda3",
        }
    }
}
  1. Clear zig cahce e.g run rm -rf ~/.cache/zig/ on linux
  2. Run zig build run

Output:

Fetch Packages [1/1] zap... /home/marcus/Downloads/b/build.zig.zon:9:21: error: hash mismatch: expected: 122067d12bc7abb93f7ce623f61b94cadfdb180cef12da6559d092e6b374202acda3, found: 12202d26b8c618b661ac5c9f96c11926f931fbea6afd302b7e71df9b3d256e79db91
            .hash = "122067d12bc7abb93f7ce623f61b94cadfdb180cef12da6559d092e6b374202acda3",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@MarcusWagberg
Copy link
Author

MarcusWagberg commented Sep 27, 2023

If i use the hash 12202d26b8c618b661ac5c9f96c11926f931fbea6afd302b7e71df9b3d256e79db91 instead i get another hash mismatch:

Fetch Packages [2/2] zap.facil.io... /home/marcus/.cache/zig/p/12202d26b8c618b661ac5c9f96c11926f931fbea6afd302b7e71df9b3d256e79db91/build.zig.zon:8:21: error: hash mismatch: expected: 12200301960bbde64052db068cf31a64091ce1f671898513d9b8d9e2be5b0e4b13a3, found: 12206956e1c8e1af5fd28e44d534e4e131299545fa0676e1edc04bf02eb2185e266a
            .hash = "12200301960bbde64052db068cf31a64091ce1f671898513d9b8d9e2be5b0e4b13a3",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@gcoakes
Copy link

gcoakes commented Oct 5, 2023

I hope I'm not taking this issue on a tangent, but do you happen to be using Linux >6.4.12 with a BTRFS filesystem. I had nearly identical symptoms with a different package. Downgrading my kernel fixed the issue for me. For reference: ziglang/zig#17095

@MarcusWagberg
Copy link
Author

I am using BTRFS on Linux 6.5.0 so this almost guaranteed to be the issue, i was unaware of the broader issue with BTRFS on certain 6.4.x and 6.5.x releases of linux.

@MarcusWagberg MarcusWagberg changed the title Using zap v0.1.14-pre causes a package hash mismatch Using zap with BTRFS on Linux 6.5.0 causes a package hash mismatch Oct 9, 2023
@MarcusWagberg
Copy link
Author

There are two workarounds for this issue:

  1. Use a kernel that is not in the > 6.4.12 && < 6.5.6 range (my fix)
  2. If using zig master set ZIG_BTRFS_WORKAROUND=1

See for more info:
IterableDir does not iterate over all contents created after opening (Linux BTRFS)
package manager: Transitive dependencies have incorrect hash

@MarcusWagberg
Copy link
Author

@renerocksai should this issue be closed since it has now been resolved for me or should it remain open for others refrance?

@renerocksai
Copy link
Member

@MarcusWagberg I'll better keep it open until zig 0.12.0 arrives.

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

No branches or pull requests

3 participants