conda-forge / conda-forge.github.io

The conda-forge website.
https://conda-forge.org
BSD 3-Clause "New" or "Revised" License
127 stars 273 forks source link

Policy: where should binaries go #26

Open jankatins opened 8 years ago

jankatins commented 8 years ago

E.g. if a environment should contain a binary which should be available to python apps which run in that enviroment. E.g. pandoc, whichshould be available for nbconvert or pypandoc.

This isn't handled consitently in the conda-recipe repo: a linux is isnatleld into PREFIX/bin, but windows sometimes into LIBRARY_BIN and sometimes into SCRIPTS.

In my windows python, LIBRARY_BIN is automatically added to the path (os.environ["PATH"] contains LIBRARY_BIN) but not scripts. For this I would prefer that such apps go into LIBRARY_LIB, so that they are available even if I don't activate the env but call python there directly.

I've no clue how Linux/OSX handle this...

pelson commented 8 years ago

I've no clue how Linux/OSX handle this...

lib is the place for binaries there.

On Windows this is a problem for conda as discussed in https://github.com/ContinuumIO/anaconda-issues/issues/509 and https://github.com/ContinuumIO/anaconda-issues/issues/233.

Anything that is intended to be executable or shared (i.e. a DLL) by an executable, should live in the %SCRIPTS% directory.

I agree though. Clear policy on this would be an excellent addition, and would go above and beyond what has already been documented for conda-build.

ChrisBarker-NOAA commented 8 years ago

On Mon, Feb 15, 2016 at 1:09 AM, Phil Elson notifications@github.com wrote:

I've no clue how Linux/OSX handle this...

lib is the place for binaries there.

really? I thought lib was for libs, and bin for binaries (or executable scripts.)

On Windows

Windows is a mess because it looks for both executables AND dlls on PATH. so I suppose you might as well put dlls in Scripts.

this is a problem for conda as discussed in ContinuumIO/anaconda-issues#509

https://github.com/ContinuumIO/anaconda-issues/issues/509 and ContinuumIO/anaconda-issues#233 https://github.com/ContinuumIO/anaconda-issues/issues/233.

Anything that is intended to be executable or shared (i.e. a DLL) by an executable, should live in the %SCRIPTS% directory.

509 make it look like they are going sup support Libary dir of some sort

-- but I lost track...

I agree though. Clear policy on this would be an excellent addition, and would go above and beyond what has already been documented for conda-build.

for sure.

-CHB

Christopher Barker, Ph.D. Oceanographer

Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

pelson commented 8 years ago

really? I thought lib was for libs, and bin for binaries (or executable scripts.)

Re-reading the original post, I agree with you. In this context, binaries meant "executables", which should live in bin. Luckily it is only Windows where this is ambiguous.

PythonCHB commented 8 years ago

Exactly-- as Windows searches for both dlls and executables (and scripts) on %PATH%, it doesn't make a difference if you mix them up.

jakirkham commented 8 years ago

Is there anything else to be answered here or can this be closed?

pelson commented 8 years ago

I think this is just a documentation issue now. Might not even live in conda-forge. It could be a conda-build docs issue...

jakirkham commented 8 years ago

cc-ing @msarahan in regards to the documentation issue.

kathatherine commented 2 years ago

@jakirkham @pelson Doesn't seem like this ever went anywhere. I'm happy to create an issue in conda-build for this, if I can just get some help narrowing down what is needed. We can also put a note somewhere in the conda-forge docs. Is this knowledge for package creators or packages users? Or both?

jakirkham commented 2 years ago

Hey @kathatherine, the gist of the issue is that on Windows directories containing scripts, executables and libraries are added to the same PATH environment variable. Windows uses this environment variable both when searching for a script or an executable to run and when searching for libraries to link to. Unix-y OSes don't do this. So there is an ambiguity around where scripts, executables, and libraries should be placed. It would be good to have this clarified in the conda-build docs. One answer to this would be:

ChrisBarker-NOAA commented 2 years ago

Windows uses this environment variable both when searching for a script or an executable to run and when searching for libraries to link to

Executables and DLLs in LIBRARY_BIN

Windows also looks for dlls "next to" an executable or other library -- so putting them together makes sense.

This leads to DLL Hell, but that comes with the territory.

@jakirkham: what's the difference in this contect between Scripts and Executables? Is a script a Python (opr other interpreted language) script, and therefor not linked directly to any DLLs?

jakirkham commented 2 years ago

Yeah exactly.

kathatherine commented 2 years ago

@jakirkham So just to clarify, this is for package builders to know better where to place things so that users of their packages won't have to do it manually?

kathatherine commented 2 years ago

I'm currently assuming this is what needs more information: https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html#environment-variables-set-during-the-build-process

jakirkham commented 2 years ago

Yes

That could be a natural place to include this