Skip to content

Preserve runtime files for compiled doctests - #4272

Open
jrandolf wants to merge 1 commit into
bazelbuild:mainfrom
jrandolf:codex/upstream-compiled-doctest-runfiles
Open

jrandolf wants to merge 1 commit into
bazelbuild:mainfrom
jrandolf:codex/upstream-compiled-doctest-runfiles

Conversation

@jrandolf

@jrandolf jrandolf commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Compiled doctests currently inherit their compilation inputs as runfiles. This omits declared crate/dependency runtime data while sending the compiler SDK to the test machine.

Build the runtime files from the crate, explicit dependencies, runner, and compile_data. Preserve native shared libraries from CcInfo, including their resolved symlink targets. The compilation action retains all its original inputs.

A real persisted doctest reads crate, transitive, and extra-dependency data and calls a shared C library. An analysis regression checks that the compiler SDK is absent from runfiles and remains a compilation input. The shared-library fixture uses a runfiles-relative install name/SONAME to isolate file propagation from persisted-doctest rpath behavior. This does not add a data attribute or change the public rule API.

Validation: both regressions and their fixtures pass locally on macOS arm64 with Bazel 9.2.0 at 878c4fd, using nightly compiled doctests. The stable legacy smoke test also passes on the combined branch. The new fixtures remain disabled on Windows; Linux and Windows execution were not tested locally.

Closes #4289.

@jrandolf
jrandolf force-pushed the codex/upstream-compiled-doctest-runfiles branch from 3a9e2d3 to 878c4fd Compare September 28, 2026 19:15

This branch has not been deployed

No deployments
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.

Compiled doctests omit dependency runtime data and include the compiler SDK in runfiles

1 participant