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

Fix idris gcc builds on darwin and disable broken package #46410

Closed
wants to merge 2 commits into from

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Sep 9, 2018

Motivation for this change

#45960

The lens package is really weird: It succeeds on linux without problems, but fails on darwin with an error that indicates a missing standard library constructor. I therefore marked it as broken on darwin.

The other change this PR has is to use gccStdenv to build all idris packages instead of the normal stdenv. This is because of such errors, both the clang warnings and the gcc missing error. Since gcc seems to be the standard to use in a Makefile for idris packages, it makes sense to use gccStdenv here I think.

This fixes the build for curses, eternal and mhd on darwin

Ping @mpickering @brainrape

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Idris packages often use gcc in their makefiles, the standard clang on
darwin seems to throw a lot of unused argument warnings, so we'll just
use the gccStdenv by default
@GrahamcOfBorg GrahamcOfBorg added the 6.topic: darwin Running or building packages on Darwin label Sep 9, 2018
@infinisil
Copy link
Member Author

@GrahamcOfBorg build idrisPackages.curses idrisPackages.eternal idrisPackages.mhd idrisPackages.recursion_schemes idrisPackages.html idrisPackages.config

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idrisPackages.curses, idrisPackages.eternal, idrisPackages.mhd, idrisPackages.recursion_schemes, idrisPackages.html, idrisPackages.config

Partial log (click to expand)

copying path '/nix/store/95aghk5w9va395yh1aisywcnij2hcrch-idris-webgl-2017-05-08' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/4ppzghcyrm0wd7adcgby1nhq23px6z84-idris-containers-2017-09-10' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/ci3fsikji6g12lwbm8x17wcy5ixzb2m6-idris-html-2017-04-23' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/lvrq3fimh8ycvj7qif8c6mlg9ib5xaxv-idris-config-2017-11-06' from 'https://nix-cache.s3.amazonaws.com'...
/nix/store/l0ifi3y805qjhlz9xna8i429lkgizchc-idris-curses-2017-10-12
/nix/store/kc0f96lf6bjfbf443vznpikxkmrgnfvf-idris-eternal-2018-07-02
/nix/store/vk1x1nm6iv5ql7j6gs32abcm6m9lhsk0-idris-mhd-2016-04-22
/nix/store/hxl3ql7jfd2iaja3hv3s3a4li8izs0i6-idris-recursion_schemes-2018-01-19
/nix/store/ci3fsikji6g12lwbm8x17wcy5ixzb2m6-idris-html-2017-04-23
/nix/store/lvrq3fimh8ycvj7qif8c6mlg9ib5xaxv-idris-config-2017-11-06

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: idrisPackages.curses, idrisPackages.eternal, idrisPackages.mhd, idrisPackages.recursion_schemes, idrisPackages.html, idrisPackages.config

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.


@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: idrisPackages.curses, idrisPackages.eternal, idrisPackages.mhd, idrisPackages.recursion_schemes, idrisPackages.html, idrisPackages.config

Partial log (click to expand)

Attempting to install IdrisDocs for MHD in: /nix/store/awlf0n615mgzkv0m0s7ffl24wziwi1rj-idris-mhd-2016-04-22/doc/mhd
Warning: Ignoring empty or non-existing namespace 'MHD.Connection'
Warning: Ignoring empty or non-existing namespace 'MHD.Auth'
Warning: Ignoring empty or non-existing namespace 'HTTP.Status_codes'
Warning: Ignoring empty or non-existing namespace 'HTTP.Headers'
post-installation fixup
moving /nix/store/awlf0n615mgzkv0m0s7ffl24wziwi1rj-idris-mhd-2016-04-22/doc to /nix/store/awlf0n615mgzkv0m0s7ffl24wziwi1rj-idris-mhd-2016-04-22/share/doc
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/awlf0n615mgzkv0m0s7ffl24wziwi1rj-idris-mhd-2016-04-22
error: build of '/nix/store/q8zdvhxdnidhfiffz9jypcy03cxgrih0-idris-config-2017-11-06.drv' failed

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: idrisPackages.lens

Partial log (click to expand)


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

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


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

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

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.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idrisPackages.lens

Partial log (click to expand)

these paths will be fetched (2.55 MiB download, 6.71 MiB unpacked):
  /nix/store/6l52w1xcc977qn3gp5mjnavz285m2n0y-idris-prelude-1.3.0
  /nix/store/p2c09fga1asn2k9rp7g1b5bhiw45c36y-idris-base-1.3.0
  /nix/store/w6xvy9akkbvqvylydq7nnf33gm7wjcrl-idris-lens-2017-09-25
  /nix/store/x89hmvzf559a184i1sihg1hvlwj6gwjy-idris-bifunctors-2017-02-07
copying path '/nix/store/6l52w1xcc977qn3gp5mjnavz285m2n0y-idris-prelude-1.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/p2c09fga1asn2k9rp7g1b5bhiw45c36y-idris-base-1.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/x89hmvzf559a184i1sihg1hvlwj6gwjy-idris-bifunctors-2017-02-07' from 'https://cache.nixos.org'...
copying path '/nix/store/w6xvy9akkbvqvylydq7nnf33gm7wjcrl-idris-lens-2017-09-25' from 'https://cache.nixos.org'...
/nix/store/w6xvy9akkbvqvylydq7nnf33gm7wjcrl-idris-lens-2017-09-25

@infinisil
Copy link
Member Author

infinisil commented Sep 9, 2018

The above failure with idrisPackages.config seems to disappear from time to time, see also the hydra job. I'll investigate this later. I just built it for this PR to show that a couple other idris packages still work.

Edit: Seems that this change did indeed break the build of config. I'll build all idris packages on my local mac to see if this change did any other harm.

@infinisil infinisil mentioned this pull request Sep 20, 2018
2 tasks
@infinisil
Copy link
Member Author

Explicitly setting gcc should be preferred over gccStdenv, brings more problems than it's worth, apparently.

@mpickering
Copy link
Contributor

If all these packages don't build with clang then they are probably all broken anyway in a normal darwin environment?

@LnL7
Copy link
Member

LnL7 commented Sep 20, 2018

Usually they build fine with clang, but unlike with Xcode our clang doesn't have gcc/g++ shims. This means builds have to honor the CC/CXX environment variables in order to find the correct compiler instead of hardcoding binary names.

NOTE in some packages do depend on gcc specific features, for those cases gccStdenv can be used.

@infinisil
Copy link
Member Author

Needs a different fix, will open a new PR if I can come up with a nicer one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants