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

externals: allow package prefs to configure default not buildable #16735

Merged
merged 2 commits into from
May 21, 2020

Conversation

becker33
Copy link
Member

@becker33 becker33 commented May 20, 2020

Fixes #16734

Allows all to be configured non-buildable in packages.yaml.

The following config would only allow zlib to be built by Spack, all other packages would have to be found as externals.

packages:
  all:
    buildable: False
  zlib:
    buildable: True

includes

  • code changes
  • tests

@becker33 becker33 force-pushed the features/buildable-false-all branch from c635ec1 to ae544ce Compare May 20, 2020 01:50
# Does this spec override all_buildable
spec_reversed = (spec.name in reverse or
any(spec.package.provides(name) for name in reverse))
return not all_buildable if spec_reversed else all_buildable
Copy link
Member

Choose a reason for hiding this comment

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

Proposed simpler formulation:

# prefer specific setting for buildable
buildable = allpkgs.get(spec.name, {}).get("buildable")
# default to "all" setting
if buildable is None:
    buildable = allpkgs.get("all", {}).get("buildable", True)

This is also O(1) instead of O(n).

Copy link
Member Author

@becker33 becker33 May 20, 2020

Choose a reason for hiding this comment

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

Doesn't work for virtuals.

That's the obvious way of doing this if we didn't have #14934, but we don't have a good interface to go from spec to all virtuals it provides, which is why I went this route when creating that PR.

@tgamblin tgamblin merged commit cfb6f21 into develop May 21, 2020
@becker33 becker33 deleted the features/buildable-false-all branch June 30, 2020 23:37
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.

Add ability to toggle default state of Buildable
2 participants