Skip to content
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

Cache glob doesn't work with relative paths pointing out of the project #2804

Open
2 tasks done
phcerdan opened this issue Jan 2, 2025 · 0 comments
Open
2 tasks done

Comments

@phcerdan
Copy link

phcerdan commented Jan 2, 2025

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

[tasks]
cmd = "mkdir -p ../folder_a && echo Hello >> ../folder_a/a.txt"
outputs = ["../folder_a/a.txt"]
pixi --version
0.39.4

Issue description

Following the same example given in #1237
Not sure if expected, but the glob doesn't work if the folder is out of the project:

[tasks]
cmd = "mkdir -p ../folder_a && echo Hello >> ../folder_a/a.txt"
outputs = ["../folder_a/a.txt"]
✨ Pixi task (start in cxx): mkdir -p ../folder_a && echo Hello >> ../folder_a/a.txt
 WARN No files matched the output globs for task` 'start'
 WARN Output globs: ["../folder_a/a.txt"]

But the folder is indeed there:

ls ../folder_a
a.txt

These out of source folders are specially useful for CMake projects, where the build folder is strongly recommended to not be nested with the source (project) folder.

Something odd with the glob:

These two give different results:

This works ✅

[tasks]
cmd = "mkdir -p folder_a && echo Hello >> folder_a/a.txt"
outputs = ["folder_a/a.txt"]

This doesn't ❌

[tasks]
cmd = "mkdir -p folder_a && echo Hello >> folder_a/a.txt"
outputs = ["./folder_a/a.txt"]

Expected behavior

I expect that the glob works with relative paths:

[tasks]
cmd = "mkdir -p ../folder_a && echo Hello >> ../folder_a/a.txt"
outputs = ["../folder_a/a.txt"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant