Skip to content
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

Closed
DavidANeil opened this issue Sep 30, 2020 · 10 comments
Closed

location "make" variable expansions should avoid external #12198

DavidANeil opened this issue Sep 30, 2020 · 10 comments
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Server Issues for serverside rules included with Bazel type: bug

Comments

@DavidANeil
Copy link
Contributor

DavidANeil commented Sep 30, 2020

Description of the problem:

The $(location label) make variable (and both rootpath and execpath) will give the path to an external file through the external directory. When --nolegacy_external_runfiles is enabled then this external 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:

workspace(name = "myworkspace")

http_file(
    name = "some_file",
    downloaded_file_path = "filename",
    urls = ["someurl"],
)

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:

Both of these suffer from new breakages often.

@meisterT
Copy link
Member

meisterT commented Oct 2, 2020

Cc @lberki @jin

@jin
Copy link
Member

jin commented Oct 5, 2020

@gyias

@lberki
Copy link
Contributor

lberki commented Oct 5, 2020

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.

@DavidANeil
Copy link
Contributor Author

If we just made --incompatible_disable_legacy_external_runfiles do this location change plus what --nolegacy_external_runfiles currently does, it would be doable, right?

@lberki
Copy link
Contributor

lberki commented Oct 5, 2020

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.

@oquenchil oquenchil added P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Server Issues for serverside rules included with Bazel type: bug labels Oct 5, 2020
@lberki
Copy link
Contributor

lberki commented Nov 18, 2020

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)

@lberki lberki added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) and removed P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Nov 18, 2020
@gyias
Copy link
Member

gyias commented Nov 18, 2020

Forgot to mention it on this thread, but 181bd1a has added the behavior.

@lberki Isn't the change enough to close this issue? Or, are there any other concerns?

@lberki
Copy link
Contributor

lberki commented Nov 20, 2020

My understanding is that 181bd1a only applies when --experimental_sibling_repository_layout is in effect. One could make the case that the runfiles path should be the "external-less" one even if that flag is set to false. So let's keep this open.

@github-actions
Copy link

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 (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Apr 12, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Server Issues for serverside rules included with Bazel type: bug
Projects
None yet
Development

No branches or pull requests

6 participants