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

Add console os constraints and config_settings. #856

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zjturner
Copy link
Contributor

@zjturner zjturner commented Feb 7, 2025

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 7, 2025
@facebook-github-bot
Copy link
Contributor

@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.)

@IanChilds
Copy link
Contributor

Why do these need to go into prelude? Where are they going to be used?

@zjturner
Copy link
Contributor Author

zjturner commented Feb 12, 2025

I am not sure where else it could really go and be usable. It would be used anywhere that a config//os: constraint is currently used. There's too many to list, but just as one example, this is a frequent use case for us:

cxx_library(
    name = "foo",
    srcs = [
        <common sources>
    ] + select({
        "config//os:windows": _windows_sources,
        "config//os:linux": _linux_sources,
        "config//os:macos": _macos_sources,
        "config//os:ps4": _playstation_sources,   # we need this
    })
)

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 illumos, netbsd, and fuchsia that if you grep the prelude for them, 0 hits come up. And these are prefaced by a comment that says "Long tail but contemporarily relevant operating systems". I assume Meta internally has lots of internal build code that refers to these OSes, and the same would apply here. So it seems appropriate to me for these to be here, but LMK your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants