Look for redumper on PATH#4
Conversation
find_redumper() only looked next to the executable, so the program refused to start with "'redumper' executable not found" even when redumper was installed and on PATH. That is the situation a distribution package is in: the two programs are separate packages, and the GUI is not installed next to redumper. Look on PATH when the executable's own directory does not hold it, the same way MPF.Check is already located in postprocess.rs. dump.rs resolved the path a second time and independently, so a redumper found on PATH at startup would have been lost again when the dump started. It now uses find_redumper() as well, which also removes two unwrap() calls on current_exe().
|
My concern about this is that there is no way to verify that the version of redumper on PATH is a compatible version. Both older and newer versions are not guaranteed to have the same set of flags, or output to the log in the same way that the GUI is expecting. That is why I bundle redumper with my releases. Even better for mac: I put redumper inside the .app file. The reason why I look at PATH for MPF.Check is that I have no requirement for the version of MPF, later versions are likely to work just fine. |
|
Thanks — that's a fair concern, and you're right that the GUI is coupled to redumper: it parses redumper's log output (disc-profile refinement, sector counts), so an unexpected version could misbehave. Pinning is justified. I think the change is narrower than it may read, though, and doesn't weaken that. Precedence is unchanged: the executable's own directory is checked first, and PATH is only a fallback. Measured on this branch with a stub
So the portable release is unaffected: it bundles redumper next to the executable (and inside the Which redumper runs is decided by whoever assembles the install, not by this lookup: your release bundles the pinned build; a distribution pins it in packaging. For a distribution that pins, the mechanism is exactly what you suggested — place that build next to the GUI. The Fedora/openSUSE packaging does this with a symlink in the GUI's private directory ( What the PR changes is limited to:
If you'd rather users always place redumper next to the GUI, I'm happy to narrow this to just the Generated with Claude Opus 4.8. |
find_redumper()only looks next to the executable, so the program refuses to start with "'redumper' executable not found" even when redumper is installed and onPATH. That is exactly the situation a distribution package is in: the two programs are separate packages, and the GUI is not installed next to redumper.MPF.Checkis already located this way —postprocess.rslooks in the executable's directory first and falls back toPATH. This givesredumperthe same treatment.dump.rsresolved the path a second time and independently of the startup check, so a redumper found onPATHwould have been lost again the moment a dump started: the program would have come up and then failed to spawn. It now callsfind_redumper()as well, which also removes twounwrap()calls oncurrent_exe()that would panic rather than report.Measured on Fedora 44 against
main(b3939d7), on real hardware — a Plextor PX-760A over USB with a CD in it — withredumperonPATHand no redumper next to the executable:main/usr/bin/redumperis onPATHPATHand dumps the discOn this branch the spawned process was
/usr/bin/redumper disc --auto-detect --drive=/dev/sg1 --image-name=… --retries=1 --speed=16, running from the output directory, with its output streaming into the log window as usual. It read the disc through to the end — 226575 of 226575 sectors, no SCSI errors and no C2 errors — so both call sites resolve, not just the startup check. (I stopped the run during redumper's trailing Plextor lead-in phase; that was my harness timing out, nothing to do with this change.)Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.