[Nix-dev] buildInputs vs buildNativeInputs

Shea Levy shea at shealevy.com
Mon Aug 27 13:47:13 CEST 2012


On 08/27/2012 07:40 AM, Mathijs Kwik wrote:
> On Mon, Aug 27, 2012 at 1:18 PM, Shea Levy<shea at shealevy.com>  wrote:
>> On 08/27/2012 07:12 AM, Mathijs Kwik wrote:
>>> Hi all,
>>>
>>> I understand the difference between buildInputs and buildNativeInputs,
>>> but I'm not quite sure how to figure out when an input should be
>>> native.
>>
>> The question is, when is the machine code provided by the input executed? If
>> it's at build time (e.g. you execute 'perl' to run a build script), it's a
>> buildNativeInput. If it's at run time (e.g. a linked-to library), it's a
>> buildInput. The reason for this is cross-compilation: buildNativeInputs are
>> host versions of the package, buildInputs are target versions of the
>> package.
> I understand that part.
> I recognize a few easy targets like documentation-builders that I know
> run at build-time, but for other inputs it's not always clear.
> As I'm not an expert on the build-process of most packages, I was
> hoping there is some easy trick to find out when the input is needed.
>
> For example, can I just try to move stuff from buildInputs to
> buildNativeInputs one by one? Or some other procedure to try?

I suppose the most sure-fire way is to cross-compile to a target your 
CPU doesn't support, then check the result on the target. During 
non-cross-builds there's no meaningful difference between the two AFAIK.

~Shea


More information about the nix-dev mailing list