Skip to content

[5.1.0] cherrypick subpackages support #14780

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 4 commits into from
Feb 14, 2022

Conversation

katre
Copy link
Member

@katre katre commented Feb 10, 2022

This PR cherrypicks two commits that comprise subpackage support for Bazel 5.1 (#14714)

  • 41f5c23 - Splits configurable_attribute_mapper out
  • 7dbabb4 - Part 1 of subpackages - core implementation
  • 986d4bd - Part 2 of subpackages - Starlark API
  • 4399004 - Doc fixes

Fixes #14716.

@katre katre requested a review from Wyverald February 10, 2022 13:58

<p>
In general it is preferred that instead of calling this function directly
that users use the 'subpackages' module of
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the docs merged wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the double-check, let me try and fix this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that's from the original. I'll file an issue for @kkress to address this, and then add that fix in after.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it seems like it blew away some existing docs.

katre and others added 3 commits February 10, 2022 09:14
…function.

Design proposal: https://docs.google.com/document/d/13UOT0GoQofxDW40ILzH2sWpUOmuYy6QZ7CUmhej9vgk/edit#

This CL modifies the globber infrastructure to support an additional mode of listing sub-directories.

* Add new Globber Operation enum allowing, Globber implementations to
  discriminate between glob, glob w/directories and the future sub-packages
  use-case.

* Modify UnixGlob to replace Predicate and bools with UnixGlobPathDiscriminator interface for:
  a) Determining whether to traverse a sub-directory (previously was lambda)
  b) function for determing what entries to include in the List<Path> produced by UnixGlob.globAsync.

  These allow relatively simple re-use of the same logic for both subpackages and glob

4) Add a few tests for UnixGlob to ensure both cases continue to work as expected.

PiperOrigin-RevId: 421125424
Design proposal: https://docs.google.com/document/d/13UOT0GoQofxDW40ILzH2sWpUOmuYy6QZ7CUmhej9vgk/edit#

Overview:

Add StarlarkNativeModule 'subpackages' function with parameters that mirror glob()

PiperOrigin-RevId: 422652954
@katre
Copy link
Member Author

katre commented Feb 10, 2022

This also requires 41f5c23, re-trying.

@katre katre force-pushed the 5.1.0-subpackages branch from b829095 to ce076b5 Compare February 10, 2022 14:28
@katre
Copy link
Member Author

katre commented Feb 10, 2022

Ahh, the docs were fixed in 4399004, adding that now.

@Wyverald
Copy link
Member

@fweikert do we need to anything special here? this cherry-pick PR touches documentation.

@katre
Copy link
Member Author

katre commented Feb 14, 2022

@Wyverald @fweikert Any comments?

@fweikert
Copy link
Member

Looks good to me. We'll have to cherry pick some more docs changes once they're actually submitted, though.

@Wyverald Wyverald merged commit dc41a20 into bazelbuild:release-5.1.0 Feb 14, 2022
@katre katre deleted the 5.1.0-subpackages branch February 14, 2022 15:21
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.

5 participants