prefix-dev / pixi

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

not excute post-link scripts #1573

Open nbzu opened 4 months ago

nbzu commented 4 months ago

Checks

Reproducible example

micromamba activate xxx
micromamba install bioconda::bioconductor-genomeinfodbdata
Rscript -e "library(GenomeInfoDbData)"
pixi project channel add bioconda
pixi add bioconductor-genomeinfodbdata
pixi run Rscript -e "library\(GenomeInfoDbData\)"

Issue description

Error in library(GenomeInfoDbData) :
  there is no package called ‘GenomeInfoDbData’
Execution halted

micromamba works well. I think pixi not excute the post-link scripts .

Expected behavior

excute post-link scripts auto. library(GenomeInfoDbData) well.

davised commented 3 months ago

I was just coming to post regarding this.

As a user, the workaround can be

cd project-dir
pixi shell
PREFIX=$CONDA_PREFIX .bioconductor-genomeinfodbdata-post-link.sh

I'm going to do this for now.

TTTPOB commented 1 month ago

this is still relavent in 2024.10.22, pixi version 0.34.0

gohweixun commented 2 weeks ago

I have just checked this on pixi version 0.36.0, the same issue still persists. Hoping to see a resolution to this, pixi works well in all other workflows.

sapetnioc commented 3 days ago

Neither post link nor pre unlink scripts are executed. The problem is still here for pixi 0.38.0 If it can help, I made a self-content script (pixi being the only requirement) to create and install a minimum package to reproduce the problem. For the package content, I followed rattler-build guidelines for packages scripts.

# Create new test directory
mkdir /tmp/test
cd /tmp/test

# Create a rattler-build recipe with both post link and pre unlink scripts
cat > recipe.yaml << END
package:
  name: pixi-bug-1573
  version: 1.0

build:
  script: |
    mkdir "\$PREFIX/bin"
    echo "touch /tmp/post-link-pixi-bug-1573" > "\$PREFIX/bin/.pixi-bug-1573-post-link.sh"
    echo "touch /tmp/pre-unlink-pixi-bug-1573" >  "\$PREFIX/bin/.pixi-bug-1573-pre-unlink.sh"
    chmod a+rx "\$PREFIX/bin/.pixi-bug-1573-post-link.sh" "\$PREFIX/bin/.pixi-bug-1573-pre-unlink.sh"
END

# Build the package
pixi init
pixi add rattler-build
pixi run rattler-build build

# Install the package
pixi project channel add file:///tmp/test/output
pixi add pixi-bug-1573

At the end, two files should exist: /tmp/post-link-pixi-bug-1573 and /tmp/pre-unlink-pixi-bug-1573. But they are not present.