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

Replace aspect_repository with rustc_env for exposing workspace_name #1410

Closed
wants to merge 1 commit into from

Conversation

UebelAndre
Copy link
Collaborator

This is minor cleanup I've found to be easier to understand and work with in comparison to aspect_repository.

@UebelAndre UebelAndre force-pushed the workspace_name branch 3 times, most recently from 0819343 to 05976b6 Compare June 14, 2022 05:48
@hlopko
Copy link
Member

hlopko commented Jun 14, 2022

This change will break us internally (for a surprising reason - we don't support external repositories, so using @ labels like @rules_rust doesn't work). Since you describe it as a minor cleanup, and since the aspect_repository only exists temporarily because of bazelbuild/bazel#11734, I'm curious if we could not submit this PR and wait a bit longer for the Bazel issue to be fixed. Then we can delete the workaround.

I've pinged the Bazel issue again now.

CC @krasimirgg

@UebelAndre
Copy link
Collaborator Author

This change will break us internally (for a surprising reason - we don't support external repositories, so using @ labels like @rules_rust doesn't work). Since you describe it as a minor cleanup, and since the aspect_repository only exists temporarily because of bazelbuild/bazel#11734, I'm curious if we could not submit this PR and wait a bit longer for the Bazel issue to be fixed. Then we can delete the workaround.

I've pinged the Bazel issue again now.

CC @krasimirgg

That issue is only relevant to the rust_analyzer target. rustfmt still needs to know the workspace name and had actually stopped using consuming the variable set to aspect_repository. So there it'd be a no-op cleanup but figured the same mechanism could be used to solve for this issue and reduce the footprint introduced by bazelbuild/bazel#11734 by making another rule slightly more generic and moving comments over to the only logic impacted by that. At the very least I'd like to keep the cleanup for rustfmt but would want to do some tighter colocation of this code in the mean time. I don't expect any fix for an open Bazel issue to make it's way into rules_rust any time soon.

@UebelAndre
Copy link
Collaborator Author

On second thought, it current feels like negative value to generalize the workspace name stuff. I'll decline this PR for now but it's quite a useful trick for finding runfiles. Maybe it should be built into the runfiles library?

@UebelAndre UebelAndre closed this Jun 14, 2022
@UebelAndre UebelAndre deleted the workspace_name branch June 14, 2022 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants