Closed Hypercubed closed 2 years ago
This is because we don't currently fully support a ./
at the start of a path. We always assume paths start without ../
or ./
or /
and are not absolute paths and are relative to the chompfile. We should definitely improve this support though as it's a clear pitfall.
Yep... I see that removing the path from run1
works:
[[task]]
name = 'run1:#'
dep = '#.txt'
target = '#.out'
validation = 'ok-only'
run = 'echo $DEP $TARGET'
However, run2
requires a path:
[[task]]
name = 'run2:##'
dep = '##.txt'
target = '##.out'
validation = 'ok-only'
run = 'echo $DEP $TARGET'
Error: Unable to apply deep globbing to interpolate ##.txt. Deep globbing interpolates are only supported for full paths with '##' immediately following a separator position.
Interesting, that's two separate bugs then. Lucky there's a workaround for both!
Added a fix for the second case in https://github.com/guybedford/chomp/commit/255af4ae5edcfc94733a8640e0a6cac01091be7b.
Is there a reason why paths can't start with ../? I am doing that.. I have a monorepo where test fixtures are located outside of each project file.
No reason, I just haven't handled path normalization that way so it would be a large change, happy to create a tracking issue for it though.
Wish I had the rust skills to contribute. I think this change will kill my usage. You mentioned a work around? Only thing I can think of is using absolute paths... not very portable.
I will see if I can do the refactoring, it's simply a case of updating the pathing structure throughout the codebase to be resolved paths and not relative paths. Posted https://github.com/guybedford/chomp/issues/131.
Please see the following gist. I created a task (two actually with the same result). When running a "wildcard" task as expected the task runs for each dep. However, the
$DEP
and$TARGET
values contain truncated paths.https://gist.github.com/Hypercubed/c5c11a4ba3bc164ac1165e08ea603740