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

Support layering_check with C++ path mapping #22957

Closed
wants to merge 3 commits into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jul 4, 2024

Users can opt into path mapping for C++ module map actions via --modify_execution_info=CppModuleMap=+supports-path-mapping. This is achieved by mapping paths in the module map files as well as converting the sequence variable for module map paths to a new structured ArtifactSequenceVariable.

Also makes it so that ExecutionServer gracefully handles failing commands instead of crashing.

@fmeum fmeum force-pushed the 6526-layering-check branch 4 times, most recently from a69252a to e63f761 Compare July 18, 2024 14:27
@fmeum fmeum marked this pull request as ready for review July 18, 2024 15:30
@fmeum fmeum requested review from a team, lberki and oquenchil as code owners July 18, 2024 15:30
@fmeum fmeum requested review from comius and removed request for a team, lberki and oquenchil July 18, 2024 15:30
@github-actions github-actions bot added team-Rules-CPP Issues for C++ rules team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Jul 18, 2024
Comment on lines 94 to 95
BiFunction<ImmutableMap<String, String>, String, ImmutableMap<String, String>>
modifyExecutionInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This design of passing in a BiFunction, checking if it would result in one key SUPPORTS_PATH_MAPPING and then modifying the execution info by adding that key, looks fishy.

I'd be more comfortable passing in ImmutableMap<String, String> executionInfo and following SpawnAction example. Interning it and returning it in getExecutionInfo.

It will probably require a bit more internal testing, but it's also more future proof.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am now passing in the execution info map directly. I still need some extra logic to save a field (which would result in a larger instance size), PTAL.

@fmeum fmeum requested a review from comius July 29, 2024 10:42
@comius comius 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 Jul 30, 2024
@fmeum
Copy link
Collaborator Author

fmeum commented Jul 30, 2024

@bazel-io flag

@bazel-io bazel-io added potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone and removed potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone labels Jul 30, 2024
@iancha1992 iancha1992 added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jul 31, 2024
@iancha1992
Copy link
Member

@bazel-io fork 7.4.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jul 31, 2024
@fmeum
Copy link
Collaborator Author

fmeum commented Aug 13, 2024

@iancha1992 I resolved the merge conflict.

@iancha1992
Copy link
Member

@fmeum Looks like @comius will take a look at this and patch some fixes and submit a CL for this. Also, looks like there are presubmit errors :(

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 13, 2024

@iancha1992 I fixed the build failure.

@fmeum
Copy link
Collaborator Author

fmeum commented Sep 3, 2024

@comius Friendly ping so that this doesn't get lost

@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 Sep 16, 2024
@fmeum fmeum deleted the 6526-layering-check branch September 16, 2024 11:04
fmeum added a commit to fmeum/bazel that referenced this pull request Sep 19, 2024
Users can opt into path mapping for C++ module map actions via `--modify_execution_info=CppModuleMap=+supports-path-mapping`. This is achieved by mapping paths in the module map files as well as converting the sequence variable for module map paths to a new structured `ArtifactSequenceVariable`.

Also makes it so that `ExecutionServer` gracefully handles failing commands instead of crashing.

Closes bazelbuild#22957.

PiperOrigin-RevId: 675073116
Change-Id: I13835c7fb01354a89ec5fd141cf892c6b733efe4
github-merge-queue bot pushed a commit that referenced this pull request Sep 23, 2024
Users can opt into path mapping for C++ module map actions via
`--modify_execution_info=CppModuleMap=+supports-path-mapping`. This is
achieved by mapping paths in the module map files as well as converting
the sequence variable for module map paths to a new structured
`ArtifactSequenceVariable`.

Also makes it so that `ExecutionServer` gracefully handles failing
commands instead of crashing.

Closes #22957.

PiperOrigin-RevId: 675073116
Change-Id: I13835c7fb01354a89ec5fd141cf892c6b733efe4

Fixes #23178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants