Skip to content

bug(task): No cache hit anymore when same task gets used as dependency #4864

@haecker-felix

Description

@haecker-felix

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

Commands I ran and their output:

(myproject) haecker-felix@Felixs-MacBook-Pro myproject % pixi run preprocess
✨ Pixi task (preprocess): python3 src/preprocess/preprocess.py                                                                           
Task 'preprocess' can be skipped (cache hit) 🚀                                                                                           

-> cache hit for preprocess, good.

(myproject) haecker-felix@Felixs-MacBook-Pro myproject % pixi run train     
✨ Pixi task (preprocess): python3 src/preprocess/preprocess.py                                                                           
[starts with work...]

-> same preprocess task, just as dependency of train task -> no cache hit anymore for preprocess.

pixi.toml/pyproject.toml file that reproduces my issue:

[workspace]
authors = ["Felix Häcker <[email protected]>"]
channels = ["conda-forge"]
name = "myproject"
platforms = ["osx-arm64", "linux-64", "win-64"]
version = "0.1.0"

[system-requirements]
cuda = "12.0"

[tasks]
preprocess = { cmd = "python3 src/preprocess/preprocess.py", inputs = [
    "src/preprocess/*",
    "dataset/original_labeled/*.jpg",
] }
train = { cmd = "python3 src/train/train.py", depends-on = ["preprocess"] }
evaluate = "tensorboard --logdir training --port 8008"

[dependencies]
python = ">=3.8.0,<3.15"
tensorboard = ">=2.20.0,<3"
ultralytics = ">=8.3.220,<9"
opencv = ">=4.11.0,<5"
py-opencv = ">=4.11.0,<5"
pytorch = ">=2.7.1,<3"
numpy = ">=2.3.4,<3"
pandas = ">=2.3.3,<3"
matplotlib = ">=3.10.7,<4"
torchvision = ">=0.22.0,<0.23"
tomli = ">=2.3.0,<3"
scikit-learn = ">=1.7.2,<2"
tqdm = ">=4.67.1,<5"

[target.linux-64.dependencies]
pytorch-gpu = ">=2.7.1,<3"

[target.win-64.dependencies]
pytorch-gpu = ">=2.7.1,<3"

pixi info output:

(myproject) haecker-felix@Felixs-MacBook-Pro myproject % pixi info
System
------------
       Pixi version: 0.59.0
           Platform: osx-arm64
   Virtual packages: __unix=0=0
                   : __osx=26.1=0
                   : __archspec=1=m1
          Cache dir: /Users/haecker-felix/Library/Caches/rattler/cache
       Auth storage: /Users/haecker-felix/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /Users/haecker-felix/.pixi/bin
    Environment dir: /Users/haecker-felix/.pixi/envs
       Manifest dir: /Users/haecker-felix/.pixi/manifests/pixi-global.toml

Workspace
------------
               Name: myproject
            Version: 0.1.0
      Manifest file: /Users/haecker-felix/Documents/Projekte/myproject/pixi.toml
       Last updated: 31-10-2025 13:34:45

Environments
------------
        Environment: default
           Features: default
           Channels: conda-forge
   Dependency count: 13
       Dependencies: python, tensorboard, ultralytics, opencv, py-opencv, pytorch, numpy, pandas, matplotlib, torchvision, tomli, scikit-learn, tqdm
   Target platforms: osx-arm64, linux-64, win-64
    Prefix location: /Users/haecker-felix/Documents/Projekte/myproject/.pixi/envs/default
System requirements: cuda = "12.0"
              Tasks: train, preprocess, evaluate

Other files (e.g. script files, source files, etc.):

Issue description

No response

Expected behavior

When the same task gets used as dependency of a different task, I expect that the already existing cache gets reused.

Metadata

Metadata

Assignees

Labels

area:tasksRelated to pixi tasksbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions