!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

899 Members
For people hacking on the Nix package manager itself188 Servers

Load older messages


SenderMessageTime
22 Jun 2021
@pamplemouss_:matrix.orgpamplemousse

And some things are pretty mysterious...
For example, when using --prefix=outputs/out:

[pamplemousse@wasu:~/Workspace/tools/nix]$ ldd outputs/out/bin/nix-build
        [...]
        libnixexpr.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixexpr.so (0x00007f1b1fe51000)
        libnixmain.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixmain.so (0x00007f1b1fafe000)
        libnixfetchers.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixfetchers.so (0x00007f1b1f735000)
        libnixstore.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixstore.so (0x00007f1b1ea89000)
        libnixutil.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixutil.so (0x00007f1b1e49b000)
        libnixcmd.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixcmd.so (0x00007f1b1e2b9000)
        [...]

I don't understand how the outputs/out/lib/*.so are referenced here... (i.e. where in the .mk these are set up).

23:58:22
23 Jun 2021
@abathur:matrix.orgabathur
In reply to @pamplemouss_:matrix.org

And some things are pretty mysterious...
For example, when using --prefix=outputs/out:

[pamplemousse@wasu:~/Workspace/tools/nix]$ ldd outputs/out/bin/nix-build
        [...]
        libnixexpr.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixexpr.so (0x00007f1b1fe51000)
        libnixmain.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixmain.so (0x00007f1b1fafe000)
        libnixfetchers.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixfetchers.so (0x00007f1b1f735000)
        libnixstore.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixstore.so (0x00007f1b1ea89000)
        libnixutil.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixutil.so (0x00007f1b1e49b000)
        libnixcmd.so => /home/pamplemousse/Workspace/tools/nix/outputs/out/lib/libnixcmd.so (0x00007f1b1e2b9000)
        [...]

I don't understand how the outputs/out/lib/*.so are referenced here... (i.e. where in the .mk these are set up).

not familiar with building nix, but it looks it's fairly abstracted :)
the individual local.mk files scattered through the source get iteratively processed at https://github.com/NixOS/nix/blob/master/mk/lib.mk#L96 and then instantiated a few lines later
03:13:13
@abathur:matrix.orgabathurnot certain if that answers the question03:13:28
@pamplemouss_:matrix.orgpamplemousse Yeah, I more or less figured that.
What I am confused about is that as per mk/libraries.mk, it seems that the libraries libnix*.so are built in their respective src/lib*/, and only moved to outputs/out/ (or whatever is in --prefix) when make install (mk/lib.mk using "functions" declared in mk/install.mk).
I don't get how the final binary is linked agains't it before they are installed πŸ˜•
03:19:19
@theophane:hufschmitt.netRegnat pamplemousse as far as I understand, the link logic is actually duplicated: make will build everything in place (and src/nix/nix will use the libs built in-tree), while make install will directly link things at their final location, and set the rpath to this location (here) 05:17:47
@theophane:hufschmitt.netRegnat So running make and make install will actually result in two different builds of the .so files 05:19:09
@anubhavkini:matrix.organubhavkini joined the room.06:52:53
@jtojnar:matrix.orgJan TojnarAny chance of getting https://github.com/NixOS/nix/pull/4873 in?15:38:50
@pamplemouss_:matrix.orgpamplemousse I didn't think about the rpathπŸ€¦β€β™‚οΈ 16:01:53
@pamplemouss_:matrix.orgpamplemousse
In reply to @theophane:hufschmitt.net
So running make and make install will actually result in two different builds of the .so files
Do you mean that the .so will be compiled twice?
16:03:00
@theophane:hufschmitt.netRegnat
In reply to @pamplemouss_:matrix.org
Do you mean that the .so will be compiled twice?
I think so, yes
16:53:59
@theophane:hufschmitt.netRegnat (I mean, if you just run make install then the in-tree so won’t be compiled, but if you run both, then they will be compiled twice) 16:54:33
@pamplemouss_:matrix.orgpamplemousse πŸ€” ...
I thought they were only compiled on make, and mved on make install.
Rest is rpath doing its job at run-time, and being set to the proper destination on make install...
16:55:24
@abathur:matrix.orgabathurI guess --trace would disambiguate, if it's digestible18:39:02
@pamplemouss_:matrix.orgpamplemousse --just-print 18:41:49
@pamplemouss_:matrix.orgpamplemoussedoes not even run the commands :)18:42:11
@ambroisie:belanyi.frAmbroisie joined the room.19:13:32
24 Jun 2021
@niksnut:matrix.orgniksnut There is basically no reason anymore to run make, just use make install. This is because the tests require an installed package. 11:02:22
@pamplemouss_:matrix.orgpamplemousseShould this be reflected in https://hydra.nixos.org/build/144378897/download/2/manual/contributing/hacking.html ?15:31:28
@pamplemouss_:matrix.orgpamplemousse

And also:

no reason anymore
I wonder if my use case is not one such reason...
I want to produce binaries, that use customized (instrumented) version of the different libraries.

15:40:26
@pamplemouss_:matrix.orgpamplemousse *

And also:

no reason anymore

I wonder if my use case is not one such reason...
I want to produce binaries, that use customized (instrumented) version of the different libraries.

15:40:34
@theophane:hufschmitt.netRegnat
In reply to @pamplemouss_:matrix.org

And also:

no reason anymore

I wonder if my use case is not one such reason...
I want to produce binaries, that use customized (instrumented) version of the different libraries.

I’d rather make a fully different build with different configure flags for that. That would make things more robust
18:25:45
25 Jun 2021
@tim140123:matrix.orgBramfatur joined the room.13:59:29
@ma27:nicht-so.sexyma27 niksnut: is there anything else tbd for https://github.com/NixOS/nix/pull/4770 ? %) 21:32:42
@gilganix:matrix.org-(𝕂eloΟ„)- changed their display name from -(GNU/ℝτ)- to -(NIX/ℝτ)-.22:06:01
26 Jun 2021
@grahamc:nixos.orggrahamc invited @mjolnir:nixos.orgmjolnir.01:26:17
@mjolnir:nixos.orgmjolnir joined the room.01:26:17
@grahamc:nixos.orggrahamcchanged room power levels.01:26:27
27 Jun 2021
@tomberek:matrix.orgtomberek joined the room.05:02:55
30 Jun 2021
@balsoft:balsoft.rubalsoft joined the room.10:54:08

Show newer messages


Back to Room ListRoom Version: 6