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 the compiler SDK is absent from runfiles and remains a compilation input. Both regressions fail on main and pass here; 53 nightly tests pass on macOS, and the stable legacy smoke test also passes. Both new tests are enabled only with nightly compiled doctests and are disabled on Windows, where the existing runner lacks its executable suffix.

The shared-library fixture uses a runfiles-relative install name/SONAME to isolate file propagation from the existing persisted-doctest rpath behavior. This does not add a data attribute or change the public rule API. Linux and Windows execution were not tested locally.

Upstream CI passed after the regression tests were changed to inherit the selected channel. Stable-only, stable-with-aspects, and nightly-with-aspects configurations were also checked locally.

Closes #4289.

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