Skip to content

test: fix eval and file-close - #43

Open
GregoryLi360 wants to merge 1 commit into
mainfrom
test/fix-eval
Open

test: fix eval and file-close#43
GregoryLi360 wants to merge 1 commit into
mainfrom
test/fix-eval

Conversation

@GregoryLi360

Copy link
Copy Markdown
Contributor

Adds test for entire fix eval pipeline

Comment on lines +79 to +92
let workspace = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("vmm crate is inside the workspace");

// Cargo supplies both binaries; VMM expects the guest ELF before guest argv
let child = Command::new(env!("CARGO_BIN_EXE_vmm"))
.arg(env!("CARGO_BIN_FILE_FIX_GUEST_fix"))
.arg("eval")
.arg(program.path())
.current_dir(workspace)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.expect("launch Fix-on-Arca under the VMM");

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.

Can you have Rust embed the guest binary into this one instead or reading it? This currently seems brittle.

@GregoryLi360 GregoryLi360 Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the Cargo.toml I added

[dev-dependencies]
fix-guest = { package = "fix", path = "../fix", artifact = "bin:fix", target = "x86_64-unknown-none" }

so calling cargo test should build the Fix guest artifact first. I tried embedding it but couldn't really see a clean way of doing so. Also, I'm not quite sure of the benefit of that approach, is there something that could fail with how it is right now?

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.

I think the main thing that concerns me is the path possibly being incorrect depending on the user's config; like their editor might invoke cargo test in the current file's directory rather than the project root. Right now the path is a compile-time literal but it's being evaluated at runtime which is odd. Also philosophically I'm hesitant to have a hard dependency that isn't visible to the compiler/runtime/OS...

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.

2 participants