-
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
bazelrc: multiplatform support #5055
Comments
We've talked about different solutions to this problem in the past, but the easiest solution is to accept multiple rc files (#4502), which will let users keep platform specific flags in the global rc while keeping project specific flags in a workspace rc file. The workspace one can be shared between different platforms. Other solutions we've considered include checking for a "<platform>.bazelrc" filename, or making the rc file syntax more complicated so it can include some flags on some platforms and not others. Neither of these options seem to solve a problem that #4502 doesn't already address, though, and 4502 has other reasons for needing to happen. Thoughts? |
The general platform issue for bazel flags is very much not solved, the solution I mentioned leaves us in basically the following state:
I realize this is not ideal, but the "right" solution is not clear to me. The fixes in the other issue will only get us out of the unusable into the "works, I guess" territory. |
+1 to Chloe’s description
…On Thu, 19 Apr 2018 at 21:03 Chloe Calvarin ***@***.***> wrote:
The general platform issue for bazel flags is very much not solved, the
solution I mentioned leaves us in basically the following state:
- host platform: goes in global bazelrc
- execution platform: if host, in global bazelrc, if remote, likely in
the workspace file.
- target platform: the workspace rc file can contain --config
definitions that correspond to the different configurations needed.
I realize this is not ideal, but the "right" solution is not clear to me.
The fixes in the other issue will only get us out of the unusable into the
"works, I guess" territory.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5055 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF6stjy7TekvRVqt6abeEuuYw3fqEks5tqNF1gaJpZM4TbuWV>
.
|
I don't really have any, you're the domain expert. :)
SGTM. |
This is indeed a serious problem. Gerrit Code Review has this content of
Stamping machinery shells out to One way to fix it is what Buck is doing in
|
Although #4502 is closed, we still don't have a solution to add platform specific flags without passing different build options on different platforms (such as |
When the value of this flag is true, a host platform specific config section will be enabled if it exists. Bazel recognizes your host platform as linux, osx, windows or freebsd. It's equivalent to add --config=linux on Linux platforms and --config=windows on Windows, etc. Fixes bazelbuild#5055 RELNOTES[NEW]: Support --enable_platform_specific_config, you can use this flag to enable flags in bazelrc according to your host platform. GOOGLE:
When the value of this flag is true, a host platform specific config section will be enabled if it exists. Bazel recognizes your host platform as linux, macos, windows or freebsd. It's equivalent to add --config=linux on Linux platforms and --config=windows on Windows, etc. Fixes bazelbuild/bazel#5055 RELNOTES[NEW]: Platform-specific bazelrc: with --enable_platform_specific_config you can enable flags in bazelrc according to your host platform. PiperOrigin-RevId: 265641013
Although this issue is closed, we cannot use cutom platform specific_config setting like test:@local_config_platform//:host --test_env=LD_LIBRARY_PATH=/gw_demo/target/xlab/sysroot/lib:$LD_LIBRARY_PATH Correct me if I am wrong. @meteorcloudy |
If |
Oh, I mean the actual platform specific config, is that I can do the following build:@tools/platforms//:platform1 ...blablabla configs
build:@tools/platforms//:platform2 ...blablabla configs
test:@tools/platforms//:platform1 ...blablabla configs
test:@tools/platforms//:platform2 ...blablabla configs |
Description of the problem / feature request:
I'd like to have some mechanism to use platform-specific flags in bazelrc files.
Feature requests: what underlying problem are you trying to solve with this feature?
Motivation is to let checked-in, project-specific bazelrc files work on all platforms. Flags dealing with paths (e.g.
--output_user_root
), envvars (e.g.--test_env
), and external programs or shells (e.g.--workspace_status_command
) are all platform-specific.The text was updated successfully, but these errors were encountered: