Skip to content

Pass use_pic when creating module codegen actions - #788

Closed
fmeum wants to merge 1 commit into
bazelbuild:mainfrom
fmeum:module-codegen-inputs
Closed

Pass use_pic when creating module codegen actions#788
fmeum wants to merge 1 commit into
bazelbuild:mainfrom
fmeum:module-codegen-inputs

Conversation

@fmeum

@fmeum fmeum commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Module codegen actions (header_module_codegen) compile a module file into an object file. _create_module_codegen_action computes use_pic from the module file's name but didn't forward it to _create_compile_action, so Bazel's CppCompileActionBuilder treats the action as non-PIC even for PIC module files — and e.g. looks up the non-PIC transitive modules as mandatory inputs, which are empty in PIC-only builds.

Module codegen actions compile a module file into an object file.
_create_module_codegen_action computes use_pic from the module file's
name but didn't forward it to the created compile action, so Bazel
treats the action as non-PIC even for PIC module files and e.g. looks
up the non-PIC transitive modules as inputs, which are empty in
PIC-only builds.
@fmeum
fmeum force-pushed the module-codegen-inputs branch from 9725e21 to f249d3f Compare July 17, 2026 16:06
@fmeum fmeum changed the title Fix module codegen actions with header modules Pass use_pic when creating module codegen actions Jul 17, 2026
@fmeum
fmeum marked this pull request as ready for review July 17, 2026 16:07
@fmeum
fmeum requested review from c-mita, pzembrod and trybka as code owners July 17, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants