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

Make package sources independent #57

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

roberth
Copy link
Collaborator

@roberth roberth commented Jan 18, 2023

This prevents unnecessary rebuilds of packages that haven't really changed, except for a hash that included irrelevant sources.

By applying a trivial source filter, we create a new store path that only contains the subdirectory that the build cares about.

This isn't 100% compatible with all projects, as some packages might "legitimately" depend on files outside of their own directory. We could support this by adding an option for sources to be unioned, but a source union function isn't available, yet. For progress, check NixOS/nixpkgs#112083

As a workaround we may allow the filtering to be disabled entirely. This could be implemented as a packages.<name>.filteredSource option with a default, but for now that seems over-engineered.

This prevents unnecessary rebuilds of packages that haven't really
changed, except for a hash that included irrelevant sources.

By applying a trivial source filter, we create a new store path
that only contains the subdirectory that the build cares about.

This isn't 100% compatible with all projects, as some packages might
"legitimately" depend on files outside of their own directory. We
could support this by adding an option for sources to be unioned,
but a source union function isn't available, _yet_. For progress,
check NixOS/nixpkgs#112083

As a workaround we may allow the filtering to be disabled entirely.
This could be implemented as a `packages.<name>.filteredSource`
option with a default, but for now that seems over-engineered.
@roberth roberth marked this pull request as ready for review January 18, 2023 14:44
@roberth roberth requested a review from srid January 18, 2023 14:44
@roberth roberth merged commit c6ff897 into master Jan 18, 2023
@srid srid deleted the make-package-src-independent branch January 31, 2023 22:42
srid added a commit that referenced this pull request Feb 22, 2023
This reverts #57, and resolves #88.
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.

2 participants