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

ghc8102: bootstrap with ghc8102BinaryMinimal on aarch32 #104683

Merged
merged 1 commit into from Nov 28, 2020

Conversation

Fuseteam
Copy link
Contributor

@Fuseteam Fuseteam commented Nov 23, 2020

ghc refuses to evaluate on armhf even tho ghc does provide binaries for the arch
hi @sorki as discussed i have now proposed the change

Motivation for this change

compilation on armv7 fails because ghc fails to evaluate

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@maralorn
Copy link
Member

maralorn commented Nov 23, 2020

I don‘t feel really to qualified to judge this PR, but maybe you could be slightly more verbose in your commit message? e.g. which ghc version does not evaluate? (I know that it is derivable from the context, but I think it would make it easier to see what's going on at a glimpse.

Also "evaluate" in nix context normally means, that the nix code does not produce a valid nix-derivation. Is that what you mean? If yes could maybe give a link to what fails? Or is the problem building the derivation?

@Fuseteam
Copy link
Contributor Author

hi @maralorn the issue is that i cannot build any packages on armv7 i always run into this error:

error: Package ‘ghc-8.8.4’ in /nix/store/6qa9pjalsk76va40b5amagwii3gcxyqj-source/pkgs/development/compilers/ghc/8.8.4.nix:251 is not supported
on ‘armv7l-linux’, refusing to evaluate.

a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
   for a single invocation of the nix tools.

     $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

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

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

(use '--show-trace' to show detailed location information)

it should be noted that ghc does provide armv binaries
....huh weird why is it pulling ghc 8.8.4

@maralorn
Copy link
Member

I have no idea.

otoh hand after some consideration activating a fix that is used for arm 64bit also for arm32bit seems very sane to me.

Have you actually tested that this solves your problem? (Just a bit suspicious because your branch name looks like this change happened in github ui.)

I have no way to test this and ofBorg does not seem to be a lot of help …

@Fuseteam
Copy link
Contributor Author

@maralorn your suspicion is right i have a low end device so i haven't been able to test it yet, do you have any tips on how i should test it? i do have a setup using github actions that does reproduce the error without the 'fix'

@maralorn
Copy link
Member

No, not really, sorry. I guess we'll need someone with a system like that, to jump in. I’ll try to ask around.

@sorki
Copy link
Member

sorki commented Nov 24, 2020

I was able to do this on my arvm7l system but using packages.ghc8102Binary not Minimal variant which should work I guess.

Like you can just use packages.ghc8102Binary as your haskellPackages but it's nice to be able to bootstrap on armv7l as well and not having to carry overrides around.

I can re-test later to make sure it's still the case and that it works with Minimal as well.

This needs a more descriptive commit message tho, something like ghc8102: bootstrap with ghc8102BinaryMinimal on aarch32

@Fuseteam
Copy link
Contributor Author

@maralorn no problem
@sorki thanks, i'll look forward to your findings then;
i don't think i can edit the commit message can i?

@maralorn
Copy link
Member

@Fuseteam You can run "git commit --amend" on the branch and then force push.

@Fuseteam
Copy link
Contributor Author

alright will do

@Fuseteam Fuseteam changed the title fix compilation on armhf ghc8102: bootstrap with ghc8102BinaryMinimal on aarch32 Nov 24, 2020
@Fuseteam
Copy link
Contributor Author

welp i figured i would do it with a git clone but dang is it big 😂 only 25% and 300MB and counting 😂

ghc refuses to evaluate on armhf even tho ghc does provide binaries for the arch
@Fuseteam
Copy link
Contributor Author

I'll be honest, looking at the error again I'm growing skeptical if this will actually solve it........., for some reason the error message seems to refer to ghc 8.8.4, but if i'm reading this right i modified ghc-8.10.2

@sorki
Copy link
Member

sorki commented Nov 24, 2020

It depends on nixpkgs commit which you are using. A week ago pkgs.haskellPackages were pointing to pkgs.haskell.packages.ghc884, now it's

pkgs/top-level/all-packages.nix:  haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8102;

@Fuseteam
Copy link
Contributor Author

oh yeah lemme try the latest commit

@Fuseteam
Copy link
Contributor Author

ah cool it changed the rev to newer version and indeed pulls the 8.10.2 thanks for the reassurance

@Fuseteam
Copy link
Contributor Author

i have now verified with github actions that it no longer runs into the same issue with this change. the job obviously fails due to not actually being set up for cross compilation but that's outside the scope of this issue i think

@maralorn
Copy link
Member

@sorki You said you also wanted to test run this. Can you can confirm, that it works for you, too?

@sorki
Copy link
Member

sorki commented Nov 28, 2020

I've used similar approach like a month ago so it should be good. I'm unable to test this right now as I can't really update my system due to unrelated coreutils build failure.

Copy link
Member

@sorki sorki left a comment

Choose a reason for hiding this comment

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

LGTM

@maralorn maralorn merged commit efe54d6 into NixOS:master Nov 28, 2020
@maralorn
Copy link
Member

thx

@Fuseteam Fuseteam deleted the patch-1 branch November 28, 2020 16:46
@Fuseteam
Copy link
Contributor Author

awesome

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