pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Pixi creates incorrect shims when globally installed package has two executables with the same stem

Open jdidion opened this issue 1 year 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

pixi global install -c bioconda samtools

Issue description

The samtools package has a samtools and a samtools.pl binary. The samtools shim created in the global bin folder calls samtools.pl rather than samtools.

Expected behavior

Each executable has it's own shim with the same name.

jdidion avatar Jul 16 '24 05:07 jdidion

Not a pixi dev, but this is how they handle all binaries for global installs. Suffix gets stripped off and binary gets converted to lowercase.

I suggest not using a global install for samtools to get around this issue.

davised avatar Jul 26 '24 17:07 davised

@davised thanks for confirming that this is an issue.

I'd really appreciate a Pixi dev explaining why this is the behavior. Was there a motivating use case?

I'd like to propose a better solution: leave any file extensions on a binary in place, and create a link to the binary with extensions stripped off only if there is no conflict with an existing binary. If installing a new binary would conflict with an existing link, warn the user and require them to pass a flag to force overwriting the link.

jdidion avatar Jul 28 '24 14:07 jdidion

I understand the rationale. If you have a samtools.pl file and try to run it like perl samtools.pl, it will not work. Since the files are actually wrappers rather than say python or perl code, it doesn't make sense to leave the suffix.

I haven't seen the rationale explained anywhere, but it does seem to make sense to me.

davised avatar Aug 05 '24 22:08 davised

I'm encountering this problem too. samtools does work correctly when used in a project environment instead of globally. So this behavior just needs to be carried over to global way as well.

allytrope avatar Sep 09 '24 02:09 allytrope

Note that we are working on a revamped pixi global, so this consideration might need to be taken into account: https://pixi.sh/latest/design_proposals/pixi_global_manifest/

cc @Hofer-Julian @nichmor

tdejager avatar Sep 09 '24 06:09 tdejager

This should be fixed in the latest pixi release

Hofer-Julian avatar Nov 22 '24 16:11 Hofer-Julian