Closed MarijnS95 closed 3 years ago
@dvc94ch It doesn't seem like there's an easy to_absolute
function in std
covering this logic, prepending current_dir
if absolute, but without canonicalization?
@dvc94ch Thanks! Can you yank 0.4.8 and make a re-release with this fixup?
I don't think it has to be yanked, I published as 0.4.10.
Canonicalization requires the path to exist such that the OS can resolve symlinks. The
target/
folder doesn't exist in a clean build environment (ie. after cloning or runningcargo clean
), causing the unwrap to panic.The same logic is applied to paths coming from
--target-dir
which may or may not be relative. Paths fromfind_workspace
(based on those fromfind_package
) are already canonicalized, however.Tested normal
cargo apk
invocation with and withouttarget/
dir, andCARGO_TARGET_DIR
with relative and absolute path.Fixes: bec3883 ("subcommand: Listen to CARGO(BUILD)TARGET_DIR over cwd (#4)")