prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.33k stars 186 forks source link

cannot get extension: MissingExtensionPath("A:\\code\\{foobar-py}", Dist) #2492

Open maphew opened 2 hours ago

maphew commented 2 hours ago

Checks

Reproducible example

pixi 0.36.0

A:\code\metril                                                                    
λ pixi shell                                                                          
thread 'main' panicked at src\lock_file\satisfiability.rs:257:34:                 
cannot get extension: MissingExtensionPath("A:\\code\\trilium-py", Dist)          
stack backtrace:                                                                  
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backt
race.                                                                             

A:\code\metril                                                                    
λ set rust_backtrace=full                                                         

A:\code\metril                                                                    
λ pixi s                                                                          
thread 'main' panicked at src\lock_file\satisfiability.rs:257:34:                 
cannot get extension: MissingExtensionPath("A:\\code\\trilium-py", Dist)          
stack backtrace:                                                                  
   0:     0x7ff74b79226d - <unknown>                                              
   1:     0x7ff74a98d799 - <unknown>                                              
   2:     0x7ff74b76f5d1 - <unknown>                                              
   3:     0x7ff74b795f37 - <unknown>                                              
   4:     0x7ff74b796d97 - <unknown>                                              
   5:     0x7ff74b7967d6 - <unknown>                                              
   6:     0x7ff74b79672f - <unknown>                                              
   7:     0x7ff74b796716 - <unknown>                                              
   8:     0x7ff74bcb95a4 - <unknown>                                              
   9:     0x7ff74bcb9aa0 - <unknown>                                              
  10:     0x7ff74af065cd - <unknown>                                              
  11:     0x7ff74aef0cb1 - <unknown>                                              
  12:     0x7ff74a5a9e51 - <unknown>                                              
  13:     0x7ff74a3f8a1b - <unknown>                                              
  14:     0x7ff74a41bb99 - <unknown>                                              
  15:     0x7ff74a88cb9a - <unknown>                                              
  16:     0x7ff74a889d81 - <unknown>                                              
  17:     0x7ff74a2b8f36 - <unknown>                                              
  18:     0x7ff74a891d58 - <unknown>                                              
  19:     0x7ff74bc5539c - <unknown>                                              
  20:     0x7ffdef70259d - BaseThreadInitThunk                                    
  21:     0x7ffdf050af38 - RtlUserThreadStart                                     

The project: metril.zip

The missing extension is a local clone of https://github.com/Nriver/trilium-py/. It exists in the expected folder.

A:\code\metril
λ dir \code\trilium-py\pyproject.toml
 Volume in drive A is deva
 Volume Serial Number is FCE0-A275

 Directory of A:\code\trilium-py

2024-11-09  08:35 AM             1,278 pyproject.toml
               1 File(s)          1,278 bytes
               0 Dir(s)  79,768,576,000 bytes free

Issue description

5 days ago this worked fine. Code and files have changed in the metril folder but not in trilium-py.

Expected behavior

that pixi shell would work

maphew commented 2 hours ago

running pixi upgrade fixed it. Leaving issue open as I expect someone might want to handle with an error and some user advice instead of a stack trace

maphew commented 2 hours ago

I figured out what happened. The location on disk of metril and trilium-py differ between my laptop and workstation. When I updated the laptop checkout folder from scm I forgot the manual step of changing the path in pyproject.toml before attempting to open pixi shell.

Being able to use relative paths for local dependencies would alleviate this forget hazard (#1591 )

-dependencies = ["trilium-py @ file:///A:/code/mhw/trilium-py"]
+dependencies = ["trilium-py @ file:///A:/code/trilium-py"]
 # this will break on other machines, https://github.com/prefix-dev/pixi/issues/1591
 # for now install manually with `pip install -e ../trilium-py`
 #dependencies = ["trilium-py @ file:///A:/code/mhw/trilium-py"]
maphew commented 1 hour ago

no, previous comment is wrong, changing path is not the cause.

I can reproduce the backtrace on a fresh checkout in a completely new folder. The shell works the first time it's invoked but the 2nd time it panicks.

Recipe:

cd /d a:\code
md t && cd t

:: checkout fresh copy from Fossil-scm repo
:: note: is newer than the attached one above
:: but only relevent change is `pyproject.toml` versions after `pixi upgrade`
fossil open ..\metril\fossil.db

pixi shell
exit
pixi shell
A:\code\t
λ pixi s

(metril) A:\code\t>exit

A:\code\t
λ pixi s
thread 'main' panicked at src\lock_file\satisfiability.rs:257:34:
cannot get extension: MissingExtensionPath("A:\\code\\trilium-py", Dist)
stack backtrace:
   0:     0x7ff74b79226d - <unknown>
   1:     0x7ff74a98d799 - <unknown>
   2:     0x7ff74b76f5d1 - <unknown>
   3:     0x7ff74b795f37 - <unknown>
   4:     0x7ff74b796d97 - <unknown>
   5:     0x7ff74b7967d6 - <unknown>
   6:     0x7ff74b79672f - <unknown>
   7:     0x7ff74b796716 - <unknown>
   8:     0x7ff74bcb95a4 - <unknown>
   9:     0x7ff74bcb9aa0 - <unknown>
  10:     0x7ff74af065cd - <unknown>
  11:     0x7ff74aef0cb1 - <unknown>
  12:     0x7ff74a5a9e51 - <unknown>
  13:     0x7ff74a3f8a1b - <unknown>
  14:     0x7ff74a41bb99 - <unknown>
  15:     0x7ff74a88cb9a - <unknown>
  16:     0x7ff74a889d81 - <unknown>
  17:     0x7ff74a2b8f36 - <unknown>
  18:     0x7ff74a891d58 - <unknown>
  19:     0x7ff74bc5539c - <unknown>
  20:     0x7ffdef70259d - BaseThreadInitThunk
  21:     0x7ffdf050af38 - RtlUserThreadStart