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

Add armv6l-linux & armv7l-linux as cross jobs #2667

Merged
merged 11 commits into from Jun 29, 2021

Conversation

matthewbauer
Copy link
Member

This is a cheap way to get 32-bit ARM working. We don’t support it
officially but lots of people have raspberry pis and similar hardware
they want to install the Nix package manager on.

This is a cheap way to get 32-bit ARM working. We don’t support it
officially but lots of people have raspberry pis and similar hardware
they want to install the Nix package manager on.
@tomberek
Copy link
Contributor

tomberek commented Feb 7, 2019

Ran into the cross perl problem. I've seen this mentioned before, but I'm not clear on the best fix.

building '/nix/store/nvc5caf60hdr50x3lw9h9dp25hpcyygh-perl-5.28.1-armv7l-unknown-linux-gnueabihf.drv'...
unpacking sources
unpacking source archive /nix/store/bn77kf4krrcmaigccmjgnvs1xpr6kg85-perl-5.28.1.tar.gz
source root is perl-5.28.1
unpacking source archive /nix/store/y514lchqn984n3j7rwc6vqz64q4g25nc-perl-cross-1.2.tar.gz
setting SOURCE_DATE_EPOCH to timestamp 1543440344 of file perl-5.28.1/pod/perlhist.pod
patching sources
applying patch /nix/store/nda6vcdvbfcs24rf6mbh4icp6bl0qlnm-no-sys-dirs-5.26.patch
patching file Configure
Hunk #1 succeeded at 108 (offset 2 lines).
Hunk #2 succeeded at 1419 with fuzz 1 (offset 90 lines).
Hunk #3 succeeded at 1433 with fuzz 1 (offset 93 lines).
Hunk #4 succeeded at 1473 with fuzz 1 (offset 96 lines).
Hunk #5 succeeded at 2529 (offset 99 lines).
Hunk #6 succeeded at 5017 (offset 98 lines).
Hunk #7 succeeded at 8841 (offset 258 lines).
Hunk #8 succeeded at 20726 (offset 848 lines).
patching file ext/Errno/Errno_pm.PL
Hunk #1 succeeded at 123 (offset -3 lines).
patching file hints/freebsd.sh
Hunk #1 succeeded at 127 (offset 8 lines).
patching file hints/linux.sh
Hunk #2 succeeded at 176 with fuzz 1 (offset 17 lines).
Hunk #3 succeeded at 253 (offset -69 lines).
applying patch /nix/store/5f2i9rhs0pi5g8m762x4j55llm3z60xg-0001-Fix-missing-build-dependency-for-pods.patch
patching file write_buildcustomize.pl
applying patch /nix/store/rfzcb6kjkpz91fj8qnigp6c0clyc0da0-MakeMaker-cross.patch
patching file cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
Hunk #1 succeeded at 1337 (offset 70 lines).
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./cnf/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./cnf/config.guess
configuring
configure flags: --prefix=/nix/store/i6a65azbjfglvr15vf8lzfay2wr5fvf6-perl-5.28.1-armv7l-unknown-linux-gnueabihf -Dlibpth=\"\" -Dglibpth=\"\" -Uinstallusrbinperl -Dinstallstyle=lib/perl5 -Duseshrplib -Dlocincpth=/nix/store/1agp7f145bb430rjpfixzddz6axdiakg-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev/include -Dloclibpth=/nix/store/jdqssyw02jpvyvhgjks4xlv510zz5hrn-glibc-2.27-armv7l-unknown-linux-gnueabihf/lib -Dusethreads --build=x86_64-unknown-linux-gnu --host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf -Dldflags=-lm\ -lrt
Guessing build platform ... x86_64-unknown-linux-gnu
Guessing target architecture ... armv7l-unknown-linux-gnueabihf
Respawning configure for build and target platforms

Configuring build-time miniperl for x86_64-unknown-linux-gnu (x86_64-unknown-linux-gnu)
Checking perl version ... perl5-5.28.1
No patchset found for perl5-5.28.1 in cnf/diffs
This perl version is probably not supported by perl-cross
ERROR: configure --mode=buildmini failed
builder for '/nix/store/nvc5caf60hdr50x3lw9h9dp25hpcyygh-perl-5.28.1-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 255
cannot build derivation '/nix/store/j64swzn75dbjxg1jzjhfxp2l8q90xwpr-git-2.18.1-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
building '/nix/store/hdahvkwdwg84gkn3map84a8iv2nn04y8-pkg-config-0.29.2-armv7l-unknown-linux-gnueabihf.drv'...
cannot build derivation '/nix/store/pqmn55r3nrkb7dbgnc8p3hn2k9jjvfhr-nix-2.3pre6622_1583351-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
error: build of '/nix/store/pqmn55r3nrkb7dbgnc8p3hn2k9jjvfhr-nix-2.3pre6622_1583351-armv7l-unknown-linux-gnueabihf.drv' failed

