Skip to content

Conversation

@jmcarp
Copy link

@jmcarp jmcarp commented Nov 10, 2025

We validate that the dpd path lives at the expected location on start. However, this check can throw a false positive if we point to the exe via a symlink. This patch canonicalizes the exe path before validating so that we validate the real exe path, which may differ from env::current_exe().

Submitted to avoid a PATH workaround for running simulated omicron on macos. h/t @david-crespo.

We validate that the dpd path lives at the expected location on start. However,
this check can throw a false positive if we point to the exe via a symlink.
This patch canonicalizes the exe path before validating so that we validate the
real exe path, which may differ from env::current_exe().
@jmcarp jmcarp force-pushed the jmcarp/canonicalize-exe-path branch from 4459c74 to 8c394af Compare November 10, 2025 20:00
@jmcarp
Copy link
Author

jmcarp commented Nov 10, 2025

For context, I'm trying to run simulated omicron on my macbook, and getting a validation error from the dpd stub:

bash-3.2$ dpd run

thread 'main' panicked at dpd/src/main.rs:264:23:
unable to initialize bf: P4Missing("/Users/joshcarp/code/omicron/out/dendrite-stub expected to end with dendrite")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Abort trap: 6

Because the dpd stub on my PATH is a symlink:

bash-3.2$ which dpd
./out/dendrite-stub/bin/dpd
bash-3.2$ realpath $(which dpd)
/Users/joshcarp/code/omicron/out/dendrite-stub/root/opt/oxide/dendrite/bin/dpd

If I change my PATH to point to the symlinked directory directly, it works, but it occurred to me that this would be simpler if dpd checked its canonical path for validation instead.

@david-crespo pointed out that this seems to be a macos-specific issue, since we aren't aware of the same problem on linux. I think canonicalizing the exe path is probably reasonable either way, but I'm wondering why this hasn't come up on linux so far.

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