-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add console os constraints and config_settings. #856
base: main
Are you sure you want to change the base?
Conversation
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.) |
Why do these need to go into |
I am not sure where else it could really go and be usable. It would be used anywhere that a
Same argument applies to deps, and most other selectable args. When deciding whether it made sense to put these here, I looked at the surrounding code in the file. There are other constraints like |
Hmm, @dtolnay added those (in D45585036), but I don't see that they are actually used anywhere so should probably be removed too I think, but maybe I'm misunderstanding something here |
How would you suggest I accomplish selecting on other operating systems if not by adding a constraint to the operating system setting? Isn't that what it's for? I could do something like:
but that seems quite extreme given that that the constraints I'm adding actually are operating systems, that conceptually and logically do belong in a list of operating systems. If I have to go that route, I'll probably instead just fork the prelude internally. But I think it's a reasonable ask to get these into prelude since this is where they make logical sense, and if Meta were to ever support these operating systems, I have a strong suspicion this is exactly where the constraints would go. If this isn't going to work, then some clear guidelines about what the bar is for adding a constraint to this setting would be appreciated, along with some guidance about what to do when one does have a need to support targeting operating systems that don't have an associated constraint. |
I think there are some misunderstandings in the previous comment. You can just add: constraint_value(
name = "ps4",
constraint_setting = "prelude//os/constraints:os",
) anywhere in your own codebase and that becomes a valid value of OS. If the prelude isn't going to be using this in any of the prelude's toolchain definitions, there is no technical difference between putting this in prelude or elsewhere. There is no need for "os_visibility" either way. select({
"prelude//os:windows": ...,
"//path/to:ps4": ...,
}) |
I didn't realize that would work. If that does in fact work then I agree there is no need for this. I didn't think you could select on constraint_values that were namespaced in different folders. I'll give this is a try, and if this does work then I'll close this issue. |
No description provided.