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

Fix symlink planting for multiple aspects #24676

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 13, 2024

When Skymeld is enabled, symlinks for external repositories are planted lazily in response to an event sent in BuildDriverFunction. For top-level aspects, this event needs to be sent individually for each aspect as the transitive packages required can differ per aspect. BuildDriverFunction deduplicated all events, including the one for symlink planting, by type, which resulted in missing symlinks for actions registered by the second (and later) aspects.

Fixes #24619

@fmeum fmeum requested a review from joeleba December 13, 2024 07:19
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Dec 13, 2024
postedEventsTypes,
env,
TopLevelTargetReadyForSymlinkPlanting.create(transitivePackagesForSymlinkPlanting));
// Don't deduplicate this event per BuildDriverKey as the transitive packages can differ
Copy link
Collaborator Author

@fmeum fmeum Dec 13, 2024

Choose a reason for hiding this comment

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

If the missing deduplication should turn out to be a concern, I could:

  • Introduce enum constants up to some fixed number of aspects.
  • Replace the inner HashSet with an EnumSet to potentially avoid some overhead elsewhere in this function. This may be a useful optimization on its own.

@fmeum
Copy link
Collaborator Author

fmeum commented Dec 13, 2024

CI failure is likely due to #24655 (comment)

@sgowroji sgowroji added the team-Local-Exec Issues and PRs for the Execution (Local) team label Dec 13, 2024
When Skymeld is enabled, symlinks for external repositories are planted lazily in response to an event sent in `BuildDriverFunction`. For top-level aspects, this event needs to be sent individually for each aspect as the transitive packages required can differ per aspect. `BuildDriverFunction` deduplicated all events, including the one for symlink planting, by type, which resulted in missing symlinks for actions registered by the second (and later) aspects.
@fmeum fmeum force-pushed the 24619-aspect-symlink-creation branch from 638cc92 to 476d90e Compare December 13, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple aspects running py_binary based tools errors in Bazel 8
2 participants