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

Task caching only works if the directory is a subdirectory of cwd #1237

Closed
2 tasks done
Hofer-Julian opened this issue Apr 19, 2024 · 4 comments
Closed
2 tasks done
Labels
🐞 bug Something isn't working

Comments

@Hofer-Julian
Copy link
Contributor

Hofer-Julian commented Apr 19, 2024

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

git clone https://github.com/Hofer-Julian/pixi-task-cache-cwd
cd pixi-task-cache-cwd
pixi run start # it is not cached
pixi run start # it is cached but shouldn't be since output folder has been modified

Issue description

Another issue popped up with @Jingru923's work.
My minimal example has a task defined like this

[tasks]
start = { cmd = "echo Hello >> ../folder_a/a.txt", 
          cwd = "folder_b", inputs = ["b.py"],
          outputs = ["../folder_a/a.txt"]}

The cache should be invalidated every single time.
However, when running pixi run --verbose start, one can read from the logs that a.txt isn't tracked.
So we get a cache hit, after the first run.

Related to #1139

Expected behavior

It should be possible to track folders that aren't in cwd.
@wolfv wondered in #1139 (comment)

Now, I am not sure what we should do ... use the cwd or not? I do think that we may not want to use the cwd for the inputs and outputs path computation.

My first instinct was to not take it into account, so I have a slight preference for that.

@Hofer-Julian Hofer-Julian added the 🐞 bug Something isn't working label Apr 19, 2024
@wolfv
Copy link
Member

wolfv commented Apr 19, 2024

We have some larger updates to the cache behavior in main: #1204

I am not sure if it will fix this issue, but it does fix some issues around cwd + cache (uses the project root instead of the task.cwd).

@wolfv
Copy link
Member

wolfv commented Apr 20, 2024

Could you retry with yesterday's release? I think this is fixed :)

@Hofer-Julian
Copy link
Contributor Author

I can confirm that now that the project root is used for inputs and outputs this isn't a problem anymore.

@wolfv
Copy link
Member

wolfv commented Apr 21, 2024

Thanks @Hofer-Julian!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants