Repository navigation
fix: write the FFI headers to the profile directory under Cargo 1.100 - #5898
Conversation
Cargo 1.100 puts a build script's `OUT_DIR` one level deeper: `target/<profile>/build/<package>/<hash>/out`, where it was `target/<profile>/build/<package>-<hash>/out`. The three build scripts that stage headers under `target/<profile>/include` found that directory by going three levels up from `OUT_DIR`, so under the new layout the headers landed in `target/<profile>/build/include` and the Swift SDK build, which installs the stable toolchain, reported `rs-sdk-ffi.h` missing. They now take the parent of the `build` directory, which is the profile directory under both layouts. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
🔍 Review in progress — actively reviewing now (commit 8fcbd8d) · triage: low |
Basic explanation
What this does: Fixes the Swift SDK build, which fails on every branch since Rust 1.100.0 came out on 12 November. Three build scripts write the C headers that the Swift and C++ SDKs include. They found the directory to write to by counting folders up from where Cargo runs them, and Cargo 1.100 added a folder, so the headers went to the wrong place. The scripts now look for the folder by name.
Value: The "Swift SDK build" check passes again for every open pull request and for
v5.1-dev. Anyone building the iOS framework or the C++ SDK locally with Rust 1.100 or later gets working headers too.Risks: Low. Only three build scripts change, and no shipped code. The headers land in the same place as before under the pinned toolchain, which I checked. The one case the new lookup would get wrong is a package named
build, which none of these is.Issue being fixed or feature implemented
swift-sdk-build.ymlinstalls thestabletoolchain. On 12 Novemberstablemoved from 1.99.1 to 1.100.0, and the job began to fail onv5.1-devand on every pull request with:Cargo 1.100 changed where a build script's
OUT_DIRsits:The build scripts took
OUT_DIR's third ancestor astarget/<profile>. Under the new layout that istarget/<profile>/build, so the header was written totarget/<profile>/build/include/..., wherebuild_ios.shdoes not look.What was done?
packages/rs-sdk-ffi/build.rs,packages/rs-platform-wallet-ffi/build.rsandpackages/rs-sdk-cxx/build.rstake the profile directory as the parent of the nearest ancestor ofOUT_DIRnamedbuild, which is the same directory under both layouts.Before, with Cargo 1.100:
After, with Cargo 1.98.1 and with Cargo 1.100:
The workflow still installs
stable. Pinning it to the repository's toolchain would be a separate choice; with this change the build does not depend on it.How Has This Been Tested?
OUT_DIRconfirmed the two layouts under Cargo 1.98.1 and under a 1.100 toolchain.cargo check -p rs-sdk-ffi -p platform-wallet-ffi -p dash-sdk-cxxunder the pinned 1.98.1 and under a 1.100 nightly (cargo 1.100.0-nightly, 2026-09-04), each into its own target directory: all headers land undertarget/debug/include, and nothing undertarget/debug/build/include.I have no 1.100.0 stable toolchain locally, so the Swift job on this pull request is the check against the released version. I did not run
build_ios.sh.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
8fcbd8d/skip-botsproceeds without the ones not yet reported/self-reviewedrs-platform-wallet-ffi(packages/rs-platform-wallet-ffi/build.rs) — HashEngineering or ZocoLini or llbartekll or romchornyirust-sdk-ffi(packages/rs-sdk-ffi/build.rs) — lklimek or shumkovWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.