Unfortunately, releaseTools.nixBuild does not separate native and
non-native build inputs. As an alternative, we can just use
buildPackages to get the native version of some packages like:

- pkgconfig
- git
- curl
- utillinux
@matthewbauer
Copy link
Member Author

Hopefully fixed with 1996af4

@tomberek
Copy link
Contributor

tomberek commented Feb 7, 2019

Gets farther, up to compiling nix itself, but pkg-config still has issues. Tried a few combinations of including pkg-config and various envvars without success.

checking for lsof... lsof
checking for cat... /nix/store/68z2cvbzws1pn0z8dhgfkmws75r2z7gm-coreutils-8.29/bin/cat
checking for tr... /nix/store/68z2cvbzws1pn0z8dhgfkmws75r2z7gm-coreutils-8.29/bin/tr
checking for armv7l-unknown-linux-gnueabihf-pkg-config... no
checking for pkg-config... no
checking for libcrypto... no
configure: error: in `/build/nix-2.3pre0_0000000':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
build time elapsed:  0m0.209s 0m0.222s 0m3.299s 0m1.101s
builder for '/nix/store/nfrs0arvf8vrr2z326bajm8jczbsqqwc-nix-2.3pre0_0000000-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 1
error: build of '/nix/store/nfrs0arvf8vrr2z326bajm8jczbsqqwc-nix-2.3pre0_0000000-armv7l-unknown-linux-gnueabihf.drv' failed

@matthewbauer
Copy link
Member Author

matthewbauer commented Feb 7, 2019

It should work now as soon as NixOS/nixpkgs@987d4b9 hits release-18.09.

@tomberek
Copy link
Contributor

tomberek commented Feb 7, 2019

Compiles. And runs on ARM! Great work!

@bbarker
Copy link

bbarker commented May 25, 2020

Anything blocking this (other than handling merge conflicts)?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-install-nix-package-manager-on-raspbian/2035/12

@Ericson2314
Copy link
Member

Let's merge #3765 (also @matthewbauer's work, ignore my name at the top of the PR) and then fixing the conflicts here should be quite easy.

@adisbladis
Copy link
Member

@matthewbauer What would it take to move this to the current flake based builds?

@matthewbauer
Copy link
Member Author

Yeah - it's just moving some stuff around. Updated to resolve conflicts.

@adisbladis
Copy link
Member

@edolstra I think this is a very worthwhile change, could you take a look?

@DavHau
Copy link
Member

DavHau commented Mar 23, 2021

This doesn't seem to build the binaryTarball for armv6/7, does it?
Maybe tarball targets should be added as well. Or how would you install nix without the tarball?
It would be nice, if after this PR, I could shut down nix-on-armv7l

@Fuseteam
Copy link

i would be very interested in this to get it working on armhf ubuntu touch devices, is there anything i can do to help?

@stefandeml
Copy link

same here, anything missing and how can I support?

@domenkozar
Copy link
Member

I'm happy to merge this if someone updates the PR.

@Fuseteam
Copy link

I'm happy to merge this if someone updates the PR.

only @matthewbauer can do that i think
since i pinged the author might as well just ask, if possible, could we have tarball targets as well?

@c-goes
Copy link

c-goes commented Jun 25, 2021

Tarball targets would be great to have

@matthewbauer
Copy link
Member Author

Updated with binaryTarball

@Fuseteam
Copy link

Fuseteam commented Jun 28, 2021

@domenkozar when you have time, can you have looksie?😁

flake.nix Show resolved Hide resolved
@domenkozar
Copy link
Member

Note that github actions run checks.${system} so we'll need to wire that up to really get it to build cross jobs

@domenkozar
Copy link
Member

macOS CI is hitting #2667

@domenkozar
Copy link
Member

As our cross-compiling story is quite good these days, and we have a few Nix contributors that know it inside-out, it's reasonable to support ARMv6/7 and see if we are able to maintain it.

Looking at the diff there's little to be maintained inside Nix repo anyway.

@domenkozar domenkozar merged commit 8153502 into NixOS:master Jun 29, 2021
@stefandeml
Copy link

stefandeml commented Jul 5, 2021

Sweet, what is the easiest way to track those cross-compile jobs on Hydra and where would I fetch the binary tarball from?

@domenkozar
Copy link
Member

https://hydra.nixos.org/job/nix/master/binaryTarballCross.x86_64-linux.armv6l-linux & https://hydra.nixos.org/job/nix/master/binaryTarballCross.x86_64-linux.armv7l-linux

Click on a job and there's a download link for the tarball.

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

Successfully merging this pull request may close these issues.

None yet