fix(build): resolve capsule artifacts from Cargo target dir by joshuajbouw · Pull Request #1810 · astrid-runtime/astrid · GitHub
Skip to content

fix(build): resolve capsule artifacts from Cargo target dir - #1810

Draft
joshuajbouw wants to merge 1 commit into
mainfrom
fix/1807-cargo-target-dir
Draft

fix(build): resolve capsule artifacts from Cargo target dir#1810
joshuajbouw wants to merge 1 commit into
mainfrom
fix/1807-cargo-target-dir

Conversation

@joshuajbouw

@joshuajbouw joshuajbouw commented Sep 1, 2026

Copy link
Copy Markdown
Member

Linked Issue

Closes #1807.

Summary

Resolves capsule build artifacts from Cargo's configured target directory instead of assuming a workspace-local target/ tree.

Changes

  • Reads Cargo target-directory metadata for capsule artifact discovery.
  • Preserves the existing artifact validation and packaging path.
  • Adds regression coverage for configured target directories.

Verification

  • Focused build and test evidence is recorded on the branch.
  • Exact-head required CI must pass before merge.

AI / Tool Assistance

Assisted-by: Codex

AI assistance was used for implementation and tests. The maintainer reviewed the scope and owns the landing decision.

Checklist

  • Linked issue
  • Changelog included
  • Exact-head required checks complete
  • Ready to merge

Closes #1807

Signed-off-by: Joshua J. Bouw <jjb@unicity-labs.com>
Copilot AI balanced review requested due to automatic review settings September 1, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Uses Cargo’s resolved target directory to locate exact capsule WASM artifacts securely.

Changes:

  • Resolves build target and cdylib output names.
  • Adds fail-closed artifact validation.
  • Adds focused artifact-resolution tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/astrid-build/src/rust.rs Implements artifact resolution and validation.
changes/1807.fixed.md Documents the build fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +140 to +153
fn resolve_wasm_output_name_from_targets<I>(output_names: I, fallback: &str) -> Result<String>
where
I: IntoIterator<Item = String>,
{
let output_names: Vec<String> = output_names.into_iter().collect();
match output_names.as_slice() {
[] => validate_wasm_output_name(fallback),
[output_name] => validate_wasm_output_name(output_name),
_ => bail!(
"Capsule has {} cdylib targets; refusing to choose an ambiguous WASM artifact",
output_names.len()
),
}
}
Comment on lines 186 to +190
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.

Resolve capsule artifacts from Cargo configured target directory

2 participants