zig
zig copied to clipboard
`zig fetch --save` puts URL in already existing `.path` entry
Zig Version
0.14.0-dev.1860+2e2927735
Steps to Reproduce and Observed Behavior
Given a build.zig.zon with a path dependency
.zqlite = .{ .path = "foo" },
when you fetch a URL dependency using
zig fetch --save https://github.com/karlseguin/zqlite.zig/archive/master.tar.gz
it puts the URL in the path field, resulting in an invalid dependency:
.zqlite = .{ .path = "https://github.com/karlseguin/zqlite.zig/archive/master.tar.gz", },
I'm providing a small repository so you can reproduce quickly: https://github.com/dermetfan/zig-issue-fetch-path
Expected Behavior
I believe it is reasonable for zig fetch --save to recognize this and write a valid dependency:
.zqlite = .{ .url = "https://github.com/karlseguin/zqlite.zig/archive/master.tar.gz", .hash = "<something>" },
side note, you should never use branch names in your url refs; only tags or commits. otherwise its bound to break almost immediately
Sure, this is just to keep the example short.