-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
"tags" attribute should be usable with "select" #2971
Comments
I don't know much past what I posted on #1904, perhaps @gregestren can comment? |
"tags" is nonconfigurable for practical reasons, not principled ones. In short, multiple places in Bazel's codebase expect to know the value of "tags" before the build's configuration is known. This means they can't get their answer from a select. We can conceivably refactor that code away and make tags selectable. But that would be a mini-project for whoever wants to take up the effort. I'm glad to review anyone's proposed cleanup, but I'm not prioritizing this work myself. Examples:
I'd expect the cleanup to be relatively straightforward but not entirely trivial. |
As mentioned on #7911 (comment), the challenge to make this viable is to figure out how to make bazel/src/main/java/com/google/devtools/build/lib/packages/TestTargetUtils.java Lines 113 to 114 in 1f684e1
work without a This code unconditionally iterates over all values of |
Closing for the below reasons: This can't be practically prioritized without a focused effort by a community contributor. This requires vetting how much logical complexity has to be considered due to the dependencies described in previous comments and evaluating the feature's benefit vs. the new complexity's maintenance cost. It's also possible (maybe even preferable?) to explore alternative approaches that reduce the need to use So basically, it's a design effort. And one that needs to evaluate the specific needs for this flag vs. alternatives, which varies from case to case. It's still a good design question but let's only keep this open when/if someone wants to own that. |
For our integration tests, we're using one iml_test rule for all platforms (Windows, Linux, and macOS). However, the "block-network" tag prevents Android Studio from starting up on macOS due to how sandboxing is implemented, so we need to disable it there. Unfortunately, Bazel doesn't allow for using "select" for tags (see bazelbuild/bazel#2971), so we instead generate per-platform rules. The rules are bundled into a test_suite for easier use. Bug: 242358149 Test: this will be tested by the other changes in this topic Change-Id: I7669e4de2b8b7673177d4d368d00b147abde73e6
On Pigweed we ran into the exact same use case: we want to use
I agree with this sentiment. But it seems like there's a more fundamental problem here than |
On quick glance I didn't see anything obvious that required execution info that early (most consumes of The only other concern I'd have is if CI expects to know the execution info tags. Google's CI cares about knowing execution machine requirements with nothing more informed than a bazel query. We could always check with them on this point. |
I implemented support for See: bazel/src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxedSpawnRunner.java Lines 303 to 308 in e393673
|
It does not appear to work for us: see https://issues.pigweed.dev/issues/312452379. (Should have linked to it in the original comment, sorry!) |
One useful-but-slightly-gross hack: |
Reported by @gorset in #2669 (comment):
Do we want the "tags" attribute to be configurable via "select"? If not, why not? (Would be good to document this decision here.)
Ping @ahumesky who replied on related #1904 earlier.
The text was updated successfully, but these errors were encountered: