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

select should support platform #15575

Closed
xiedeacc opened this issue May 25, 2022 · 9 comments
Closed

select should support platform #15575

xiedeacc opened this issue May 25, 2022 · 9 comments

Comments

@xiedeacc
Copy link

xiedeacc commented May 25, 2022

Description of the feature request:

I defined mutil platform for different cross-compile, I need pass different config value to configure, but select think paltform is a invalid condition, I have to use select with and condition and specify these condition on comand line, it's so ugly, I think select support platform is a better and beautiful way

What is the output of bazel info release?

5.1.1

@katre
Copy link
Member

katre commented May 25, 2022

Can you please give a code sample of the syntax that you want to have supported? We do support using constraint_value targets in select, but this is limited to a single one, or you can use config_setting to group several related constraint values.

If you're asking about using the label of a platform directly in a select, see my recent response on #14604 about why that's difficult and not something we'll support soon.

Possibly I should make that answer part of the select FAQ.

@xiedeacc
Copy link
Author

@katre I'm asking using label of a platform directly in select, I think you should support this feature not matter how difficulty, otherwise it's too ugly to use selects.config_setting_group instead

@katre
Copy link
Member

katre commented May 25, 2022

As I told @cpsauer, I will be happy to see a proposal for adding this feature that can deal with ambiguities and reduces user confusion, but we're not going to be able to prioritize that on the Bazel Configurability team.

@xiedeacc
Copy link
Author

As I told @cpsauer, I will be happy to see a proposal for adding this feature that can deal with ambiguities and reduces user confusion, but we're not going to be able to prioritize that on the Bazel Configurability team.

ok, hope you'll support it in the future, thanks

@pcjanzen
Copy link
Contributor

too ugly to use selects.config_setting_group

if your use case is exactly matching a platform, you can already do

config_setting(
    name = "is_my_platform",
    values = {
        "platforms": "//platforms:my_platform",
    },
)

@cpsauer
Copy link
Contributor

cpsauer commented May 26, 2022

Ah man, John (and @gregestren, since he seems to be interested, too--hope that's okay), you're sure not supporting this is the right move long term?

Totally understand if you don't have bandwidth right now. And I definitely don't want to irritate you guys. (I really appreciate you!)

It just does earnestly seem to this user that the ambiguity you're referencing might cleanly resolve in favor of the same behavior as the equivalent constraint_setting()--with the other exact-match option eliminated for the same good reasons as at the end of your PR. (Same sentiments in my prior response to yours that you'd linked, but which I think you haven't seen yet based on context.)

Obviously if you still disagree, I'll happily shush. For sure your call (not mine). Just an interested user who cares maybe a little too much.

Cheers,
Chris

@katre
Copy link
Member

katre commented May 26, 2022

I'm willing to support the feature, but I don't have free time to write up a full proposal and make sure the semantics make sense. If someone else (hint, hint) wants to do that, I'll commit to review it and work with the author on implementation.

copybara-service bot pushed a commit that referenced this issue May 26, 2022
In response to #15575.

Closes #15580.

PiperOrigin-RevId: 451171955
Change-Id: Id231ded1529d50e69ba5ec5563fe16a4cd83121d
@katre
Copy link
Member

katre commented May 26, 2022

Closing for now, but as I said I'm receptive to proposals in this space.

@cpsauer
Copy link
Contributor

cpsauer commented May 28, 2022

Hints certainly received! :) Sounds like more open to it than I'd realized.

That said, I'm not going to implement this one or work through a more formal process. You all have a big advantage here over me on design and implementation, being immersed in this stuff, and I should focus my contributions elsewhere.

[Already working way hard trying to help make editing bazel codebases a great experience across editors and there's a lot more I can do there easily, contributing a fair amount to Bazel itself--and I've got a startup I need to make succeed.]

Anyway, cheers, all! And go Bazel and Team Configurability. You guys are awesome.

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

No branches or pull requests

4 participants