Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-27 Thread Vladimír Čunát
On 04/27/2015 09:03 PM, Eric Merritt wrote:
> When ocaml build B, then it fails because it can't load the *.so that is
> part of A.

That all seems to boil down to the question: how are those so-files
searched for? (by the ocaml compiler, I guess, or by what?)


Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-27 Thread Vladimír Čunát
On 04/27/2015 09:03 PM, Eric Merritt wrote:
> When ocaml build B, then it fails because it can't load the *.so that is
> part of A.

That all seems to boil down to the question: how are those so-files
searched for? (by the ocaml compiler, I guess, or by what?)


Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-27 Thread Vincent Laporte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Le 2015-04-27 21:08, Vladimír Čunát a ēcrit :
> On 04/27/2015 09:03 PM, Eric Merritt wrote:
>> When ocaml build B, then it fails because it can't load the *.so
>> that is part of A.
> 
> That all seems to boil down to the question: how are those
> so-files searched for? (by the ocaml compiler, I guess, or by
> what?)

The compiler looks in the colon-separated list of directories given in
the CAML_LD_LIBRARY_PATH environment variable.

Cheers,
- --
Vincent.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJVPoodAAoJEEEW/4F+UwyXKEgP/RCBFSFvNpnCLqMhhfJCCFoJ
yDE7WcmQ4+nn1OGFQvWpw5XGhnnR/DzMaoKXDWsOjJRTpz01Kynoi1thNiaLWFDW
cwMmk4YN+HhFXwsR9cmse+j3Vqg9qYezFchVFHfFBoVamipQzgKzFx8rPjOQN1dn
e446svgILwSF2rbN+shjIZ4AZ4/eqv5UYa5aURQ0ZnkAqFaH5yKqtnsM0h1sO0Xw
O+bqM4gAv9Mv4L/TH6v689XrU8oNs+4pynjQ2uiUszmCV9WAHM8KJYiZEi90vey9
Ic3Zgdo3xgsIOSbH4C0o7t3WfjtJm2ttugyqEhpJyHBk9jF040QkrPljYsJ4S0ez
z71N4P8NDPD/Rb9Eqrb0U+Q+mZ2a1ripmo2sGmFN4JBSd64517QkDApM+FcjwPRp
63GrHCROBamWj8EoEHZJNyep/dS+3XMzhH0muhbDH/t/r5d6eJ+NnDED3QThttAT
xQwatpNbhBnoVqNRUCDNZovoBiZahJ3y57OeuR2kc42vCJCoYWtJwQNqZ3IXLlmP
NSrRKkgQTM+VLBDzmy+2RSkFO7NnEhknUEzezIfYxGR2+UiKtfjbuoSrnVE7AIhf
bhW87a6ax6kBRZSHJL1IJ41Hq6ji1p8i0pMg4XDe3Ol0bhJLjwpg1tgF8x6Wj51y
NMBrfywQAhZuLkURdUZ+
=dZON
-END PGP SIGNATURE-
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-27 Thread Vladimír Čunát
On 04/27/2015 09:14 PM, Vincent Laporte wrote:
> Le 2015-04-27 21:08, Vladimír Čunát a ēcrit :
>> On 04/27/2015 09:03 PM, Eric Merritt wrote:
>>> When ocaml build B, then it fails because it can't load the *.so
>>> that is part of A.
> 
>> That all seems to boil down to the question: how are those
>> so-files searched for? (by the ocaml compiler, I guess, or by
>> what?)
> 
> The compiler looks in the colon-separated list of directories given in
> the CAML_LD_LIBRARY_PATH environment variable.

If that pattern recurs in ocaml-built packages, I'd expect the compiler
to define an envHook to automatically extend that variable by build
inputs containing such modules. We have already a few very similar cases
in nixpkgs, e.g.:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/science/logic/coq/default.nix#L50


Vladimir



smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-27 Thread Eric Merritt
Thanks all of you. I added the following to my dependee (bin_prot) and it
worked nicely.

 setupHook = writeText "setupHook.sh" ''
  export
CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/bin_prot/"
'';

On Mon, Apr 27, 2015 at 12:37 PM, Vladimír Čunát  wrote:

> On 04/27/2015 09:14 PM, Vincent Laporte wrote:
> > Le 2015-04-27 21:08, Vladimír Čunát a ēcrit :
> >> On 04/27/2015 09:03 PM, Eric Merritt wrote:
> >>> When ocaml build B, then it fails because it can't load the *.so
> >>> that is part of A.
> >
> >> That all seems to boil down to the question: how are those
> >> so-files searched for? (by the ocaml compiler, I guess, or by
> >> what?)
> >
> > The compiler looks in the colon-separated list of directories given in
> > the CAML_LD_LIBRARY_PATH environment variable.
>
> If that pattern recurs in ocaml-built packages, I'd expect the compiler
> to define an envHook to automatically extend that variable by build
> inputs containing such modules. We have already a few very similar cases
> in nixpkgs, e.g.:
>
>
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/science/logic/coq/default.nix#L50
>
>
> Vladimir
>
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-28 Thread Vladimír Čunát
On 04/27/2015 10:42 PM, Eric Merritt wrote:
> Thanks all of you. I added the following to my dependee (bin_prot) and
> it worked nicely.
> 
>  setupHook = writeText "setupHook.sh" ''
>   export
> CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/bin_prot/"
> '';

Just note that without testing existence of the directories, the
variable will likely be filled with many paths from other build inputs.
Having nonexistent directories in there probably won't matter, although
it doesn't look nice.

Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Loading a shared object into the compiler at build time fails

2015-04-28 Thread Eric Merritt
So this is the setuphook of the dependee not the compiler. The directory is
there because the package creates it. Is there some subtlety I am missing
in the way nix handles packages?

On Tue, Apr 28, 2015 at 3:14 AM, Vladimír Čunát  wrote:

> On 04/27/2015 10:42 PM, Eric Merritt wrote:
> > Thanks all of you. I added the following to my dependee (bin_prot) and
> > it worked nicely.
> >
> >  setupHook = writeText "setupHook.sh" ''
> >   export
> >
> CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/bin_prot/"
> > '';
>
> Just note that without testing existence of the directories, the
> variable will likely be filled with many paths from other build inputs.
> Having nonexistent directories in there probably won't matter, although
> it doesn't look nice.
>
> Vladimir
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev