Skip to content

zig fetch does not resolve git+https ref to commit hash when overwriting existing dependency #21645

@castholm

Description

@castholm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions