Allow for sourcing executables from $PATH#2447
Conversation
I don't think we're inclined to take this - minimally it should be a separate PR. We don't want to imply nix support by including these files without actually committing to keeping it working, which we don't have the resources to do right now. Could you drop these changes from the PR for now to keep the discussion focused on the other part?
I think it'd be good to have this or something like this. e.g. it'd also be nice if tor simulation configs didn't have to hard-code paths to tor, tgen, etc. Locating binaries using the
@stevenengler and @robgjansen - thoughts? |
|
Overall this seems like a reasonable improvement. I agree with sporksmith's points:
|
Back when we switched to YAML, we had a few discussions about whether to search PATH for the binary, or to require a hard-coded binary path. At the time we decided that we didn't want to search the PATH, use a flag like I like the
Why
It wouldn't be difficult, but the reason I added the processed-config.yaml was to output the configuration after only the very basic config processing steps (merge the defaults, the yaml, and the cli options). If we want to add additional runtime-generated things to this file, then we'll need to make the configuration object mutable, make sure to update the config object after resolving paths, and then make sure we do that before we've written the config to a file. So we can do this, but it makes it less clear about what the processed-config.yaml file represents. I'd personally be in favour of just logging the paths to the binaries, but we could do it either way. |
Basically. I think we decided to kick the can on it and see if it was a worthwhile feature after more experience. After more experience with shadow I'm leaning towards this feature being worth it. After @stevenengler 's comments and our offline chat about this, I think I've circled around to just using the
@robgjansen @stevenengler any objections? |
|
It would be great if the code is written such that it is really simple to remove the behavior that we merge here but want to remove in 3.0, or at the very least please make sure to add sufficient comments so we understand/remember what needs to be changed later when we release 3.0. Thanks! |
|
Aight. I pretty much rewrote the entire commit, so I force-pushed. Should be a lot cleaner now |
Codecov ReportBase: 42.69% // Head: 42.22% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2447 +/- ##
==========================================
- Coverage 42.69% 42.22% -0.47%
==========================================
Files 180 180
Lines 26479 26496 +17
Branches 5373 5377 +4
==========================================
- Hits 11304 11189 -115
- Misses 12538 12674 +136
+ Partials 2637 2633 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This is a planned breaking change for the Shadow 3.0 release. See shadow#2496 and shadow#2447 (comment). This forces users to explicitly use "./" to specify a binary in the current directory.
This is a planned breaking change for the Shadow 3.0 release. See shadow#2496 and shadow#2447 (comment). This forces users to explicitly use "./" to specify a binary in the current directory.
This is a planned breaking change for the Shadow 3.0 release. See shadow#2496 and shadow#2447 (comment). This forces users to explicitly use "./" to specify a binary in the current directory.
This is a planned breaking change for the Shadow 3.0 release. See #2496 and #2447 (comment). This forces users to explicitly use "./" to specify a binary in the current directory.

This is a pretty large PR (with some possibly controversial changes) so just tell me what I should remove / change / split up to get this merged.
This PR does the following:
Reimplements
tilde_expansionasresolve_path. It now takes a&Path, returns ananyhow::Result<PathBuf>, and looks in$PATHif input is a standalone string (e.g.truewill now resolve to/bin/true)Various edits to fix yaml files with absolute paths or relative paths that conflicted with the $PATH lookup.