Commit graph

10 commits

Author SHA1 Message Date
Sergei Trofimovich 2da0307220 buildFHSEnv: fix NIX_LDFLAGS propagation to ld wrapper
Before the change the following command did not work:

    $ nix develop -i --impure --expr 'with import <nixpkgs> { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env'
    $ ld -lmpc -o a
    ld: cannot find -lmpc: No such file or directory

It is expected to work as `NIX_LDFLAGS` does contain valid values:

    $ echo $NIX_LDFLAGS
    -L/usr/lib -L/usr/lib32

Note that for `gcc` it does work:

    $ printf "int main(){}" |  gcc -x c - -lmpc -o a

It happens because `HOST` role is enabled for `cc`:

    $ echo $NIX_CC_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu
    1

But not for `BINTOOLS`:

    $ echo $NIX_BINTOOLS_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu
    <empty>

The change adds BINTOOLS role and fixes linking:

    $ nix develop -i --impure --expr 'with import ~/nm { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env'
    $ printf "int main(){}" |  gcc -x c - -lmpc -o a
    $ ld -lmpc -o a
    ld: warning: cannot find entry symbol _start; not setting start address
2023-08-21 07:50:37 +01:00
Atemu 67ac4b83ec buildFHSEnv: disable multiArch by default
Most FHSEnv-wrapped packages in Nixpkgs wrap a x86_64-linux binary; making
multiArch unnecessary bloat closure size. Saves about 1G in anki-bin.

This makes multiArch FHSEnvs the exception rather than the rule.
2023-07-07 21:33:04 +02:00
Atemu 62b2adc753 buildFHSEnv: add multiArch flag
The intention is to allow the user control over whether 32bit deps are supposed
to be included in the fhsenv
2023-07-01 13:41:14 +02:00
Atemu 167264179b buildFHSEnv: cleanup 2023-07-01 13:41:09 +02:00
Atemu d5f0da152a Revert "Merge pull request #230693 from Atemu/fix/fhsenv-escape-runScript-path"
This reverts commit 840f2e0ac5, reversing
changes made to d3ed0402e5.

This breaks appimage which puts args into the runScript and we don't provide a
good way to pass thru additional args.

The actual bug was in nix-alien which should escape paths; providing a valid
runScript is the responsibility of the caller.
2023-05-22 11:34:04 -03:00
Atemu 840f2e0ac5
Merge pull request #230693 from Atemu/fix/fhsenv-escape-runScript-path
buildFHSEnvBubblewrap: escape runScript path
2023-05-18 18:02:04 +02:00
Atemu cd96817b29 buildFHSEnvBubblewrap: escape runScript path
Fixes https://github.com/NixOS/nixpkgs/issues/230651

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
2023-05-11 08:28:05 +02:00
lelgenio 8aafc553ae buildFHSEnv: use default values as fallback for XDG_DATA_DIRS 2023-05-08 18:56:51 -03:00
Weijia Wang 3c6e26b2ee buildFHSEnv: restrict pkgsi686Linux to x86_64-linux 2023-04-22 15:31:27 +03:00
Atemu f63a12f296 tree-wide: buildFHSUserEnv -> buildFHSEnv 2023-04-16 10:15:13 +02:00