-
Notifications
You must be signed in to change notification settings - Fork 248
Determine if the tag is a ref or a rev #1665
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,9 +228,9 @@ let | |
then throw "${inputMap.${repoData.url}.rev} may not match ${repoData.ref} for ${repoData.url} use \"${repoData.url}/${repoData.ref}\" as the inputMap key if ${repoData.ref} is a branch or tag that points to ${inputMap.${repoData.url}.rev}." | ||
else inputMap.${repoData.url}) | ||
else if repoData.sha256 != null | ||
then fetchgit { inherit (repoData) url sha256; rev = repoData.ref; } | ||
then fetchgit { inherit (repoData) url sha256 rev; } | ||
else | ||
let drv = builtins.fetchGit { inherit (repoData) url ref; }; | ||
let drv = builtins.fetchGit { inherit (repoData) url ; rev = repoData.rev or repoData.ref; ref = repoData.ref or null; }; | ||
in __trace "WARNING: No sha256 found for source-repository-package ${repoData.url} ${repoData.ref} download may fail in restricted mode (hydra)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. I think a complication is that we may have a ref and a rev (which is part of what this is intending to allow). ie, I was trying to fetch a repo with no I'll update the trace message to include both. |
||
(__trace "Consider adding `--sha256: ${hashPath drv}` to the ${cabalProjectFileName} file or passing in a sha256map argument" | ||
drv); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens here if we have a
repoData.ref
but norepoData.rev
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question!
Looks like
fetchgit
'srev
attribute can either be a commit or aref
-like attribute, so I should dorev = repoData.rev or repoData.ref
instead of inheriting.