Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even more android fixes #42412

Merged
merged 7 commits into from Jun 25, 2018

Conversation

matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Jun 23, 2018

Motivation for this change

This is a collection of tweaks for handling android. dc261f6896106deab2efd6329479d536d3e9c255 is the commit that solves my original problem & definitely should be merged if possible as it isn't a mass rebuild.

On the other hand, 62024d280eb7ecd1f49d80406193a65901317bcb, may not be that useful but it seems like a safe thing to just disable stripping & patchelf in cross drvs. Interested in feedback on whether this is a good idea.

It doesn't seem like 25e54c53a25f673f2ada852ae143f17dd1280842 should be needed but it fixed a non-fatal warning I was getting & might give us trouble if we don't properly set up the rpath.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/bbg8p1v9qhjfr0ghlzi8bn3f23wlj4rx-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/znlnr5p1n53n07d2mci10d2byl43gl2p-libiconv-osx-10.11.6

@matthewbauer matthewbauer force-pushed the even-more-android-fixes branch 2 times, most recently from 4dd5a98 to 92e8d15 Compare June 23, 2018 04:31
@GrahamcOfBorg GrahamcOfBorg removed the 6.topic: stdenv Standard environment label Jun 23, 2018
@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/znlnr5p1n53n07d2mci10d2byl43gl2p-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

  /nix/store/5fpq3zhq8dmvvc10q62i797j88l655y1-linux-headers-4.15
  /nix/store/csqjc2aycrin72amhc1xn49wwmcijddc-glibc-2.27-dev
  /nix/store/d5djbvna6ffvviqnkpy29p0798zprchr-glibc-2.27
  /nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27
copying path '/nix/store/d5djbvna6ffvviqnkpy29p0798zprchr-glibc-2.27' from 'https://cache.nixos.org'...
copying path '/nix/store/5fpq3zhq8dmvvc10q62i797j88l655y1-linux-headers-4.15' from 'https://cache.nixos.org'...
copying path '/nix/store/3nmzj02hcf38zzg1s6cl63g7n3801l5x-glibc-2.27-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/csqjc2aycrin72amhc1xn49wwmcijddc-glibc-2.27-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27' from 'https://cache.nixos.org'...
/nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/bbg8p1v9qhjfr0ghlzi8bn3f23wlj4rx-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/znlnr5p1n53n07d2mci10d2byl43gl2p-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/bbg8p1v9qhjfr0ghlzi8bn3f23wlj4rx-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/bbg8p1v9qhjfr0ghlzi8bn3f23wlj4rx-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/znlnr5p1n53n07d2mci10d2byl43gl2p-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/bbg8p1v9qhjfr0ghlzi8bn3f23wlj4rx-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/jcs8jiz94na13d960b8hd8b05j58i80x-glibc-iconv-2.27

@@ -84,6 +84,7 @@ rec {
$out/bin/${targetPlatform.config}-g++ \
-e '130i extraBefore+=(-Wl,--fix-cortex-a8)' \
-e 's|^(extraBefore=)\(\)$|\1(${builtins.toString flags})|'
echo "-no-pie" >> $out/nix-support/cc-cflags
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @Ericson2314 Is this okay to do globally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sounds good. I'd maybe put it in the extraBefore thing above, but fine either way.

{ stdenv, appleDerivation, autoreconfHook, targetPlatform, enableStatic ? targetPlatform.isiOS }:
{ stdenv, appleDerivation, lib, autoreconfHook, targetPlatform
, enableStatic ? targetPlatform.isiOS
, enableShared ? !targetPlatform.isiOS }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can the }: be on its own line?

sed -i 's/darwin\*/ios\*/g' configure libcharset/configure
'';

configureFlags = stdenv.lib.optionals enableStatic [ "--enable-static" "--disable-shared" ];
configureFlags = lib.optional enableStatic "--enable-static"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And same for normal libiconv)

@matthewbauer
Copy link
Member Author

Waiting on: https://hydra.reflex-frp.org/build/685

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libiconv

Partial log (click to expand)

/nix/store/y0b2y33wzmlijsq81x831k3cy00v2vx4-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@@ -83,5 +83,6 @@ import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
inherit config overlays crossSystem;
# Fallback: Assume we are building packages on the current (build, in GNU
# Autotools parlance) system.
localSystem = { system = builtins.currentSystem; } // localSystem;
localSystem = (if args ? localSystem then {}
else { system = builtins.currentSystem; }) // localSystem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice catch.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


/nix/store/yhv02gycgbl4zrvpa8kjgxl7b1wh8c2x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/bdvs7h7zirrfjrk7nn2cm2w8cnivyvdh-ghc-8.2.2
/nix/store/y0b2y33wzmlijsq81x831k3cy00v2vx4-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


/nix/store/yhv02gycgbl4zrvpa8kjgxl7b1wh8c2x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


/nix/store/yhv02gycgbl4zrvpa8kjgxl7b1wh8c2x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


/nix/store/yhv02gycgbl4zrvpa8kjgxl7b1wh8c2x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/bdvs7h7zirrfjrk7nn2cm2w8cnivyvdh-ghc-8.2.2
/nix/store/y0b2y33wzmlijsq81x831k3cy00v2vx4-libiconv-osx-10.11.6

When false, shared libraries will be disabled.

also adds patch to *really* disable shared libiconv.
the gcc in android does not have this on by default. Doing this will
fix some of the errors in cross-trunk:

https://hydra.nixos.org/build/76354538/nixlog/11

This is related to how separate debug info is handled in Nixpkgs.
Setting this to true will disable removing some of the unused parts of
the NDK toolchain that is unused in Nixpkgs but may be used by others.

/cc @bkchr
We run into issues otherwise
This is needed for targeting older apis.
If we passed a localSystem in, we don’t want the current system to
override it. Now we check for localSystem first to avoid getting
"mixed" localSystem values from commands like this:

  nix-build --arg localSystem '{config="x86_64-unknown-linux-musl";}' -A hello

Which would eventually evaluate localSystem to this:

{
  config = "x86_64-unknown-linux-musl";
  system = "x86_64-darwin";
}

& Nix would not be able to run it correctly.

Fixes NixOS#41599

/cc @Ericson2314
This breaks some library symbols apparently. ARM symbols must be
incorrectly stripped. Also some very weird issues with patchelf.
@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/bdvs7h7zirrfjrk7nn2cm2w8cnivyvdh-ghc-8.2.2
/nix/store/y0b2y33wzmlijsq81x831k3cy00v2vx4-libiconv-osx-10.11.6

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libiconv

The following builds were skipped because they don't evaluate on aarch64-linux: ghc

Partial log (click to expand)

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


/nix/store/yhv02gycgbl4zrvpa8kjgxl7b1wh8c2x-glibc-iconv-2.27

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghc, libiconv

Partial log (click to expand)

/nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2
/nix/store/nbiacn62k38saz9mb108b13gp9zcmrzc-glibc-iconv-2.27

@matthewbauer matthewbauer merged commit 09c66f4 into NixOS:master Jun 25, 2018
@layus
Copy link
Member

layus commented Jun 26, 2018

Thanks! he "impure.nix: fix handling of localSystem" explains why it was such a pain for me to pass that argument.

@Ericson2314 Ericson2314 deleted the even-more-android-fixes branch June 26, 2018 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants