-
Notifications
You must be signed in to change notification settings - Fork 122
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
fix zig fetch command in README #130
base: devel
Are you sure you want to change the base?
Conversation
My issue about that was closed so I don't think it will be merged #120 |
That sounds like a reasonable requirement, but I can't find it in official Zig documentation. If you can point me to it I'll gladly merge this. |
It turns out this works and adds latest commit hash in build.zig.zon. So no need to manually get hash from github zig fetch --save git+https://github.com/Not-Nik/raylib-zig#devel .@"raylib-zig" = .{
.url = "git+https://github.com/Not-Nik/raylib-zig?ref=devel#58df62807f62bef1db79538d04b37b9f79909d0a",
.hash = "1220df9aa89d657f5dca24ab0ac3d187f7a992a4d27461fd9e76e934bf0670ca9a90",
},
|
That definitely seems like a better solution than what this PR proposes, however, I'm still not entirely convinced. |
I'm also not entirely convinced. Just saw it on kristoff_it's stream |
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to clarify that urls should reference immutable data.
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to clarify that urls should reference immutable data.
I've created PR to update the ziglang docs here: ziglang/zig#21120 |
|
All URLs within build.zig.zon files must point to archives that never change. However, the zig fetch command in the README.md adds a URL that points to the `devel` git branch whose content changes whenever the `devel` branch is updated. I've updated the README a url that zig will resolve to a SHA before it writes it to the zon file.
13e2e62
to
9e18cc0
Compare
Thanks @kristoff-it that's a cool trick. I've updated the PR to use it. The user no longer needs to resolve the branch to a SHA themselves, now zig does it for them. |
If accepted, github link style should also be changed in project_setup scripts |
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to clarify that urls should reference immutable data.
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to clarify that urls should reference immutable data.
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to clarify that urls should reference immutable data.
I'm not too proficient in PowerShell scripts and I don't have a Windows machine available right now. Let's hope this works. |
There's been some proliferation of dependency URLs that reference mutable data such as links to git branches that can change. This has resulted in broken projects, i.e. * https://github.com/RohanVashisht1234/raylib_rain_train/blob/9eef9de94c511f2eb4fe5db1d6abd574ee245c9b/build.zig.zon * rcmagic/ZigFightingGame@4b64353 There's also disagreement about whether it's fine for URL's to point to git branches, i.e. Not-Nik/raylib-zig#130 This updates the docs to mention that zig won't be able to use URLs if their content changes.
Hello, is this PR going to be merged? Is there anything else that needs to be done? |
All URLs within build.zig.zon files must point to archives that never change. However, the zig fetch command in the README.md adds a URL that points to the
devel
git branch whose content changes whenever thedevel
branch is updated.I've updated the README to instruct users to first pick a git SHA to reference if they want to add this project to their build.zig.zon file, then use that sha in their URL.