question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gracefully filter targets not compatible with the current Platform

See original GitHub issue

There was a discussion recently on bazel-discuss about selectively building targets based on a platform: https://groups.google.com/forum/#!topic/bazel-discuss/U6sFbPWiXGM

Greg Estren suggested:

Ultimately we should integrate this with Bazel’s upcoming platform semantics (which builds on the concepts above) to provide as much granularity and flexibility as you want.

This is a request to do exactly that. I’d like to be able to say “build for this platform, but gracefully exclude targets that aren’t compatible” (where gracefully means not failing the build). Perhaps a --filter_unsupported_platforms flag? This would let a CI script do something conceptually like for platform in [list of supported platforms]; bazel build --platform=$platform --filter_unsupported_platforms //...; done, while maintaining targets in the repository that aren’t compatible with all platforms.

A suggested alternative in that thread is to use --build_tag_filters/--test_tag_filters. I’ve found this to be clunky because those flags don’t accumulate when passed multiple times - if you have configurations in tools/bazel.rc that set these flags, you can’t subsequently add another copy of --{build/test}_tag_filters on the command-line, or the value from bazel.rc will be overwritten.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:38 (21 by maintainers)

github_iconTop GitHub Comments

9reactions
gregestrencommented, Feb 23, 2020

Just a quick update: @philsc is working on implementation now!

6reactions
gregestrencommented, Dec 4, 2018

I’ve had a few detailed email conversations with @katre about this, to the point where I’m interested in speccing up a brainstorm proposal of what it might look like.

With Bazel’s platform integration steadily humming along, now may be a good time to follow through on this. If there’s still interest. There are still some unresolved design considerations, hence the desire for the brainstorm proposal.

If anyone currently wants this, please ping here.

If anyone wants to be part of the design discussion, also ping here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing metrics targets | OpenShift Container Platform 4.10
The target is currently down and not being scraped for metrics. Source filters: Platform. Platform-level targets relate only to default OpenShift Container ...
Read more >
Device Filtering and Compatibility | App Submission and Testing
Customers with incompatible devices will not see the app as available to be installed. Using the filters in your app's manifest, Amazon Appstore ......
Read more >
Cannot change Target Framework on Several Projects From ...
In our case, the issue was that we were referencing a custom targets file that was created for the entire solution. even though...
Read more >
Target Framework Filtering and a Pending Breaking Change
We are deploying a change to make the nuget.org Search API filter out packages (and versions of packages) that are incompatible with the ......
Read more >
Device compatibility overview - Android Developers
If the app feature is not available on the current device, gracefully degrade the corresponding app feature. For example, you can query whether...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found