Skip to content

Fetcher improvements#59858

Closed
lheckemann wants to merge 2 commits intoNixOS:stagingfrom
mayflower:fetcher-improvements
Closed

Fetcher improvements#59858
lheckemann wants to merge 2 commits intoNixOS:stagingfrom
mayflower:fetcher-improvements

Conversation

@lheckemann
Copy link
Copy Markdown
Member

Motivation for this change

More clarity in store path names, more abstraction

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@lheckemann
Copy link
Copy Markdown
Member Author

Eval failure exists on staging as well.

Copy link
Copy Markdown
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the sources are named "source" on purpose, see:

and I think @domenkozar did a talk on why this was a good change. We should talk a bit on if it is a good idea to go back to the previous way. cc @edolstra

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Apr 18, 2019

One of the points raised in favor of this is the idea that the name parameter would make it harder to update the name of a package, but not the source's hash. Unfortunately, that doesn't actually work. The name of the package doesn't have any bearing on the sha256:

let
  pkgs = import <nixpkgs> {};

  srcWithName = name: pkgs.fetchgit {
    inherit name;
    url = "https://github.com/grahamc/ish.git";
    rev = "7edd7665edf8e33e6847d891d2ff519b492b32dc";
    sha256 = "0qjp8f82a09spz8z2idqj3w1lclr19p37877a8jscvss5a14bbda";
  };

in pkgs.writeText "example" ''
    ${srcWithName "hi"}
    ${srcWithName "there"}
    ${srcWithName "the"}
    ${srcWithName "hash"}
    ${srcWithName "is"}
    ${srcWithName "unchanged"}
  ''

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Apr 19, 2019

@GrahamcOfBorg eval

@GrahamcOfBorg GrahamcOfBorg added 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 8.has: documentation This PR adds or changes documentation labels Apr 19, 2019
@grahamc
Copy link
Copy Markdown
Member

grahamc commented Apr 19, 2019

Note the eval error on staging was fixed, and the error now is due to changes in this PR.

@edolstra
Copy link
Copy Markdown
Member

Indeed the use of source is by design. We definitely don't want to go back to the situation where every fetcher (and Hydra) produced incompatible store paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 8.has: documentation This PR adds or changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants