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

Prefetch-less crate2nix by using builtin.fetchGit again, once it has submodule support #81

Closed
kolloch opened this issue Jan 31, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@kolloch
Copy link
Collaborator

kolloch commented Jan 31, 2020

I would love to make crate2nix not needing expensive prefetches in the normal case.

We do not have private repository support yet but I guess it should work similarly.

I'd love to understand why some people would not like using Cargo.lock files for this. I heard that some people don't check in Cargo.lock files to avoid conflicts. Rust 1.41 even changed the lock file format for this to make conflicts less likely.

@kolloch kolloch added the help wanted Extra attention is needed label Jan 31, 2020
@kolloch
Copy link
Collaborator Author

kolloch commented Feb 10, 2020

I learned that:

  1. builtins.fetch* run as part of the eval phase.
  2. Output derivations such as pkgs.fetchurl run during the instantiation phase.

Therefore, using builts.fetchurl might lead to non-parallel fetches :( Tell me if I understood incorrectly. @nmattia

@nmattia
Copy link

nmattia commented Feb 10, 2020

@kolloch here are some thoughts:

if people don't commit the Cargo.lock then they probably don't care about reproducible builds. Then you might as well have a first derivation that downloads the crates (before the build). You can use cargo-vendor and use a fixed-output derivation (that's what nixpkgs uses) or simply disable the sandbox (or set it to relaxed and use __noChroot = true). The fixed-output derivation is likely to break builds though, since building the derivation twice will likely result in different shas being produced (depending on the state of crates.io). Alternatively you can take the napalm approach and start a local registry with a snapshot.

Hope it helps!

@kolloch
Copy link
Collaborator Author

kolloch commented Feb 19, 2020

I think for now I will actually keep prefetching for git sources because than the fetching can run in the instantiation phase...

@kolloch kolloch closed this as completed Feb 19, 2020
@balsoft
Copy link
Contributor

balsoft commented Oct 29, 2020

Related: #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants