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
fetchRepoProject: fixes; more options #24347
Conversation
@spacekitteh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LnL7 to be a potential reviewer. |
repo sync --jobs=$NIX_BUILD_CORES --current-branch | ||
rm -rf $out/.repo | ||
${optionalString createMirror "rm -rf $out/.repo"} |
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.
is .repo reproducible?
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.
Whoops, that should be !createMirror
🤒
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.
But, it is basically the collection of all the .git folders.
mkdir ./.repo/local_manifests | ||
for local_manifest in ${concatMapStringsSep " " toString localManifests} | ||
for local_manifest in ${concatMapStringsSep " " toString local_manifests} | ||
|
||
do | ||
cp $local_manifest ./.repo/local_manifests/$(stripHash $local_manifest; echo $strippedName) |
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.
I would put quotes around arguments:
${concatMapStringsSep "\n" (manifest: ''
cp '${manifest}' "./.repo/local_manifests/$(stripHash '${manifest}'; echo $strippedName)"
'') local_manifests}
because strings are supplied by user.
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.
But they are paths, not strings
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.
True. Then it is only a matter of taste, what loop is preferred.
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.
I think technically a path with a space in name
can exist in Nix. And the user can create it easily. I don't think NixPkgs is anywhere close to being space-clean, though…
"--manifest-url=${manifest}" | ||
"--manifest-branch=${rev}" | ||
"--depth=1" | ||
#TODO: fetching clone.bundle seems to fail spectacularly inside a sandbox. |
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.
it probably requires network access.
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.
But if this is a fixed-output derivation it should get network access?
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.
The problem is because of #24345
@@ -40,7 +63,6 @@ stdenv.mkDerivation { | |||
]; | |||
|
|||
buildInputs = [git gitRepo cacert] ++ optional (gnupg != null) [gnupg] ; |
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.
Should not this have been optional (gnupg != null) gnupg
or optionals (gnupg != null) [gnupg]
?
No description provided.