[Nix-dev] Generating nixos-compatible binaries? And bootstrapped packages.

Vladimír Čunát vcunat at gmail.com
Thu Aug 25 22:48:18 CEST 2016


On 08/25/2016 10:38 PM, Nick Sabalausky wrote:
> On 08/25/2016 03:33 PM, Bjørn Forsman wrote:
>> On 25 August 2016 at 21:08, Nick Sabalausky
>>> Any downsides to setting the RPATH that way? By just setting it to
>>> /run/current-system/sw/lib?
>>
>> Both are hacks :-) The first method breaks when you garbage collect
>> the system and the paths embedded into the binary are removed. The
>> second method (may) break when you update the system so that the links
>> in /run/current-system/sw/lib/... point to different and incompatible
>> libraries.
>>
> 
> Ok, I see.
> 
> Now, I assume using patchelf probably isn't recommended or suitable for
> packages in nixpkgs (unless maybe it's something closed-source?).
> 
> But what if a nix expression uses it as an intermediary build step on a
> tool downloaded as used AS part of the build process, but then simply
> discarded? Such as bootstrapping a compiler by downloading an older
> pre-built binary provided on the compiler's official release page,
> patchelf it, and use that to bootstrap the compiler being built.
> 
> Would that be non-hacky enough to be acceptable for a nixpkgs pull request?

The recommended way is to create nix expression(s) that fetch the
binaries and patchelf them. (And perhaps fixup some other problems, like
terrible default file locations.) Basically all binary packages we have
in nixpkgs work along those lines.

--Vladimir


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3771 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160825/c1642869/attachment-0001.p7s>


More information about the nix-dev mailing list