tree-sitter-grammars: pin rev for unstable grammars#491704
Conversation
b8cff68 to
bfab3b5
Compare
|
| codeberg = fetchFromCodeberg; | ||
| # NOTE: include other types here as required | ||
| }; | ||
| rev = attrs.rev or source.ref or "v${attrs.version}"; |
There was a problem hiding this comment.
dont we want to avoid this scenario source.ref ? if it's for the assert later, unstable version requires a pinned commit hash as rev, got '${rev or source.ref}'" would be cleaner.
There was a problem hiding this comment.
I updated it so that unstable grammars must have a rev attribute, rather than parsing it from the URL. I think that's simpler.
There was a problem hiding this comment.
Aside form the comment by @teto the idea looks good to me, thank you for working on this that that fast.
I believe we also want to make @kimburgess aware of this issue.
bfab3b5 to
ebfb1d1
Compare
|
Things done
Grammars
podandquintusegithub:owner/repo/releaseas their URL, which causesparseUrlto pass the branch name release directly as rev tofetchFromGitHub. This works on first fetch but produces hash mismatches once the branch advances.This adds a
revattribute to grammar sources that takes priority over the ref parsed from the URL, allowing the branch name to remain in the URL for nix-update compatibility while pinning the actual commit. An assertion ensures unstable grammars always resolve to a commit hash.The update script also passed
--version branchfor all unstable grammars, which tracks the default branch. Grammars with an explicit branch in their URL now pass--version branch=REFinstead.passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.