-
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
Cannot build C++ target in an external that depends on another external. #11293
Comments
The direct cause is that only the superproject has the externals in its execroot. Subprojects (when compiled in the context of a superproject) do not add the execroot to the C++ action's include paths. The relevant line is here: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java#L957 |
This is WAI without recursive workspaces, since the superproject (baz) has its own output base (and therefore execroot), with direct subprojects / external repos symlinked into (I understand that uplevel includes can be questionable, but I'm using this to illustrate the current design of the repo symlink layout. Until we have recursive workspaces, I think subprojects would remain as single-level sibling directories in the execroot of the superproject)
You might also wanna try
|
We have a subproject that is perfectly standalone. If anyone writes code and tests it, it'll work, but when included in a superproject it'll fail in that context. That's not great. Worse, if any subproject that we want to consume take advantage of this we would have to convince upstream authors to change their "external" references to "../", because we don't have free edit access to those projects. I saw that you did But overall, I think what you are saying is that you know this isn't desirable, and recursive workspaces is what is needed to address this? |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Description of the problem / feature request:
Cannot build C++ target in an external that depends on another external.
When building the externals separately it works, but when in the context of the superproject then subprojects cannot #include externals.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
The exec root for bar no longer includes the external
repo 'foo' when build in the context of 'baz'.
Note that 'baz' supplies all transitive workspace dependencies.
What operating system are you running Bazel on?
Windows 10.
What's the output of
bazel info release
?release 3.1.0
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.I tried building Bazel from HEAD, but it doesn't build out-of-the box @Head on Windows.
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?N/A
Have you found anything relevant by searching the web?
Not exactly relevant.
The text was updated successfully, but these errors were encountered: