setup-pixi icon indicating copy to clipboard operation
setup-pixi copied to clipboard

Post-job cleanup fails when setup-pixi action is invoked twice

Open maresb opened this issue 8 months ago • 4 comments

See https://github.com/brendanjmeade/celeri/actions/runs/14402272022/job/40390461670?pr=141

The second cleanup fails with Error: ENOENT: no such file or directory, lstat '/home/runner/.pixi/bin/pixi'. I would have expected cleanup to be idempotent.

Image

maresb avatar Apr 11 '25 11:04 maresb

    # Don't install the environment yet.
    # We first check the lockfile explicitly in a separate step.
    - uses: prefix-dev/[email protected]
      with:
        cache: false
        run-install: false
    - name: Check if pixi lockfile is up-to-date
      run: pixi list --locked
    # Now install the environment.
    - uses: prefix-dev/[email protected]
      with:
        cache: true
        environments: ${{ matrix.pixi-environment }}

could you explain to me the reasoning why you invoke setup-pixi twice? the "check if pixi lockfile is up-to-date" step is already implicitly done by setup-pixi see https://github.com/prefix-dev/setup-pixi#--frozen-and---locked:

If you don't specify anything, the default behavior is to run pixi install --locked if a pixi.lock file is present and pixi install otherwise.

pavelzw avatar Apr 11 '25 12:04 pavelzw

Hey, ya, perhaps the real underlying issue is that the error reporting is far from ideal. Take for example this run. https://github.com/brendanjmeade/celeri/actions/runs/14400087567

Here's my UX:

Image

Big scary lots of red, exit code 1, sky is falling, no indication why. So click...

Image

Click again...

Image

And yet again...

Image

IMHO I shouldn't have to go this deeply in order to find such an obvious cause. Thus I use another job explicitly named for checking that the lockfile is up-to-date so I can see immediately. (So much red really dampens the mood. 😉) Any ideas about how to improve this?

maresb avatar Apr 11 '25 12:04 maresb

maybe a mode in pixi that indicates we are in GHA makes sense where error messages are prefixed with ::error:: (and maybe warnings with ::warning::) would probably be better imo, see also https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-error-message either pixi looks at $GITHUB_ACTIONS or we set a custom $PIXI_GITHUB_ACTIONS env variable (i would be in favor of the former). rattler-build already has something similar

pavelzw avatar Apr 11 '25 12:04 pavelzw

created an issue in pixi: https://github.com/prefix-dev/pixi/issues/3574

pavelzw avatar Apr 11 '25 13:04 pavelzw

this was not fixed completely. in #211 / v0.8.12 i will fix this correctly

pavelzw avatar Jul 17 '25 11:07 pavelzw