-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Executing recipes from imported justfile is done in working dir of imported file #1813
Comments
Good catch! This is indeed a bug. I opened #1817, which contains tests with no fix yet. Another potential issue is that the path of nested imports, i.e., imports within imports, are resolved relative to the directory containing the nested import source file. I think this is also a bug, and that, by the logic that imports are treated as being part of the importing justfile, they should be resolved relative to the importing justfile. Does that sound right to you? |
That behavior would seem counter-intuitive and would hinder usability when:
Currently, all imports in these situations can be relative paths. Because the paths relative to each primary justfile are different, the suggested behavior change would effectively force nested imports to be specified as absolute paths, breaking portability. Hope this bug can be fixed while preserving the existing relative path resolution basis, would be ideal if so. Thanks 🙂 |
Definitely, they're two issues, and I only mention it here because I thought about it while fixing this, and doing both invovles a similar change. I think you're right that import and modules paths should be relative to the source file, even if there's an argument that import paths are different, since they semantically are as if the contents were inserted into the importing justfile. I'm just going to leave it as is. |
Fixed in #1817! Imported recipes now run in the working directory of the importer, which works for nested imports, i.e., if you have |
Awesome! Thank you very much. Looking for ward to the next release 🙂 |
just version: 1.21.0
This bug seems like a regressions, as in 1.16.0 the
!include
statement didn't work this way and my just files were executing fine.Example
/tmp/justtest/justfile
/tmp/justtest/sub/justfile
The text was updated successfully, but these errors were encountered: