fix(build): fix workspace root detection in build.rs#423
Merged
Conversation
…t reorganization After PR #419 moved crates under src/, CARGO_MANIFEST_DIR.parent() resolved to src/ instead of the repo root. This caused find_prebuilt_shim/guest to search src/target/ (doesn't exist) instead of target/, resulting in runtime tarballs missing boxlite-guest and boxlite-shim. Replace the .parent() heuristic with find_workspace_root() that walks up the directory tree looking for a Cargo.toml containing [workspace]. Also bumps all SDK versions to 0.8.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build.rsincorrectly computing workspace root asCARGO_MANIFEST_DIR.parent()(src/) instead of the actual repo root after PR refactor: reorganize workspace into src/ layout #419 (src/ layout reorganization)find_prebuilt_shim/guestto searchsrc/target/(doesn't exist), resulting in v0.8.1 runtime tarballs missingboxlite-guestandboxlite-shim.parent()heuristic withfind_workspace_root()that walks up looking forCargo.tomlcontaining[workspace]Test plan
make runtimeproduces complete runtime with guest + shimcargo build -p boxlite-cli --releaseaftermake runtimenow correctly embeds guest + shim (was "not found, skipping")ls -dt target/release/build/boxlite-*/out/runtime | head -1 | xargs lsshows all 5 files in newest dircargo clippy -p boxlite --tests -- -D warningspasses clean