conda-forge.github.io icon indicating copy to clipboard operation
conda-forge.github.io copied to clipboard

Policy: where should binaries go

Open jankatins opened this issue 9 years ago • 14 comments

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...

jankatins avatar Feb 14 '16 16:02 jankatins

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.

pelson avatar Feb 15 '16 09:02 pelson

On Mon, Feb 15, 2016 at 1:09 AM, Phil Elson [email protected] 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

[email protected]

ChrisBarker-NOAA avatar Feb 16 '16 00:02 ChrisBarker-NOAA

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.

pelson avatar Feb 18 '16 15:02 pelson

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

PythonCHB avatar Feb 18 '16 21:02 PythonCHB

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

jakirkham avatar Apr 29 '16 23:04 jakirkham

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

pelson avatar Apr 30 '16 10:04 pelson

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

jakirkham avatar May 14 '16 13:05 jakirkham

@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?

kathatherine avatar Mar 07 '22 23:03 kathatherine

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:

  • Executables and DLLs in LIBRARY_BIN
  • LIBs in LIBRARY_LIB (only used at build time)
  • Scripts in SCRIPTS

jakirkham avatar Apr 05 '22 22:04 jakirkham

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?

ChrisBarker-NOAA avatar Apr 05 '22 23:04 ChrisBarker-NOAA

Yeah exactly.

jakirkham avatar Apr 06 '22 04:04 jakirkham

@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 avatar Jun 03 '22 20:06 kathatherine

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

kathatherine avatar Jun 03 '22 20:06 kathatherine

Yes

That could be a natural place to include this

jakirkham avatar Jun 03 '22 21:06 jakirkham