Severity: High — likely breaks any first-flash on a fresh release archive that doesn't have a system OpenOCD installed.
The release archives ship the XPack OpenOCD scripts directory at <install>/scripts/ (release.yaml:42 does mv xpack-openocd-0.12.0-4/openocd/scripts/ linux/). All our .cfg files reference standard scripts via source [find ...], e.g. configs/f1x-unlock.cfg:1 does:
source [find interface/stlink.cfg]
The find directive only resolves through OpenOCD's search path. The original code passed -s scripts (relative path) so that linux/scripts/ became searchable when the binary was launched from linux/. In commit fe30049 (cleanup of "leftovers from review") I removed that argument, thinking it was unused. It wasn't.
Without -s <path-to-scripts>, the bundled OpenOCD has to fall back to its compiled-in install prefix, which doesn't match the layout the release archive produces (bin/ and scripts/ both flattened next to the executable instead of bin/../share/openocd/scripts/).
Fix
In src/open_ocd_task.rs:111-133, restore an extra -s argument pointing at <exe_dir>/scripts when that directory exists:
let scripts_folder = dirs::get_exe_dir()?.join("scripts");
// only push -s scripts_folder if scripts_folder.exists()
Use absolute paths (-s of the joined PathBuf) rather than the bare relative "scripts" so it works regardless of the user's CWD.
Repro
- Download the latest xpack-bundled release archive (
easy_flash_daplink-vX-xpack-ubuntu-XX.04.zip).
- Unzip into a fresh directory.
- Run the binary, attempt the DapLink flow.
- Expected: OpenOCD reports
Can't find interface/stlink.cfg (or similar) and the unlock step fails.
Spotted in post-merge review.
Severity: High — likely breaks any first-flash on a fresh release archive that doesn't have a system OpenOCD installed.
The release archives ship the XPack OpenOCD scripts directory at
<install>/scripts/(release.yaml:42 doesmv xpack-openocd-0.12.0-4/openocd/scripts/ linux/). All our.cfgfiles reference standard scripts viasource [find ...], e.g. configs/f1x-unlock.cfg:1 does:source [find interface/stlink.cfg]The
finddirective only resolves through OpenOCD's search path. The original code passed-s scripts(relative path) so thatlinux/scripts/became searchable when the binary was launched fromlinux/. In commitfe30049(cleanup of "leftovers from review") I removed that argument, thinking it was unused. It wasn't.Without
-s <path-to-scripts>, the bundled OpenOCD has to fall back to its compiled-in install prefix, which doesn't match the layout the release archive produces (bin/andscripts/both flattened next to the executable instead ofbin/../share/openocd/scripts/).Fix
In src/open_ocd_task.rs:111-133, restore an extra
-sargument pointing at<exe_dir>/scriptswhen that directory exists:Use absolute paths (
-sof the joinedPathBuf) rather than the bare relative"scripts"so it works regardless of the user's CWD.Repro
easy_flash_daplink-vX-xpack-ubuntu-XX.04.zip).Can't find interface/stlink.cfg(or similar) and the unlock step fails.Spotted in post-merge review.