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

Ignore dependencies that are not Buildable #2731

Closed
wants to merge 2 commits into from

Conversation

kosmikus
Copy link
Contributor

Hopefully fixes #1725

There are two separate changes here:

  1. In the solver, we rewrite the condition trees for packages prior to solving. First, we try to extract from the condition tree of each component the condition under which the component is Buildable. Then we place all build dependencies of the package under the same condition. This should ensure that the solver treats this correctly. Note that we cannot necessarily decide whether a component is Buildable prior to solving, because the conditions can involve automatic flags.
  2. When configuring a package (this is in the library), we apply the configuration data and flag assignment in order to collapse down the condition trees of the components. We then also learn whether the components are Buildable or not. We now disregard dependencies for non-buildable components at this point. Fixing this should automatically also fix the sanity check that cabal-install applies to the install plans produced by the solver.

When doing the index conversion prior to dependency solving, we now
consider the "Buildable" flag for package components.  In particular, if
the "Buildable" flag of a component is "True" only under certain
conditions, then all build dependencies of that component will be placed
under the same conditions.
When configuring a package, the condition trees in the package
descriptions are evaluated according to the known configuration
and flag assignment.

During this process, it becomes also known whether a component
has its "Buildable" flag set to True or False. We now disregard
all dependencies of non-buildable components.
@kosmikus kosmikus changed the title Ks buildable Ignore dependencies that are not Buildable Jul 23, 2015
@23Skidoo
Copy link
Member

Do we need a test for this?

@kosmikus
Copy link
Contributor Author

@23Skidoo Fair point. I had planned to, but also wanted to get the code out there asap. I'll have a look what I can do.

@ezyang
Copy link
Contributor

ezyang commented Sep 24, 2015

When this is repushed with tests please remove action-required

@grayjay
Copy link
Collaborator

grayjay commented Jan 13, 2016

Would you like me to add some tests for this?

@23Skidoo
Copy link
Member

Sure, I think this could be merged if it had tests.

@23Skidoo
Copy link
Member

Closing in favour of #3039.

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

Successfully merging this pull request may close these issues.

dependencies are checked even if buildable is False
4 participants