pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Pixi wrongly thinks lockfile is outdated due to symlink

Open kcajf opened this issue 2 years ago • 5 comments

Checks

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

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

Reproducible example

Install a pypi editable package through a symlink:

pixi.toml:

mypackage = { path = "./other-repo-symlink/src/python/mypackage ", editable = true }

Issue description

When solving my environment, pixi always thinks that the lockfile is out of date:

 INFO pixi::lock_file::outdated: the dependencies of environment 'default' for platform linux-64 are out of date because the editable package path 'mypackage', lock does not equal spec path '/data/home/kcajf/code/myrepo/./other-repo-symlink/src/python/mypackage' == '/data/home/kcajf/code/other-repo/src/python/mypackage'

On my system, /data/home/kcajf/code/myrepo/./other-repo-symlink is a symlink to /data/home/kcajf/code/other-repo. These two paths are the same, but pixi doesn't think they are.

Expected behavior

Pixi should resolve the real path of these two (or keep them both unresolved), and identify that they are the same.

kcajf avatar Sep 11 '24 12:09 kcajf

If, in my pixi.toml I hardcode the absolute path, pixi install no longer re-solves the lock file. (I can't hardcode the path though, because it needs to be a symlink for portability between internal users / systems).

kcajf avatar Sep 11 '24 12:09 kcajf

hey @kcajf ! thanks for reporting this (even it is unfortunately that it doesn't work for you) I will take a look and comeback with an answer for this

nichtmacho avatar Sep 11 '24 14:09 nichtmacho

how do you create the symlink? is it a soft or hard one?

nichtmacho avatar Sep 11 '24 16:09 nichtmacho

It's a soft/symbolic link.

kcajf avatar Sep 12 '24 07:09 kcajf

We get the same (similar?) error on our repo (https://github.com/Deltares/Ribasim-NL/pull/144), where we have a relative path to another checked out repository:

INFO pixi::lock_file::outdated: the dependencies of environment 'dev' for platform linux-64 are out of date because the editable package path 'ribasim', lock does not equal spec path '/home/runner/work/Ribasim-NL/Ribasim-NL/Ribasim-NL/../Ribasim/python/ribasim' == '/home/runner/work/Ribasim-NL/Ribasim-NL/Ribasim/python/ribasim'

evetion avatar Sep 12 '24 14:09 evetion