Skip to content

hermetic: cc-rs C and C++ crates in the cpp_rust consumer cargo hub (part of #11966) - #12489

Draft
TrapsterDK wants to merge 5 commits into
mainfrom
issue-11966-cpp-rust-cc-rs
Draft

TrapsterDK wants to merge 5 commits into
mainfrom
issue-11966-cpp-rust-cc-rs

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #11966.

Changed

  • tools/testing/hermetic/consumers/cpp_rust/cc_rs/: root cargo workspace (root.Cargo.toml, root.Cargo.lock) and a crate rust/tests/fixtures/cc-rs that depends on libz-sys 1.1.31 (static, C through cc-rs) and cxx 1.0.205 (C++ through cc-rs). rust_test calls zlib crc32/zlibVersion and a CxxString.
  • tools/testing/hermetic/BUILD.bazel: the cpp_rust qualification copies those files and adds //rust/tests/fixtures/cc-rs/... to its patterns. dx init then writes the cargo.from_cargo hub with the build-script cc annotation (adopt: dx init writes the build-script cc annotation with the cargo hub (part of #11966) #12307).
  • tools/testing/hermetic/defs.bzl, compilers.bzl, BUILD.bazel: C-only msvc fixtures and consumers want the cl C Rich header entry msvc 260.<build> (261 is C++), and c_msvc_fixture/c_fixture_msvc expect the pinned cl's C1083: Cannot open include file: 'string' for cxx_in_c.c. Main fails the same way (run 43533929381); every producer in the binary comes from the pinned msvc_runtime and SDK libraries.
  • root.Cargo.lock from bazel run @rules_rust//tools/upstream_wrapper:cargo -- generate-lockfile.

Tests

Remaining

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hygW8NyPkC1Ea1mT4L

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Evidence dispatched: windows_x86_64, test, //tools/testing/hermetic:cpp_rust, run 43516091977. Stays draft until green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD

@TrapsterDK
TrapsterDK force-pushed the issue-11966-cpp-rust-cc-rs branch 2 times, most recently from 1cf4931 to 7fb66b7 Compare November 13, 2026 23:13
@TrapsterDK
TrapsterDK marked this pull request as ready for review November 13, 2026 23:42
@TrapsterDK
TrapsterDK marked this pull request as draft November 14, 2026 00:16
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Merge train: dropped and returned to draft, //tools/testing/hermetic:c_msvc_fixture_test failed on windows_x86_64 in run 43527640040 (rejected_source_fails_with_the_compiler_message, executables_name_the_selected_compiler) and no failing run on main shows it is pre-existing; the PR also edits tools/testing/hermetic/BUILD.bazel

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD

TrapsterDK and others added 4 commits November 14, 2026 01:17
…part of #11966)

The cpp_rust consumer gets a root cargo workspace with a crate that
depends on libz-sys (static, C via cc) and cxx (C++ via cc), so dx init
writes a cargo.from_cargo hub with the build-script cc annotation and
the consumer builds and tests both crates. Cargo.lock comes from
bazel run @rules_rust//tools/upstream_wrapper:cargo -- generate-lockfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hygW8NyPkC1Ea1mT4L
…ense (part of #11966)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
…o name (part of #11966)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: nothing to fix in this PR's files. Rebased onto current main (clean, no code changes, so no review is stale); hermetic_unit_test passes locally. The windows c_msvc_fixture_test failure (run 43527640040) is in files this PR does not touch: the starter binary links CRT objects from several MSVC versions (producers msvc 147.30729 to 261.35403, wanted msvc 261.35728) and the rejected-source log shows C1083 instead of STL1003. It cannot be reproduced on linux, and no main run covers //tools/testing/hermetic on windows, so it is not shown pre-existing. Left as draft; :cpp_rust windows result is still unconfirmed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD

@TrapsterDK
TrapsterDK force-pushed the issue-11966-cpp-rust-cc-rs branch from ef3a071 to 12ce8b5 Compare November 14, 2026 00:20
…nostic (part of #11966)

cl.exe writes Rich header prodid 260 for C and 261 for C++, so C-only
fixtures and consumers now want "msvc 260.<build>". The pinned cl rejects
<string> in a C source with C1083, which c_msvc_fixture and
c_fixture_msvc now expect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Blocked, left draft: Windows :cpp_rust needs open PR #12641 (gazelle/julia without the root-only rules_julia package_name patch, #11418); Windows :c_fixture_msvc needs #11416 (@windows_sdk//:winsdk_bin_x64 declared outside the root-only windows_support patch, no PR yet). Branch also conflicts with main; rebase once those land.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

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.

1 participant