-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
protoc with Non-standard Compiler Toolchain #8304
Comments
@llchan can you provide more context of your environment? Try passing |
I'm running on RHEL 7.5 with system gcc 4.8.5. Envoy requires a newer gcc, so I have a gcc 8.3.0 built in a separate path. When building, I set CC/LD_LIBRARY_PATH in the shell that's calling bazel, and that seems to be respected. I've tried it with/without --action_env, but either way the protoc call is invoked with an empty environment. I also tried various things like LDFLAGS= |
Actually this could be related to bazelbuild/bazel#4008. If that is the case, what's the best workaround? I no longer have the cc_wrapper to hijack LDFLAGS the way I used to. |
@llchan try pass those LDFLAGS via |
That worked, thanks for the tip! We should probably still fix the mismatch between host tool compiler and host tool execution env. Seems like CC is respected but LD_LIBRARY_PATH is not. If it's any easier, I think it's acceptable for now to make host tools compile with the system compiler and not make that overridable. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
In the docs, it says it's possible to use a non-standard compiler by specifying
CC
/LD_LIBRARY_PATH
. However, this seems to break host tools:Running bazel with
-s
, it seems thatprotoc
is compiled with the non-standard compiler but executed in aexec env -
environment without the matchingLD_LIBRARY_PATH
. I don't have a preference which toolchain it uses, but build/execution should match.This is basically the same issue as #4736, but if I'm reading this right the resolution there was to modify the bazel source code to pass in a custom environment, which isn't really a reasonable solution. My previous hack involved several patches to
cc_configure.bzl
andcc_wrapper.py
, but now that those are gone it's less clear to me how to get this to work.I believe this should be reproducible in any system with gcc<7, with a gcc>=7 available in a non-system path.
The text was updated successfully, but these errors were encountered: