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

unable to build due to ghc missing support for armv7 #1

Closed
Fuseteam opened this issue Nov 17, 2020 · 6 comments
Closed

unable to build due to ghc missing support for armv7 #1

Fuseteam opened this issue Nov 17, 2020 · 6 comments

Comments

@Fuseteam
Copy link

i was attempting to get things to build for armhf but no matter what ghc complains about not supporting armhf

@thefloweringash
Copy link
Owner

Hello,

I think you might be looking in the wrong place. This repository doesn't really do anything interesting. If this is a problem with nixpkgs, you'd be better to open an issue there. I note that GHC has binary releases for armv7, so it should be possible to make this work. Sorry it's not clear from your message what environment you're working with, if it's not nixpkgs you should probably file an issue on your particular distribution's issue tracker.

Going to close this, since there's not much I can do here.

@Fuseteam
Copy link
Author

Fuseteam commented Nov 19, 2020

@thefloweringash i am attempting to build nixpkgs on armv7, which nixpkgs doesn't officially support. i first attempted to use your cachix, but noticed things weren't building correctly on your hydra instance and i believe it has to do with ghc complaining about armv7 for some reason. This repo is the closest i could find to both of those. my enviroment is just an bq e5 phone on which i want to install nixpkgs

btw i'm not trying to attack you i'm just trying to explain as much as i can what my goal/problem is

@thefloweringash
Copy link
Owner

@thefloweringash i am attempting to build nixpkgs on armv7, which nixpkgs doesn't officially support. i first attempted to use your cachix, but noticed things weren't building correctly on your hydra instance and i believe it has to do with ghc complaining about armv7 for some reason. This repo is the closest i could find to both of those. my enviroment is just an bq e5 phone on which i want to install nixpkgs

Even though nixpkgs doesn't officially support armv7l-linux, or have a cache for it, the project will accept fixes. The #nixos-aarch64 channel on freenode also contains people interested in armv7l-linux.

Support for ghc on armv7l-linux was added recently via NixOS/nixpkgs#98656. If you're having problems, opening an issue and mentioning the author (@sorki) is probably the best thing to do. I took a quick look, and it seems like the problem is that the bootstrap packages for the current default ghc version don't support 32-bit arm, which might be fixed by (untested):

diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index e613b931d63..2d25ea149a9 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -96,7 +96,7 @@ in {
     };
     ghc8102 = callPackage ../development/compilers/ghc/8.10.2.nix {
       # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
-      bootPkgs = if stdenv.isAarch64 then
+      bootPkgs = if stdenv.isAarch64 || stdenv.isAarch32 then
           packages.ghc8102BinaryMinimal
         else
           packages.ghc865Binary;

As for my hydra, I think it's currently suffering from issues that would be fixed by NixOS/hydra#832 and NixOS/nixpkgs#103925. I'll add a review for the latter shortly.

btw i'm not trying to attack you i'm just trying to explain as much as i can what my goal/problem is

All good. I was worried about seeming rude. Tone is hard on the internet :-)

@sorki
Copy link

sorki commented Nov 21, 2020

You can either use ghc8102Binary on armv7l directly (via haskell.packages.ghc8102Binary.<...>) or you can use it as bootstrap compiler for other GHC versions. For example I've used it boot native ghc8102 like so:

     ghc8102 = callPackage ../development/compilers/ghc/8.10.2.nix {
-      bootPkgs = packages.ghc865Binary;
+      bootPkgs = packages.ghc8102Binary;

It's also used to bootstrap ghc884 on 64 bit arm currently. Suggestion by @thefloweringash looks good and can be probably proposed as a PR to nixpkgs.

@Fuseteam
Copy link
Author

All good. I was worried about seeming rude. Tone is hard on the internet :-)

haha true thanks for explaination and pointers i check to see what i can do

You can either use ghc8102Binary on armv7l directly (via haskell.packages.ghc8102Binary.<...>) or you can use it as bootstrap compiler for other GHC versions. For example I've used it boot native ghc8102 like so:

     ghc8102 = callPackage ../development/compilers/ghc/8.10.2.nix {
-      bootPkgs = packages.ghc865Binary;
+      bootPkgs = packages.ghc8102Binary;

It's also used to bootstrap ghc884 on 64 bit arm currently. Suggestion by @thefloweringash looks good and can be probably proposed as a PR to nixpkgs.

cool thank you i'll check it out, any reccomendations on how i can test it?

@Fuseteam
Copy link
Author

@thefloweringash weirdly enough all package are failing after the pr that fixed it at first was merged

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

No branches or pull requests

3 participants