Skip to content

Fix dependency filtering for shellFor #819

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

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Conversation

michaelpj
Copy link
Collaborator

It looks like this got broken in #776 when we changed to working with individual components. Have a look, I don't really know what I'm doing here. I expanded the comment to hopefully make it clear.

I had to refactor this a bit to understand what was going on, but the
kicker is two changes:

  • removeSelectedInput was only removing library components. This was
    fine when we were only looking at the all components, since they
    always dependend on libraries. But now we're looking at all kinds of
    components, and these can, for example, depend on internal libraries.
    So we need to filter out dependencies on any component, not just a
    library component. This fixes shellFor depends on some of the selected packages #818
  • The filtering on nativeBuildInputs was wrong, since it was using the
    filtering function that filters packages, not the one that filters
    derivations. I didn't observe this causing a bug but it seems wrong.

I had to refactor this a bit to understand what was going on, but the
kicker is two changes:
- `removeSelectedInput` was only removing *library* components. This was
fine when we were only looking at the `all` components, since they
always dependend on libraries. But now we're looking at all kinds of
components, and these can, for example, depend on internal libraries.
So we need to filter out dependencies on *any* component, not just a
library component. This fixes #818
- The filtering on `nativeBuildInputs` was wrong, since it was using the
filtering function that filters *packages*, not the one that filters
*derivations*. I didn't observe this causing a bug but it seems wrong.
@hamishmack hamishmack merged commit 2db0b60 into master Aug 14, 2020
@iohk-bors iohk-bors bot deleted the fix/shell-for-deps branch August 14, 2020 02:06
booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
I had to refactor this a bit to understand what was going on, but the
kicker is two changes:
- `removeSelectedInput` was only removing *library* components. This was
fine when we were only looking at the `all` components, since they
always dependend on libraries. But now we're looking at all kinds of
components, and these can, for example, depend on internal libraries.
So we need to filter out dependencies on *any* component, not just a
library component. This fixes input-output-hk#818
- The filtering on `nativeBuildInputs` was wrong, since it was using the
filtering function that filters *packages*, not the one that filters
*derivations*. I didn't observe this causing a bug but it seems wrong.
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.

shellFor depends on some of the selected packages
2 participants