fetchFromGitProvider: init (optional dynamically switchable after <pkg>.overrideAttrs)#462034
fetchFromGitProvider: init (optional dynamically switchable after <pkg>.overrideAttrs)#462034ShamrockLee wants to merge 26 commits intoNixOS:masterfrom
<pkg>.overrideAttrs)#462034Conversation
24aed81 to
c4bbde3
Compare
6c38f00 to
5772760
Compare
This comment was marked as resolved.
This comment was marked as resolved.
82c91ab to
733b8b9
Compare
|
|
|
Now it passes all the existing tests, but the "CPU time increased by 14.5%" performance overhead is not quite acceptable. I'll try to optimize it. Performance comparisonThis compares the performance of this branch against its pull request base branch (e.g., 'master') For further help please refer to: ci/README.md Unchanged values
Updated values
Footnotes
|
6932aa3 to
ff736c3
Compare
cb8d206 to
351c182
Compare
…_structuedAttrs is true
…tputHashAlgo values
…fetchgitSpecialArgs
9ee20e6 to
cc205a2
Compare
This PR introduces
fetchFromGitProvider, a general foundation for all otherfetchFrom<Git hosting provider>constructors.Not only can it choose between
fetchgit(for Git-related features) andfetchgit(for hash stability) automatically, but it can optionally switch betweenfetchgitandfetchzipdynamically after<pkg>.overrideAttrsoverriding based on the overridden arguments.Such a black magic depends on the fact that
fetchurl,fetchzip, andfetchgitpass arguments unconditionally (i.e., without thelib.optionalAttrspart ofstdenv.mkDerivation ({ ... } // lib.optionalAttrs myCondition { ... })).By making
fetchgithubpass unconditionally tofetchgit,fetchzip, andstdenvNoCC.mkDerivation, dynamic switching is achievable.The unconditional passing to
stdenvNoCC.mkDerivationusesnullas the generic hole-filling default value, and the unconditional passing tofetchgitis done in a depending PR listed below.Depending PRs:
It fixes
lib.makeOverridableso that it won't drop attributes from a callable attribute set it decorates.This is necessary to implement any kind of
fetchFromGitHubrestructuring withlib.extendMkDerivationchanges while keeping the automatic selection.It allows structured-attributes packages to pass
allowReferences/allowRequisitesunconditionally.leaveDotGit,nonConeMode, andsparseCheckouta default valuenull#462032It enables
fetchFromGitProvider(previouslyfetchFromGitHub) to passleaveDotGitunconditionally.useFetchGit#456226Since
fetchFromGitProviderabstracts out the fetcher-choosing part offetchFromGitHub, we need to clean upfetchFromGitHub's fetcher choosing first.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.