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

Question: Is it possible to have nix-user-chroot target aarch64-linux ? #80

Open
573 opened this issue May 18, 2021 · 5 comments
Open

Comments

@573
Copy link

573 commented May 18, 2021

Had the probably stupid idea to change the expr to:

expr="with import <nixpkgs> { system=\"aarch64-linux\"; }; with import $nix_file {}; $bootstrap { target = $target; extraTargets = [ $extraTargets ]; run = \"$exec\"; }"

temporarily such that I can bundle apps for this architecture as well.

How oversimplified would that be ?

In other words is that something to achieve with nix-bundle anyway ?

@573
Copy link
Author

573 commented May 19, 2021

It seems as if it is possible to just build a bundle for aarch64-linux like this:

#!/usr/bin/env bash
set -euo pipefail
export NIX_PATH=channel:nixos-20.09

out=$(nix-build --no-out-link --expr 'let pkgsArm = import <nixpkgs> { config = {}; overlays = []; system = "aarch64-linux"; }; pkgsCross = import <nixpkgs> { overlays = [(self: super: { inherit (pkgsArm.haskellPackages) hledger; })]; crossSystem = { config = "aarch64-unknown-linux-musl"; }; }; in pkgsCross.hledger')
./nix-bundle.sh "$out" /bin/hledger

Thanks for awesome piece of software engineering !

@573
Copy link
Author

573 commented May 19, 2021

Using nix-shell -p hexdump it seems to work:

~/bin/neuron
/tmp/tmpx-19ad44dfd2480e2e/dat/../run: line 1: ./nix/store/pxpaszz9l0j538i50cx4hm5f5dk0vyvw-startup: No such file or directory

@573
Copy link
Author

573 commented May 19, 2021

Analog with hledger:

$ ~/bin/hledger
./nix/store/5q9fnnfsg32j23wkg9wzriv5jk9ywrp4-startup: line 2:  1253 Illegal instruction     ./nix/store/djb6njqj31dy84jcfhli07sina2gxx37-nix-user-chroot-2c52b5f/bin/nix-user-chroot -n ./nix -- /nix/store/j97652klcc6x96i78kw78r9ddqcbfqgk-vzqd3zpnpnzdi3yrh59yqa7l6ppd2bfi-hledger-1.19.1/bin/hledger "$@"

But

file -p /nix/store/j97652klcc6x96i78kw78r9ddqcbfqgk-vzqd3zpnpnzdi3yrh59yqa7l6ppd2bfi-hledger-1.19.1/bin/hledger

/nix/store/j97652klcc6x96i78kw78r9ddqcbfqgk-vzqd3zpnpnzdi3yrh59yqa7l6ppd2bfi-hledger-1.19.1/bin/hledger: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /nix/store/qga01pfppqf0j83awrz3v7g3h69cirhk-glibc-2.31-74/lib/ld-linux-aarch64.so.1, for GNU/Linux 2.6.32, stripped

let's me think bundling for aarch64 just works !

I'll open up a separate ticket for the illegal instruction message.

@573 573 closed this as completed May 19, 2021
@573
Copy link
Author

573 commented May 19, 2021

Sorry for the fuzz I have to reopen: Just saw

./nix/store/5q9fnnfsg32j23wkg9wzriv5jk9ywrp4-startup: line 2: 1253 Illegal instruction ./nix/store/djb6njqj31dy84jcfhli07sina2gxx37-nix-user-chroot-2c52b5f/bin/nix-user-chroot -n ./nix -- /nix/store

file -p /nix/store/djb6njqj31dy84jcfhli07sina2gxx37-nix-user-chroot-2c52b5f/bin/nix-user-chroot

/nix/store/djb6njqj31dy84jcfhli07sina2gxx37-nix-user-chroot-2c52b5f/bin/nix-user-chroot: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter ./nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped

So I tend to rename the issue "Question: Is it possible to have nix-user-chroot target aarch64-linux ?"

@573 573 changed the title Question: Would it be sufficient to add system aarch64-linux to cross-bundle ? Question: Is it possible to have nix-user-chroot target aarch64-linux ? May 19, 2021
@573 573 reopened this May 19, 2021
@573
Copy link
Author

573 commented May 19, 2021

Pulling https://github.com/nix-community/nix-user-chroot/releases/tag/1.2.2 could be an option.

See #69 as well.

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

1 participant