Skip to content

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.

- 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