Skip to content
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

Fetcher improvements #59858

Closed
wants to merge 2 commits into from
Closed

Conversation

@lheckemann
Copy link
Member

@lheckemann lheckemann commented Apr 18, 2019

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
Member Author

@lheckemann lheckemann commented Apr 18, 2019

Eval failure exists on staging as well.

Copy link
Member

@grahamc grahamc left a comment

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
Member

@grahamc 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
Member

@grahamc grahamc commented Apr 19, 2019

@grahamc
Copy link
Member

@grahamc 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
Member

@edolstra edolstra commented Apr 19, 2019

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.

@lheckemann lheckemann closed this Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.