Skip to content

Don't conflate dependencies in setup.sh #4855

@edolstra

Description

@edolstra

We currently have the confusing situation that the buildInputs attribute gets passed to the builder via the nativeBuildInputs environment variable:

$ nix-shell '<nixpkgs>' -A pan
[nix-shell:~]$ echo $buildInputs 

[nix-shell:~]$ echo $nativeBuildInputs 
/nix/store/aprw7bdaydpxcv6j3wlr9bnr2s061gq6-pkg-config-0.23 /nix/store/75kv0ac0zn6sxypqh4anwwfdmm3bcw35-gtk+-2.24.24 ...

(Pan declares a buildInputs attribute.)

Also, "native" is somewhat ambiguous: native to the build machine, or native to the target machine? However the GNU terminology (build and host) is not really better.

Maybe it would be better to always use buildInputs for the native (build machine) dependencies, and something like targetBuildInputs for the cross-built dependencies. Or not use buildInputs in setup.sh at all and use nativeBuildInputs and targetBuildInputs to prevent confusion.

Ping @viric

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.6.topic: cross-compilationBuilding packages on a different platform than they will be used on9.needs: documentationThis needs to be documented well.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions