<TonyTheLion>
when I try to execute /nix/store/8agzzydd6gwadklaxl2zcjsmf8k1fjy1-gcc-7.3.0-arm-unknown-linux-gnueabihf-stage-static/bin/arm-unknown-linux-gnueabihf-gcc-7.3.0
<TonyTheLion>
it says 'cannot execute binary file: Exec format error'
<TonyTheLion>
:(
<TonyTheLion>
its weird because the nix executables built do run
<TonyTheLion>
I guess I'm going to have build gcc explicitly
orivej has quit [Ping timeout: 256 seconds]
TonyTheLion has quit [Ping timeout: 260 seconds]
sonarpulse has quit [Ping timeout: 240 seconds]
orivej has joined #nixos-aarch64
orivej has quit [Ping timeout: 240 seconds]
hoverbear has quit [Read error: Connection reset by peer]
angerman has quit [Ping timeout: 256 seconds]
hoverbear has joined #nixos-aarch64
angerman has joined #nixos-aarch64
<sphalerite>
Dezgeg: have you increased the scope of your binary cache a great deal? I'm finding stuff like gtk in it??
TonyTheLion has joined #nixos-aarch64
<TonyTheLion>
hello
<sphalerite>
TonyTheLion: hi! Re your quesiton yesterday
<sphalerite>
I think you were trying to run the amd64 cross compiler on your ARM machine :)
<TonyTheLion>
I compiled a gcc from scratch and moved it over
<TonyTheLion>
though its not exactly very happy either
<sphalerite>
what do you mean by from scratch?
<TonyTheLion>
when I try to compile the linker says "set: Illegal option -o pipefail"
<sphalerite>
that sounds like a problem with your shell, which might not occur if you use the sandbox
<TonyTheLion>
you mean, nix-shell?
<sphalerite>
no
<sphalerite>
I mean the actual shell
<sphalerite>
Although I'm not sure.
<sphalerite>
How did you produce this compiler and how are you trying to use it?
<TonyTheLion>
by 'from scratch' I meant I ran 'nix-build --arg crossSystem '(import <nixpkgs> {}).lib.systems.examples.armv7l-hf-multiplatform' -A gcc -I nixpkgs=.' on my x86 machine and then moved over the result and its deps
<sphalerite>
ah ok yeah that seems sensible
<sphalerite>
(did you use nix to move htem over? You should be using nix to move stuff over now)
<TonyTheLion>
I did not
<TonyTheLion>
how would I use nix to move stuff over?
<TonyTheLion>
what is that 'sandbox' you are referring to?
<Mic92>
Never got completly around nix-env. I find home-manager easier to understand
<TonyTheLion>
seems like I may have to fix this first 'warning: Nix search path entry '/nixpkgs' does not exist, ignoring'
<sphalerite>
no that shouldn't be a problem
<TonyTheLion>
it does error under that warning about the same thing
<sphalerite>
although you may want to adjust your NIX_PATH from how I set it up
<sphalerite>
huh
<sphalerite>
try just unsetting your NIX_PATH completely, since there won't really be anything useful on it
<TonyTheLion>
so I unset it
<TonyTheLion>
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
<TonyTheLion>
still comes up with this
<TonyTheLion>
when I do 'nix-env -i <path to gcc>
<sphalerite>
are you using the absolute path?
<TonyTheLion>
ye
<sphalerite>
weird
<TonyTheLion>
but should I go all the way to /bin/gcc or just the path to the main dir of gcc-wrapper
<TonyTheLion>
makes no difference apparently
<sphalerite>
yeah it does the same thing
<TonyTheLion>
its obviously trying to look for 'nixpkgs' somewhere
<TonyTheLion>
and since we haven'd defined it, its unhappy
<TonyTheLion>
specifying -I nixpkgs='' made it go away
<TonyTheLion>
now its moaning about not being to connect to the nix daemon
<sphalerite>
are you running it as a non-root user?
<sphalerite>
if so you need to start the nix daemon, just run nix-daemon as root
<TonyTheLion>
I see, I was just about to try that
<TonyTheLion>
whats that daemon for?
<TonyTheLion>
I think I may have to do that nix copy thing first
<TonyTheLion>
because nix says it doesn't know that path I refer to when I try to install gcc from that path (I manually copied there)
<sphalerite>
oh, yeah
<sphalerite>
the daemon is to allow unprivileged users to start builds
<TonyTheLion>
is nix copy a nix2.0 thing only?
<TonyTheLion>
prob nix-copy-closure
<sphalerite>
yep
<TonyTheLion>
lol nix copy doesn't recognized the ssh password I give it to the machine
<TonyTheLion>
I can login with that same password to the machine with just ssh
<sphalerite>
are you using the right username?
<TonyTheLion>
I do 'nix-copy-closure --to ssh://tony@mymachine /nix/store/<path>
<sphalerite>
that... shouldn't work at all, I think
<sphalerite>
oh yeah
<sphalerite>
it's trying to authenticate as the user ssh://tony :D
<TonyTheLion>
it doesn't
<TonyTheLion>
oh lol
<TonyTheLion>
so I don't understand, what should it be then?
<TonyTheLion>
I should omit the 'ssh://' part
<LnL>
are you using 1.11 or 2.0
<TonyTheLion>
1.11
<LnL>
not sure if the ssh:// store uri stuff work there
<sphalerite>
yeah it doesn't work with nix-copy-closure even in 2.0
<sphalerite>
ssh:// is only for nix copy and other fancy 2.0 stuff
<sphalerite>
so yes, just leave it otu
<TonyTheLion>
lol its copying 800 mb to my cortex machine
<TonyTheLion>
error: cannot add path '/nix/store/z0b60y0khix9jb74ka56gw7b7n9s8awx-glibc-2.26-131' because it lacks a valid signature
<TonyTheLion>
:(
<sphalerite>
--no-require-sigs
<sphalerite>
although actually I don't think that works with nix-copy-closure
<TonyTheLion>
yes that doesn't work
<TonyTheLion>
what is the 'signature' it refers to here?
<sphalerite>
a cryptographic signature attesting that "this path is indeed a valid output of the derivation that produces it"
<TonyTheLion>
oh I see
<sphalerite>
I think you can probably get it imported by adding require-sigs = false to /etc/nix/nix.conf on the target machine, but I strongly recommend not keeping that there after you've copied the stuff over
<sphalerite>
(it won't exist, but it should be created by the next nix-env invocation)
<TonyTheLion>
ok but now .nix-profile is empty
<TonyTheLion>
shall I just find it in the /nix/store
<sphalerite>
just use nix-env and it will create it
<TonyTheLion>
its still on about that default.lock file
<sphalerite>
huh
<sphalerite>
which user are you?
<TonyTheLion>
tony
<sphalerite>
what does ls -l ~/.nix-profile say?
<TonyTheLion>
lrwxrwxrwx 1 tony tony 35 Mar 2 05:34 .nix-profile -> /nix/var/nix/profiles/per-user/tony
<TonyTheLion>
so ok
<TonyTheLion>
if I run /nix/store/r7zcxm9df2yi3mvl30q3818safrqbapv-nix-2.0pre5968_a6c0b773-arm-unknown-linux-gnueabihf/bin/nix-env -i /nix/store/iyfn9izndirvzhfksn8kn3wg3cqhfn00-gcc-wrapper-6.4.0-arm-unknown-linux-gnueabihf-arm-unknown-linux-gnueabihf -I nixpkgs=''
<TonyTheLion>
it complains
<TonyTheLion>
error: '/nix/var/nix/profiles/per-user/tony' is not a symlink
<TonyTheLion>
I looked on my other system, that dir is not a symlink there either
<TonyTheLion>
idk what its on about
<TonyTheLion>
if I delete .nix-profile and run nix-env its on about that default.lock file
<sphalerite>
oops that's my bad, should have been per-user/tony/profile, not per-user/tony
<sphalerite>
basically nix-env will try to alter the profile pointed to by ~/.nix-profile
<sphalerite>
if it doesn't exist it will try to alter the default profiel, but since that's shared between all users only root can do that
<TonyTheLion>
ah I see
<TonyTheLion>
now I have gcc in there
<TonyTheLion>
so I need to add back nix-env and all the nix stuff
<TonyTheLion>
so I just run nix-env -i with the path to it
<sphalerite>
yep
<sphalerite>
nix should be installed in the deafult profile though…
<TonyTheLion>
ah I see
<TonyTheLion>
well it worked nevertheless
<TonyTheLion>
but
<TonyTheLion>
the original gcc error
<TonyTheLion>
is still there :(
<TonyTheLion>
gcc -Wall hello.c -o hello
<TonyTheLion>
ld: 2: set: Illegal option -o pipefail collect2: error: ld returned 2 exit status
<TonyTheLion>
I'm guessing thats a bug of some sort
<sphalerite>
pass -v to find out where the wrapper script lives
<sphalerite>
then you can have a look at its contents, particularly which interpreter it's using
<TonyTheLion>
so I open that?
<sphalerite>
run gcc -v hello.c and see where ld lives, then open that, yes
<TonyTheLion>
bash-4.4-p12
<TonyTheLion>
in the /nix/store
<sphalerite>
and if you run that and just type set -o pipefail does it give you the same error?
<TonyTheLion>
I ran this ' /nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash set -o pipefail'
<TonyTheLion>
I got this '-bash: /nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash: cannot execute binary file: Exec format error'
<TonyTheLion>
I think this is not compiled correctly or something
<sphalerite>
oh, running amd64 stuff again…
<TonyTheLion>
how can you tell from that?
<TonyTheLion>
my ld dir is called -arm-unknown-linux-gnueabihf
<TonyTheLion>
afaik I compiled it with the arm flag
<TonyTheLion>
armv7l
<TonyTheLion>
is my nixkpkgs out of date
<TonyTheLion>
probably
<sphalerite>
run file on it :)
<sphalerite>
exec format error usually means you're trying to run stuff fro the wrong arch
<TonyTheLion>
ok
<TonyTheLion>
I guess I'll try compile gcc again
<TonyTheLion>
I compiled it like so 'nix-build --arg crossSystem '(import <nixpkgs> {}).lib.systems.examples.armv7l-hf-multiplatform' -A gcc -I nixpkgs=.'
<TonyTheLion>
is that wrong?
<TonyTheLion>
I recloned nixpkgs and rebuilt it
<TonyTheLion>
still gives me an AMD 64 bash executable
<TonyTheLion>
I guess this is really a bug
<sphalerite>
no I think the gcc attr will just give you the gcc that's used in the stdenv
<sphalerite>
I think it's behaving as intended, just not as you expect it :p
<sphalerite>
not sure how to get the one that you want though.
<TonyTheLion>
I guess you're supposed to use that gcc arm on an x86 system to cross-compile to an arm system
<TonyTheLion>
no
<sphalerite>
exactly
<TonyTheLion>
but a hydra build machine would build on that machine, right?
<TonyTheLion>
if you had a mac hydra build machine, it would build the mac derivations on that machine right?
<sphalerite>
well for a hydra build machine you won't use cross-compiled stuff at all once it's bootstrapped
<TonyTheLion>
so
<TonyTheLion>
if I want hydra to build my arm project
<TonyTheLion>
I tell it the system is 'armv7l-linux"
<TonyTheLion>
and then it magically builds it, but it doesn't require an arm build machine?
<sphalerite>
it does, but the arm build machine can't just use a cross-compiled gcc to build stuff
<sphalerite>
it will need to compile its own compiler and stuff
<sphalerite>
try on the arm machine `nix build -f channel:nixos-unstable hello`
<sphalerite>
you should see it building (or fetching, if you have Dezgeg's binary cache configured) gcc and all that
<TonyTheLion>
right but the gcc that it builds or gets is one that will run on arm no?
<TonyTheLion>
so Dezgeg has all these arm binaries already compiled?
<sphalerite>
yes, but it will be a non-cross-compiled one
<sphalerite>
and yes, quite a few — certainly the core stuff like nix
<sphalerite>
and gcc is part of nix's build closure so gcc too
<sphalerite>
etc
<TonyTheLion>
so the compilation for the arm projects on hydra would happen on an x86 machine?
<sphalerite>
no, on an arm machine
<TonyTheLion>
wait
<TonyTheLion>
how does a non-cross-compiled gcc run on an arm machine?
<sphalerite>
it's not cross-compiled, it's natively compiled. On the ARM machine.
<TonyTheLion>
ok
<sphalerite>
the gcc itself was built on the ARM machine.
<TonyTheLion>
but what compiles that?
<sphalerite>
why is that a concern you have for ARM but not for x86? ;)
<TonyTheLion>
so I literally should just configure hydra to talk to the arm box, and what project i want it to build
<sphalerite>
there's a bootstrap compiler; have a look at nixpkgs/pkgs/stdenv/linux/bootstrap-files
<sphalerite>
yes
<TonyTheLion>
and it will do the right thing
<sphalerite>
yes
<Dezgeg>
I guess something like the X-enabled vim now depends on gtk?
<sphalerite>
Dezgeg: vimHugeX does, and vim_configurable is vimHugeX
<sphalerite>
I'm certainly not complaining :D
<sphalerite>
err the other way round, vimHugeX is vim_configurable. But whatever
orivej has joined #nixos-aarch64
<duncan^>
Surely naturally it holds for vice versa?
<sphalerite>
duncan^: if you're talking equality, yes. But I meant "is" as in "is defined as" :D
<TonyTheLion>
can I somehow kill the nix-daemon thats running?
<sphalerite>
pkill nix-daemon
<sphalerite>
or systemctl stop nix-daemon if you're on nixos
<TonyTheLion>
Package ‘cmake-3.10.2’ in /home/tony/nixpkgs/pkgs/development/tools/build-managers/cmake/default.nix:107 is not supported on ‘arm-linux’, refusing to evaluate.
<sphalerite>
should probably be armv6l-linux or armv7l-linux