Skip to content

Fix input root creation for path mapped workers#23991

Closed
fmeum wants to merge 2 commits intobazelbuild:masterfrom
fmeum:path-mapping-generated-worker
Closed

Fix input root creation for path mapped workers#23991
fmeum wants to merge 2 commits intobazelbuild:masterfrom
fmeum:path-mapping-generated-worker

Conversation

@fmeum
Copy link
Copy Markdown
Collaborator

@fmeum fmeum commented Oct 15, 2024

The set of worker files wasn't path mapped, which resulted in build failures when using a generated multiplex worker.

Fixes #23990

@fmeum fmeum requested a review from tjgq October 15, 2024 20:45
@github-actions github-actions bot added team-Local-Exec Issues and PRs for the Execution (Local) team awaiting-review PR is awaiting review from an assigned reviewer labels Oct 15, 2024
@meteorcloudy meteorcloudy requested a review from coeuvre October 16, 2024 08:58
@meteorcloudy
Copy link
Copy Markdown
Member

@coeuvre Can you take a look at this one?

@coeuvre
Copy link
Copy Markdown
Member

coeuvre commented Oct 16, 2024

How urgent is it? Otherwise I would like to let Tiago review it because he has all the knowledge around this area.

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Oct 16, 2024

It's not urgent, take your time.

@fmeum fmeum removed the request for review from coeuvre October 17, 2024 19:04
// We consider `prepareExecution` to be also part of setup.
Stopwatch prepareExecutionStopwatch = Stopwatch.createStarted();
worker.prepareExecution(inputFiles, outputs, key.getWorkerFilesWithDigests().keySet());
Set<PathFragment> workerFiles = key.getWorkerFilesWithDigests().keySet();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am a little confused; shouldn't the path mapping transformation be applied before computing the worker key, not after? In other words, if two actions have the same set of tool inputs after path mapping (but not before), shouldn't they share the same set of persistent workers?

This seems desirable because currently --worker_max_instances=Foo=N doesn't actually mean "at most N workers will be spawned", but rather "at most N*M where M is the number of distinct configurations", and normalizing the key would at least mitigate it. (But maybe there's a subtle reason we can't do this and maintain correctness?)

It would also remove the asymmetry between tool inputs and other inputs in this file (it looks like inputFiles have already been path-mapped elsewhere?) which would help readability.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, looks much better now.

@tjgq tjgq self-assigned this Oct 22, 2024
fmeum added 2 commits October 25, 2024 00:32
The set of worker files wasn't path mapped, which resulted in build failures when using a generated multiplex worker.
@fmeum fmeum force-pushed the path-mapping-generated-worker branch from c782a62 to 8c6a0fb Compare October 24, 2024 22:32
@fmeum fmeum requested a review from tjgq October 24, 2024 22:33
@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Oct 25, 2024

@bazel-io fork 8.0.0

@tjgq tjgq added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Oct 28, 2024
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Oct 29, 2024
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Oct 29, 2024
The set of worker files wasn't path mapped, which resulted in build failures when using a generated multiplex worker.

Fixes bazelbuild#23990

Closes bazelbuild#23991.

PiperOrigin-RevId: 691114049
Change-Id: I50cc2daa1c9fe7102ba99893aa878fb4c6b1c3d3
github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2024
The set of worker files wasn't path mapped, which resulted in build
failures when using a generated multiplex worker.

Fixes #23990

Closes #23991.

PiperOrigin-RevId: 691114049
Change-Id: I50cc2daa1c9fe7102ba99893aa878fb4c6b1c3d3

Commit
9d51ede

Co-authored-by: Fabian Meumertzheim <[email protected]>
ramil-bitrise pushed a commit to bitrise-io/bazel that referenced this pull request Dec 18, 2024
The set of worker files wasn't path mapped, which resulted in build failures when using a generated multiplex worker.

Fixes bazelbuild#23990

Closes bazelbuild#23991.

PiperOrigin-RevId: 691114049
Change-Id: I50cc2daa1c9fe7102ba99893aa878fb4c6b1c3d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Local-Exec Issues and PRs for the Execution (Local) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path mapping fails for generated multiplex workers

4 participants