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

Introduce experimental fetchComposerDepsImpure #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented May 20, 2023

fetchComposerDeps works okay but since the fetching runs at evaluation time, it grinds Nix evaluator to a halt.
As a bonus, we have a finer control over what is fetched so we can limit it to a shallow fetch.

This patch adds an alternative implementation that moves the work to build time based on the experimental impure-derivations feature.
Unfortunately, the feature needs to be enabled in the daemon and can only be used by other impure derivations.
The repo derivation also will not be cached by Nix so everything will need to be re-fetched for every build.

`fetchComposerDeps` works okay but since the fetching runs at evaluation time, it grinds Nix evaluator to a halt.
As a bonus, we have a finer control over what is fetched so we can limit it to a shallow fetch.

This patch adds an alternative implementation that moves the work to build time based on the experimental `impure-derivations` feature.
Unfortunately, the feature needs to be enabled **in the daemon** and can only be used by other impure derivations.
The repo derivation also will not be cached by Nix so everything will need to be re-fetched for every build.
@@ -84,6 +84,14 @@ This is a function that, for given source, returns a derivation with a Composer

- Either `lockFile` containing an explicit path to `composer.lock` file, or `src`, which is the source directory/derivation containing the file.

### `c4.fetchComposerDepsImpure`
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should just re-use c4.fetchComposerDeps and change the implementation when passed __impure argument. We could even pass hash to get FOD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant