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

Failure to download packages when running zig build on btrfs #1428

Closed
daurnimator opened this issue Aug 29, 2023 · 8 comments
Closed

Failure to download packages when running zig build on btrfs #1428

daurnimator opened this issue Aug 29, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@daurnimator
Copy link
Contributor

Zig Version

0.11.0

Zig Language Server Version

0.11.0

Steps to Reproduce

Download the ZLS 0.11.0 release and run zig build

Expected Behavior

Build ZLS

Actual Behavior

$ zig version
0.11.0
$ zig build --help
Fetch Packages [1/3] known_folders... /var/lib/archbuild/extra-x86_64/daurnimator-0/build/zls/src/zls-0.11.0/build.zig.zon:8:21: error: hash mismatch: expected: 122048992ca58a78318b6eba4f65c692564be5af3b30fbef50cd4abeda981b2e7fa5, found: 1220206c698a1890d742a8b98acb16db99275d16f2e7fe2046c3d8f2249ed267ca71
            .hash = "122048992ca58a78318b6eba4f65c692564be5af3b30fbef50cd4abeda981b2e7fa5",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~```
@daurnimator daurnimator added the bug Something isn't working label Aug 29, 2023
@thomab
Copy link

thomab commented Sep 1, 2023

I got this too, but on master.

I didn't see any commits anywhere that should have caused this, but I could have missed something.

Did the top folder inside the tarballs always have the commit hash in the name? I didn't have any old ones to check.
If they were regenerated recently and if that's a new thing, I guess the hash would be different.

@kassane
Copy link

kassane commented Sep 5, 2023

Same problem here.

Maybe related:

@leecannon
Copy link
Member

leecannon commented Sep 5, 2023

After deleting the global cache I hit this as well, issue occurs with both master and 0.11.0.

Turns out this is an issue caused by btrfs getting the wrong hash ziglang/zig#17095, an upstream patch has been submitted to linux ziglang/zig#17095 (comment).

The hashes required on btrfs are:

--- a/build.zig.zon
+++ b/build.zig.zon
@@ -5,15 +5,15 @@
     .dependencies = .{
         .known_folders = .{
             .url = "https://github.com/ziglibs/known-folders/archive/fa75e1bc672952efa0cf06160bbd942b47f6d59b.tar.gz",
-            .hash = "122048992ca58a78318b6eba4f65c692564be5af3b30fbef50cd4abeda981b2e7fa5",
+            .hash = "1220206c698a1890d742a8b98acb16db99275d16f2e7fe2046c3d8f2249ed267ca71",
         },
         .diffz = .{
             .url = "https://github.com/ziglibs/diffz/archive/90353d401c59e2ca5ed0abe5444c29ad3d7489aa.tar.gz",
-            .hash = "122089a8247a693cad53beb161bde6c30f71376cd4298798d45b32740c3581405864",
+            .hash = "122090a5106337f6c86efeaecfedf14e1cd8f9944e8ba9c0c7fd9a9c54d860100ff7",
         },
         .binned_allocator = .{
             .url = "https://gist.github.com/antlilja/8372900fcc09e38d7b0b6bbaddad3904/archive/6c3321e0969ff2463f8335da5601986cf2108690.tar.gz",
-            .hash = "1220363c7e27b2d3f39de6ff6e90f9537a0634199860fea237a55ddb1e1717f5d6a5",
+            .hash = "122031b87e4aedc69cbc600a29aaf79317fa84d7fc4f9e619d947de121aaf637bb2a",
         },
     },
 }

@leecannon leecannon changed the title Failure to download packages when running zig build Failure to download packages when running zig build on btrfs Sep 15, 2023
@leecannon
Copy link
Member

I am no longer experiencing this issue on linux 6.5.3 (arch).

@jcalabro
Copy link

jcalabro commented Oct 1, 2023

Hey there, I'm getting this error as well when I try to build from source. I'm running Fedora 38, and here's some more info (original issue here including zls/zig version #1491).

$ df -hT | rg '/$'
/dev/nvme0n1p6 btrfs     105G   32G   71G  31% /

$ uname -a
Linux jrazor-linux 6.4.15-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep  7 00:25:01 UTC 2023 x86_64 GNU/Linux

And here's the exact error:

$ zig build
Fetch Packages [1/3] known_folders... /home/jcalabro/go/src/github.com/jcalabro/zls/build.zig.zon:9:21: error: hash mismatch: expected: 1220bb12c9bfe291eed1afe6a2070c7c39918ab1979f24a281bba39dfb23f5bcd544, found: 1220206c698a1890d742a8b98acb16db99275d16f2e7fe2046c3d8f2249ed267ca71
            .hash = "1220bb12c9bfe291eed1afe6a2070c7c39918ab1979f24a281bba39dfb23f5bcd544",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@iacore
Copy link

iacore commented Oct 3, 2023

$ uname -a
Linux jrazor-linux 6.4.15-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep  7 00:25:01 UTC 2023 x86_64 GNU/Linux

Upgrade your kernel version.

@travisstaloch
Copy link
Contributor

here is the zig issue for this: ziglang/zig#17282 (comment)

@Techatrix
Copy link
Member

workaround landed in zig: ziglang/zig#17282 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants