bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Restore path mapping support with `layering_check`

Open fmeum opened this issue 6 months ago • 2 comments

path_mapping_test didn't set CC=clang and thus didn't actually cover the case of compilation with --features=layering_check. As a result, it wasn't noticed that 2dd545b4e4fe35aa04a70eacd5ab1ba621b3a09c regressed path mapping support for this feature.

Fixing this requires wiring up ParameterFileWriteAction with path mapping and allowing it to be opted in via execution info. Since opting in all such actions would cause breakages, offer a way to customize the mnemonic as the only API change - as a side effect, this brings back the CppModuleMap mnemonic.

RELNOTES: ctx.actions.write now supports path mapping when passed an Args object. Use the new mnemonics attribute to assign it a dedicated mnemonic, which can then be used with --modify_execution_info to opt in to path mapping (see https://github.com/bazelbuild/bazel/discussions/22658 for details on path mapping).

fmeum avatar Jun 13 '25 06:06 fmeum

FYI @c-mita

fmeum avatar Jun 13 '25 13:06 fmeum

CI should pass after https://github.com/bazelbuild/continuous-integration/pull/2324 has propagated to the images

fmeum avatar Jun 13 '25 13:06 fmeum

@comius I sent https://github.com/bazelbuild/bazel/pull/26456 with just the ctx.actions.write change, PTAL.

fmeum avatar Jul 02 '25 14:07 fmeum

@comius Thanks for merging the other PR, I rebased this PR onto master.

fmeum avatar Jul 07 '25 09:07 fmeum