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

Copy aspect files to workspace #7202

Merged
merged 11 commits into from
Jan 22, 2025
Merged

Conversation

LeFrosch
Copy link
Collaborator

@LeFrosch LeFrosch commented Dec 20, 2024

Copy all aspects into the workspace instead of using a --override_repository or --inject_repository flag to point to the bundled aspects. This provides some benefits:

  • No more caching problems caused by --override_repository
  • No different logic for Bazel 8, since --inject_repository is also not required

Since aspects need to be copied to the workspace anyway, we can now store them inside the plugin jar. This makes accessing the aspects easier, since they are not in different locations for tests and production.

Also adds aspect writing as a dedicated sync step:
image

@LeFrosch LeFrosch changed the title Copy aspect files to workspace root Copy aspect files to workspace Dec 20, 2024
@LeFrosch LeFrosch force-pushed the aspect-coping branch 2 times, most recently from c65289c to 78d12ee Compare December 25, 2024 23:30
@LeFrosch LeFrosch force-pushed the aspect-coping branch 6 times, most recently from 9f748b1 to 012d8a1 Compare January 13, 2025 21:24
@LeFrosch LeFrosch marked this pull request as ready for review January 14, 2025 13:17
@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Jan 14, 2025
Copy link
Collaborator

@mai93 mai93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LeFrosch! I left some comments. I am not familiar with the template related parts if you would like someone else to review those.

MODULE.bazel Show resolved Hide resolved
aspect/build_defs.bzl Outdated Show resolved Hide resolved
@LeFrosch
Copy link
Collaborator Author

rebased master

The AspectStorageService is responsible for writing the aspect files into a directory contained in the workspace root. The AspectWriter extension allows to register writers that write individual parts of the aspect to this directory.
Bazel 5 seems to have problems with relative labels used in the aspect. This also means that the plugin is no longer compatible with Bazel 5.

# Conflicts:
#	MODULE.bazel.lock
To ensure compatibility when executing the jars during the aspect execution, they have to be built with java 8.
@LeFrosch LeFrosch merged commit 65d00e4 into bazelbuild:master Jan 22, 2025
5 checks passed
@LeFrosch LeFrosch deleted the aspect-coping branch January 22, 2025 22:21
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
Development

Successfully merging this pull request may close these issues.

5 participants