-
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
location "make" variable expansions should avoid external #12198
Comments
Definitely. Unfortunately, it's a also a Very Incompatible Change so we'll either have to consciously do such a change or live with it. |
If we just made |
Yep, that sounds like it (although I admit I haven't thought it through very carefully). Whether it's worth the churn is another question. |
I'm moving this to P4 because it's a good idea, but it's also very incompatible so we can't accept full requests (without further thought, anyway) |
My understanding is that 181bd1a only applies when |
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 2+ 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:
The
$(location label)
make variable (and bothrootpath
andexecpath
) will give the path to an external file through theexternal
directory. When--nolegacy_external_runfiles
is enabled then thisexternal
directory will not exist, which will lead to a runtime error for the particular executable in most cases.Change request:
These expansions should resolve to the path without pathing through
external
. Especially if--nolegacy_external_runfiles
is specified.For example:
WORKSPACE:
The expansion currently resolves as follows:
$(rootpath @some_file//file)
=>external/some_file/file/filename
It should resolve as:
$(rootpath @some_file//file)
=>../some_file/file/filename
This would fix most cases where
--nolegacy_external_runfiles
cannot be enabled, which is blocking this from being the default (#9306)Current workarounds:
Manually replace
$(location @some_file//file)
with../some_file/file/filename
Transform the argument inside of the executable itself, e.g.
${1/#external\//..\/}
(Fix jq path in :pin runnable bazel-contrib/rules_jvm_external#454)Both of these suffer from new breakages often.
The text was updated successfully, but these errors were encountered: