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 does not resolve git+https ref to commit hash when overwriting existing dependency #21645

Closed
castholm opened this issue Oct 9, 2024 · 0 comments · Fixed by #21653
Closed
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@castholm
Copy link
Contributor

castholm commented Oct 9, 2024

Zig Version

0.14.0-dev.1710+8ee52f99c

Steps to Reproduce and Observed Behavior

  1. Run zig init in an empty directory.
  2. Run zig fetch --save=glfw https://pkg.machengine.org/glfw/e6f377baed70a7bef9fa08d808f40b64c5136bf6.tar.gz (the actual tarball is irrelevant, I used slimsag/glfw as an example as this was where I encountered the issue).
  3. Open build.zig.zon and observe that the dependency glfw has been added with the URL from step 2.
  4. Run zig fetch --save=glfw git+https://github.com/slimsag/glfw (as with above, the actual repo is irrelevant as long as it's a git repository).
  5. Open build.zig.zon and note that the url was changed to git+https://github.com/slimsag/glfw, without a commit hash fragment.

If you delete the glfw entry and run zig fetch --save=glfw git+https://github.com/slimsag/glfw anew, its url is resolved to the expected git+https://github.com/slimsag/glfw#e6f377baed70a7bef9fa08d808f40b64c5136bf6 with the commit hash fragment.

Expected Behavior

Overwriting the existing dependency im step 4 resolves the ref to a commit hash as expected.

@castholm castholm added the bug Observed behavior contradicts documented or intended behavior label Oct 9, 2024
ianprime0509 added a commit to ianprime0509/zig that referenced this issue Oct 10, 2024
@andrewrk andrewrk added this to the 0.14.0 milestone Oct 10, 2024
der-teufel-programming pushed a commit to der-teufel-programming/zig that referenced this issue Oct 11, 2024
richerfu pushed a commit to richerfu/zig that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants