-
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
ccache: FATAL: Could not find compiler "gcc" in PATH #3642
Comments
Hmm that is strange. I don't think there were any breaking changes in 0.5.4 in this area. From which bazel were you upgrading? Did this really work before? It seems /usr/lib/ccache/gcc looks for gcc on PATH, but bazel sets it's own PATH for sandboxed actions. You can use |
Bazel 0.5.4 doesn't have this problem for me anymore. Sorry for this. |
The problem has come back again on my workstation. I looks like when I ssh to workstation it works fine. But when I physically log in workstation it doesn't work. I'm using Fish shell BTW. |
--action_env doesn't solve the problem. |
Found a solution in this thread: #1322 by: Seemed bazel doesn't work well with ccache gcc . |
But Bazel should work well with ccache gcc right? So why would this issue be closed? I personally encountered this problem in Bazel 0.8.1 Ubuntu 14.04 just now. |
Agree, this should be handled by bazel. Resetting environment variables should only be a workaround. |
Another workaround is to set the bazel Example:
|
I met with the same issue with Bazel-0.13.0 and solved it by downgrading Bazel to 0.12.0. |
In this case the proper thing to do is to properly specify PATH with |
CC @ulfjack |
My hypothesis is that the CppCompileAction is forwarding env variables if they're set to a fixed value, but not forwarding env variables if they're supposed to be inherited. |
Yep, see here: This should call getActionEnvironment not getLocalShellEnvironment, and also forward that to the underlying AbstractAction. |
CppLinkAction is also broken. It calls getLocalShellEnvironment and getVariableShellEnvironment (combining both is effectively the same as getActionEnvironment). However, it then drops the variable shell environment. Its getEnvironment method is simply wrong (and it can't do the correct thing by design). |
I submitted 1b333a2, which should fix this. Can you verify with a bazel binary built from head? |
|
Had to add |
I am still having problems with this running Bazel with MSYS2 on Windows 11. I can run bazel build fine until it encounters either gcc or g++ as cmd instructions in the BUILD file. I tried
in both MSYS2 shell, in the BUILD file, and using I also tried
but it seemingly has no effect. I felt like I came really close to getting this all to work just to stumble at the finish line :/ |
I can't build any linux targets somehow after I upgraded to Bazel 0.5.4.
The text was updated successfully, but these errors were encountered: