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

zig fetch errors with sha256 git repositories #21888

Open
GalaxyShard opened this issue Nov 2, 2024 · 3 comments · May be fixed by #22222
Open

zig fetch errors with sha256 git repositories #21888

GalaxyShard opened this issue Nov 2, 2024 · 3 comments · May be fixed by #22222
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. error message This issue points out an error message that is unhelpful and should be improved.
Milestone

Comments

@GalaxyShard
Copy link

Zig Version

0.14.0-dev.2097+d30e28754

Steps to Reproduce and Observed Behavior

Repro:

$ zig fetch --save git+https://codeberg.org/GalaxyShard/zig-nds-bindings.git
error: unable to iterate refs: EndOfStream

Or alternatively:

$ zig build
/home/galaxyshard/projects/abcbuild.zig.zon:14:20: error: unable to iterate refs: EndOfStream
            .url = "git+https://codeberg.org/GalaxyShard/zig-nds-bindings.git#297a06aab678414a350cc9bb68b5705b9969913601397c065dc847e1610d2200",
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(I believe there is also supposed to be a path seperator between the project name and build.zig.zon)

Expected Behavior

The repository should be fetched and checked out without error, whether it uses sha256 or sha1.

@GalaxyShard GalaxyShard added the bug Observed behavior contradicts documented or intended behavior label Nov 2, 2024
@liinyun
Copy link

liinyun commented Nov 16, 2024

I have the same problem in fedora 40, zig version = 0.13.0

@ianprime0509
Copy link
Contributor

The current Git package fetching code only supports SHA-1 repositories, but it should be reasonably straightforward to expand it to support SHA-256: the underlying pack format is the same (except with all SHA-1 hashes replaced with SHA-256 hashes), and the Git protocol allows servers to indicate which hash format(s) they support via the object-format capability. I hope to try implementing this soon.

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label Nov 19, 2024
@andrewrk andrewrk added this to the 0.15.0 milestone Nov 19, 2024
@andrewrk andrewrk added error message This issue points out an error message that is unhelpful and should be improved. and removed bug Observed behavior contradicts documented or intended behavior labels Nov 19, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Nov 20, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Nov 23, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Nov 24, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Dec 13, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Dec 13, 2024
@ianprime0509
Copy link
Contributor

The main part of this issue is now covered by #22222, which I just opened. The other part (missing path separator between the project name and build.zig.zon) was fixed by #22032.

ianprime0509 added a commit to ianprime0509/zig that referenced this issue Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. error message This issue points out an error message that is unhelpful and should be improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants