run --verify ignores --tmp and environment configuration

#73 · closed · 3 comments

View on GitHub ↗

rrnewton

## Summary `hermit run --verify` does not honor the normal run container's `--tmp` or environment configuration. ## Reproduction Run a program that must be mounted through a user-provided tmp directory: ```sh mkdir -p /tmp/hermit-verify-repro cp /bin/true /tmp/hermit-verify-repro/guest hermit run --tmp=/tmp/hermit-verify-repro --verify -- /tmp/guest ``` The first verify run reports that `/tmp/guest` does not exist. A non-verify run with the same `--tmp` succeeds. Environment overrides are also bypassed by the verify execution path. ## Cause `RunOpts::run_verify` always creates a fresh `TempDir` instead of calling `self.tmpfs()` (there is already a TODO noting this), and `run_verify_in_container` builds its command without the `base_env` / `merge_from_env_settings` handling used by `run_in_container`. ## Impact Tests and workloads using `--verify` cannot rely on explicit tmp contents or `--env` behavior matching ordinary `hermit run`. This was found while porting Detcore lit fixtures to Cargo.

Comments

rrnewton

Test-porting linkage: this surfaced while running the new Cargo lit cases hello_world_go_hermit_run_strict_verify, print_race_hermit_run_strict_verify, and sched_getaffinity_hermit_run_strict_verify from detcore/tests/lit/cargo.rs. Their fixtures could not be exposed through --tmp in verify mode; the porting harness currently uses an explicit bind mount as a workaround. The Batch C PR link will be added when published.

rrnewton

Batch C is now published as PR #75 with the linked Cargo lit coverage and bind-mount workaround: https://github.com/facebookexperimental/hermit/pull/75

rrnewton

Migrated to https://github.com/rrnewton/hermit/issues/13. Please continue discussion on the fork.