conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
382 stars 423 forks source link

Post-link scripts in a noarch package are not properly included #5115

Open kenodegard opened 10 months ago

kenodegard commented 10 months ago

What happened?

When packaging a noarch package with post-link scripts only the post-link script cooresponding to the host machine is included in the output package and so in other words it isn't properly noarch.

The issue comes from how post-link (and pre-link and pre-unlink) scripts are detected:

https://github.com/conda/conda-build/blob/ca9de6013cf7d6909f063247512546d351f7a757/conda_build/build.py#L154-L178

Xref https://github.com/conda/conda/pull/13389

kenodegard commented 10 months ago

pre-link, post-link, and pre-unlink are viewed as dangerous and legacy/deprecated, so we should look into removing it entirely

kenodegard commented 10 months ago

conda-forge forbids post-links for noarch: https://conda-forge.org/docs/maintainer/knowledge_base.html#noarch-python

to work around this, packages will have a multi-output recipe where the package itself would be noarch but the post-links are an arch specific package: https://github.com/conda-forge/bladerf-feedstock/blob/7deba2ef18fd1a9ba69239c61f018f67c24eba97/recipe/meta.yaml#L93

mfansler commented 9 months ago

Oh wow. Having an extra output seems like overkill if I just want to emit a message to users (i.e., echo into $PREFIX/.messages.txt). Is there any alternative means of doing this then going forward?

xref: https://github.com/conda-forge/r-tinytex-feedstock/issues/53

Right now, thinking I'm just going to drop it.

mfansler commented 9 months ago

Hmm...but checking the info/files manifest does show bin/.r-tinytex-post-link.sh and the file is there. Still, seeing crashes on something as simple as echo "my message" >> .messages.txt.