<elvishjerricco> Aw, https://github.com/samueldr/cross-system didn't work out of the box with 20.09. Grub failed to build. Guess I need this? https://github.com/NixOS/nixpkgs/pull/119711
<{^_^}> #119711 (by delroth, 4 weeks ago, merged): grub2_efi: fix cross-compilation
<samueldr> oh, 20.09 only tested with sd-image
<samueldr> iso image didn't cross-compile until really recently
<elvishjerricco> Ah. Then I'll try your branch
<samueldr> well, basically how many days since I changed cross-system
<samueldr> I wanted a quick(er) ISO build for Tow-Boot
<samueldr> so I yak shave'd myself into a corner
<samueldr> and fixed cross-compilation for the iso
<elvishjerricco> I wonder if I'm getting any inadvertent freebies with binfmt.emulatedSystems = ["aarch64-linux"]... Like maybe some of these builds *should* fail :P
<samueldr> that's a possible thing I guess
<samueldr> if qemu is given through to the sandbox
<samueldr> but I don't use it
<elvishjerricco> samueldr: Does qemu need to be given to the sandbox for the kernel to use it with binfmt?
<samueldr> the kernel "just" executes with a given binary
<samueldr> e.g. when you can ./thing.exe
<samueldr> it passes it to wine or mono
<samueldr> with a particular configured path
AmandaC has quit [Quit: WeeChat 3.1]
<samueldr> and that path has to be accessible in the current... context?
<samueldr> so the binfmt thing, when used for Nix builds, it adds paths to the sandbox
<elvishjerricco> Oh
<elvishjerricco> Yea I see that now: extra-sandbox-paths = /run/binfmt /nix/store/vgyjzpk541vxnhy36l7h3ld1m824cgpa-qemu-5.1.0
bennofs__ has joined #nixos-aarch64
AmandaC has joined #nixos-aarch64
bennofs_ has quit [Ping timeout: 268 seconds]
<elvishjerricco> Well I managed to cross compile the iso. Whether or not it works, I have no idea
<samueldr> heh, try booting it!
<samueldr> (and you're back to square one of no working IBF on the CM4?)
<elvishjerricco> Yea, I've paused trying to debug what's wrong with it until I get my serial cable (hopefully tomorrow)
<elvishjerricco> But I did try booting this iso with qemu using `qemu-system-aarch64 -machine raspi3 -drive file=iso.qcow2,format=qcow2,snapshot=on -kernel tow-boot/tow-boot-rpi3.bin`
<samueldr> no idea if that should work
<elvishjerricco> I got through grub (keyboard didn't work though)
<elvishjerricco> and now it's just sitting there
<samueldr> oh, nice
<elvishjerricco> still showing the last frame that grub put up "0s remaining."
<samueldr> but still, no idea if that realy should work
<samueldr> that sounds like something hung trying to continue with the boot
<elvishjerricco> and spinning some cpu cores pretty hard
<samueldr> oh, then maybe it's just slow
<samueldr> oh right
<samueldr> it is slow
<samueldr> full blown emulation is slow
<elvishjerricco> yea I was guessing it'll just be slow
<samueldr> it's probably loading our quite big kerne
<samueldr> kernel*
<elvishjerricco> doesn't qemu have a JIT mode?
<samueldr> not sure
<samueldr> IIRC U-Boot's own bits for loading images in EFI mode are not exactly performant
<samueldr> I figure my next attempt on the helios64 I'll try with angerman's kernel configs and with sd image
<samueldr> or maybe just that kernel and the iso still, at first
<samueldr> but not today
<samueldr> though I did find two minor issues on Tow-Boot
AmandaC has quit [Quit: WeeChat 3.1]
<samueldr> I don't know if mainline (with the assumed appropriate DTB built-into Tow-Boot) should be enough or not
<samueldr> or maybe that DT is incomplete
<elvishjerricco> Well I killed it so I could try again with `-serial stdio` but that didn't make any output.
AmandaC has joined #nixos-aarch64
Raito_Bezarius has quit [Ping timeout: 250 seconds]
Raito_Bezarius has joined #nixos-aarch64
<elvishjerricco> samueldr: Shouldn't I have seen a bunch of stuff on stdout with `-serial stdio`?
<samueldr> I don't know for sure
<samueldr> I don't know what the "raspi3" machine actually does
<elvishjerricco> Me either :P
<samueldr> there is, though, a Tow-Boot build for qemu
<samueldr> (but not in releases)
<elvishjerricco> Not sure how else to test this.
<samueldr> haven't tested it lately
<gchristensen> samueldr: could probably put tow-boot on hydra btw if that'd be useful
<samueldr> hmm, I didn't ask as it's not intended to be a "NixOS project", Nixpkgs and Nix is only used because it's what I think is the best
<samueldr> (though I know there's not only NixOS projects on the hydra)
<samueldr> it would probably help with CD, especially since the CI builds would be able to use existing cached outputs
<gchristensen> up to you
<matthewcroughan> samueldr: so, your fix branch, doesn't fix spidermonkey.. disabling polkit doesn't work, something still depends on it
<gchristensen> you have to morethan disable it, you have to remove it from the inputs of everything
<matthewcroughan> Oh dear ;(
<gchristensen> can probably do this with an overlay defining polkit to be null
<samueldr> matthewcroughan: if you didn't change it from earlier, you didn't have my latest changes
<samueldr> wpa_supplicant uses spidermonkey
<samueldr> so I just disabled wpa_supplicant
<matthewcroughan> I have the latest hash in my flake.lock
<samueldr> then I don't know what to say
<matthewcroughan> oh, sorry.. that's not what you linked me to
<matthewcroughan> `nixpkgs.url = "github:samueldr/nixpkgs/wip/armv7lfixes";` is what I'm referring to :D
<matthewcroughan> I see now that you've made an overlay that I need to steal.
<samueldr> no
<samueldr> it's the same repo as before
<samueldr> you just, somehow, don't have all the commits
<matthewcroughan> well yeah because I started modifying it, so I'm just gonna need these changes.
<matthewcroughan> like before you did this fix
<samueldr> probably because you were using it from before 14 days ago
<matthewcroughan> yup
<matthewcroughan> disabling wpa_supplicant is absolutely brutal
<matthewcroughan> I can't believe it depends on spidermonkey, what a world
<samueldr> it's possible that it's one of _its_ dependency
<samueldr> that actually depends on spidermonkey
<samueldr> those are obviously not upstreamable fixes, they're workarounds
<gchristensen> pcsclite -> polkit -> spidermonkey
<matthewcroughan> As long as it compiles, I'm very very happy.
<matthewcroughan> I just want a little pi to run docker and pihole that's built with nix ;~;
<matthewcroughan> After this I will play around with Guix though to see what's up.
<matthewcroughan> Probably more suited to the board I'm trying to use anyway. Nix is kind of a big thing, with systemd and all. I just love the tooling.
<samueldr> systemd runs plenty fine on watches
<matthewcroughan> gchristensen: We can probably remove that dependency, and turn it into an option that can be enabled with an override?
<matthewcroughan> samueldr: Yeah fair enough, I don't mean to suggest that systemd is the issue. Even I, a proponent of SystemD have allowed myself to be affected by the anti-systemd bias.
<clever> │ - /build/arm_chainloader.elf.djtMbM.ltrans0.ltrans.o (__aeabi_ui2d)
<clever> │ + /build/arm_chainloader.elf.WB271N.ltrans0.ltrans.o (__aeabi_ui2d)
<clever> what was it that auto-generated these sections?
<clever> its causing my builds to not be reproducible
<samueldr> ¯\_(ツ)_/¯
<samueldr> I'm not too sure what I'm looking at though
<clever> the diff of a .map file, when building with --option repeat 1
<clever> │ - .text.startup 0x0000000000004030 0x32d0 /build/arm_chainloader.elf.djtMbM.ltrans0.ltrans.o
<clever> │ + .text.startup 0x0000000000004030 0x32d0 /build/arm_chainloader.elf.WB271N.ltrans0.ltrans.o
<clever> it also has things like this
<samueldr> debugging output, right?
<clever> yeah
<clever> i think its a dynamically generated section with all string literals, deduped by the linker
<clever> so if you puts("foo"); in 2 different .o files, the linker merges it into a single "foo" in the binary
<clever> but its generating a random symbol name, which nix doesnt like
<samueldr> don't know if it'll help
<samueldr> might be from temporary file names though
<samueldr> clever: -flto ?
<clever> that was present, i just removed it
h0m1 has quit [Ping timeout: 260 seconds]
h0m1 has joined #nixos-aarch64
<clever> all working now
patagonicus183 has joined #nixos-aarch64
monk has left #nixos-aarch64 ["Error from remote client"]
<elvishjerricco> hm. I just get no output with `qemu-system-aarch64 -nographic -machine virt -cpu cortex-a57 -bios result/u-boot.bin`
patagonicus18 has quit [Ping timeout: 252 seconds]
patagonicus183 is now known as patagonicus18
monk has joined #nixos-aarch64
<samueldr> no output at all?
* samueldr checks
<elvishjerricco> Oh I put the arguments in the order in which the github page instructed me to and now I'm getting something :P
<samueldr> I mean...
<elvishjerricco> However, if I try to enter the boot menu, I get stuck at "creating menu..."
<samueldr> oh
<samueldr> way ahead of you
<elvishjerricco> Maybe it's just slow?
<{^_^}> Tow-Boot/Tow-Boot#16 (by samueldr, 1 hour ago, open): tow-boot: Fix PDCurses without vidconsole
<samueldr> nah, I didn't test the PDCurses integration without vidconsole
<elvishjerricco> Hm. Ok grub boots from the iso, but then I get "error: cannot load image." and "Press any key to continue..."
<samueldr> that's good progress, but probably doesn't mean anything "really"
<samueldr> it could be that the way the image is attached is a way the efi bindings can't manage to read from
<samueldr> so the iso image might as well be good, hard to say
<elvishjerricco> I just did `-drive file=$iso,format=raw,snapshot=on`
<elvishjerricco> But if it got as far as grub, doesn't that mean the efi implementation was able to read grub from the iso?
<samueldr> I don't know enough to be sure
<samueldr> U-Boot reads the grub EFI program in a way
<samueldr> the EFI bindings might not do it the same way
<samueldr> and uh
<samueldr> I never actually checked what the error means
<matthewcroughan> samueldr: hey.. guess what
<matthewcroughan> It works now that I'm using your nixpkgs
<samueldr> elvishjerricco: did you set any ram size?
<samueldr> e.g. -m 512
<elvishjerricco> Oh, no I did not
<samueldr> that could be an issue
<matthewcroughan> The magic of embedded Nix is coming to life!
<samueldr> depending on what the machine does by default
<elvishjerricco> There we go. That worked
<samueldr> hah
<elvishjerricco> It's... slow, but I'm in NixOS now
<samueldr> oh, nice to hear!
<elvishjerricco> "running activation script..."
<elvishjerricco> and running... and running...
<elvishjerricco> There it goes.
<samueldr> I was planning to, at some point, prepare some integration tests
<samueldr> with the different u-boot qemu targets
<samueldr> it would be really helpful to validate the boot process works as expected
<samueldr> right, so elvishjerricco, that means the iso you built probably is good, then
<elvishjerricco> Oh I had fallen back to a non-cross compiled one just in case
<elvishjerricco> Trying the cross compiled one now
<samueldr> heh
<elvishjerricco> and it booted!
<samueldr> you tested the PDCurses vidconsole fix?
<samueldr> if so, can you approve the PR?
<elvishjerricco> Oddly enough, it booted *a lot* faster.
<elvishjerricco> No, I was not testing that
<samueldr> odd!
<samueldr> no worries
<elvishjerricco> readlink -f $(which systemctl)
<elvishjerricco> /nix/store/441jh4zij9c0703v523kg1jzqvx8wl7s-systemd-aarch64-unknown-linux-gnu-247.6/bin/systemctl
<samueldr> I know it's good since just now I confirmed it works on the qemu build too
<elvishjerricco> Sweet, definitely a cross compiled system
<clever> elvishjerricco: one sec
<clever> elvishjerricco: [root@amd-nixos:~]# du -hc --max=0 $(nix-store -qR /run/current-system) | sort -h
<clever> if you run this, do you see some non-aarch64 paths in your closure?
<elvishjerricco> That... could take a while to run :P
<samueldr> IIRC we're not "pure" in that there may be parts of the toolchain
<elvishjerricco> But I'll give it a shot
<clever> elvishjerricco: you can run the same thing on the host that cross-built it, just use the right storepath
<samueldr> but some of the previously obvious failures were fixed
<elvishjerricco> Yea there are some paths here that don't have the aarch64-yadda suffix
<elvishjerricco> like gcc
<clever> and then `nix why-depends` to find the path between things
<clever> its likely in the debug info of the aarch64 gcc
<clever> something like that
<samueldr> though we shouldn't have the issue where shell scripts use the x86_64 interpreter in their shebangs anymore for the "trivial" instances we had before
<matthewcroughan> samueldr: I can't believe your nixpkgs worked out. Thanks so much.
<elvishjerricco> So here's a stupid one liner to find all the non-cross builds in the closure of a derivation:
<elvishjerricco> for p in $(nix path-info -r ./aarch64-cross-iso); do [ "$(nix-store -qd "$p")" != "unknown-deriver" ] && (nix show-derivation "$p" | jq '.[] | .inputSrcs[]' | grep "cross-file.conf" || echo FAIL "$p" 1>&2); done
<samueldr> what did this give you?
<elvishjerricco> Looks like a lot of that (all of it?) is because stdenv is in $system/extra-dependencies
<matthewcroughan> Does anybody know why Linux is patchelf'd ?
<matthewcroughan> Like, the Linux kernel itself.
<elvishjerricco> Going to try again with `system.extraDependencies = mkForce [];`
<samueldr> matthewcroughan: everything is in fixupphase
<matthewcroughan> samueldr: yeah I'm just asking why Linux itself requires patchelf
<elvishjerricco> Ok that made it a lot less https://www.irccloud.com/pastebin/7GsTlI8Q/
<elvishjerricco> samueldr: Are you planning on upstreaming these changes? https://github.com/samueldr/nixpkgs/tree/wip/armv7lfixes
<matthewcroughan> BOOM
<clever> does that branch fix the linuxHeaders problem?
<matthewcroughan> Elation. Linux 5.11.6 on this crappy Orange Pi Zero ;D
<matthewcroughan> Linux nixos 5.11.16 #1-NixOS SMP Wed Apr 21 11:13:29 UTC 2021 armv7l GNU/Linux
<colemickens> oh hey
<colemickens> congrats
<colemickens> now do it in guix
<matthewcroughan> Err.. Later.
<matthewcroughan> I bet it'll be harder, and that it's all hype.
<matthewcroughan> I mean I'd have to investigate how they do u-boot too, in order to add this board, which is quite easy in Nix.
<colemickens> ;) I'm just kidding anyway. What was the trick to getting your Orange Pi Zero working
<samueldr> elvishjerricco: they already all are AFAIK
<matthewcroughan> I'm actually not sure whether it was using samueldr's https://github.com/samueldr/nixpkgs/tree/wip/armv7lfixes
<elvishjerricco> oh cool
<elvishjerricco> So I could just be using master instead of that.
<samueldr> but some were/are in the staging cycle
<matthewcroughan> colemickens: It could be that it works just fine, if I do *not* use your crosspkgs branch and just use 20.09, but disable polkit propely using those changes.
<samueldr> if you look at the history, elvishjerricco, you'll see empty commits delimiting first the last commit found on an arbitrary master, then delimiting another bunch of WIP changes
<colemickens> hm.
<elvishjerricco> "Add support for Raspberry Pi 4 USB" uh... is that why usb didn't work on my nixos install? (The one that does boot; not the tow-boot one)
<matthewcroughan> I just need to test that, but it's quite late here ;D
* colemickens thinks about the "automated-known-good-arm-nixpkgs-revs" project again
<samueldr> elvishjerricco: maybe
* colemickens even bought flirc cases for an rpi3b+
<colemickens> nvme not working can also be uas missing :D
<colemickens> as I took a month or two to figure ut
<samueldr> I'll have to take some time and upgrade my rk3399 builder, which uses an NVMe SSD
<samueldr> last time I tried I ended up bricking it... temporarily at least
<matthewcroughan> I've got some really weird interfaces on my orangepi..
<samueldr> so I didn't end up taking the time to actually upgrade it
<matthewcroughan> What on earth is sit0 and ip6tnl0, never seen those before.
* colemickens wonders if he can build stage-1 mobile nixos yet
<matthewcroughan> well, I'm wondering why I'm only now just seeing it
<samueldr> colemickens: I'm confused
<matthewcroughan> not like I've explicitly set this interface anywhere
<colemickens> it's the whole "it re-evals the config for stage-1 manually and doesn't propagate the inputs arg" thing.
<samueldr> oh right
<samueldr> there's a PR for that now
<samueldr> if you want to test the pair
<colemickens> yeah, firing 'er up
<samueldr> what are the chances I'll end up doing something wrong in my attempt at converting my pinebook pro setup into an ESP (still using extlinux for now) + LUKS rootfs?
orivej has quit [Ping timeout: 252 seconds]
<matthewcroughan> Okay.. here we go
<matthewcroughan> Trying to build a podman container to run at startup.
<matthewcroughan> THE POWER
<matthewcroughan> No more bitbake. I'm full.
<matthewcroughan> Oh.. It's recompiling rust. Oh dear.. I might faint.
<samueldr> reminder that there's basically no cache for armv7l, if you do native builds
<matthewcroughan> Yeah that's alright. Though for some reason it's now including spidermonkey again.
<matthewcroughan> That's a real problematic dependency.
<matthewcroughan> OH crap.. I think Docker and Podman both have some link to spidermonkey.
<{^_^}> #106947 (by Atemu, 21 weeks ago, open): pkgsCross.armv7l-hf-multiplatform.spidermonkey_78: error: field 'ufp' has incomplete type 'user_vfp'
<matthewcroughan> I wonder if I can take the podman version down until it works :D
<matthewcroughan> How can I figure out why a dep of a dep has spidermonkey in it?
<matthewcroughan> I can't do why-depends because it's not direct.
<clever> matthewcroughan: run `nix-store -q --tree` on the .drv file instead, and do it the old way
<matthewcroughan> clever: how do I find the derivation?
<clever> nix prints the .drv path when it fails the build
<clever> nix-instantiate can also find it
<matthewcroughan> It's a shame Docker just fails on armv7l.
<matthewcroughan> clever: it appears that polkit is being enabled by podman? https://dpaste.com/BXE4VHM59
<clever> error: 1 dependencies of derivation '/nix/store/mkmrzh0996zwpjpkxkc971k8znib4rvx-nixos-sd-image-21.05.20210504.b2a67fa-armv7l-linux.img-armv7l-unknown-linux-gnueabihf.drv' failed to build
<clever> that is the root drv your trying to build
<clever> so you can `nix-store -q --tree` on that, to see the entire build-time dep tree
<clever> then use `/spider` to search for that, and follow the line upwards
<clever> and by memory, yeah, spidermonkey is the JS engine within polkit, because polkit rules are written in javascript!!
<matthewcroughan> clever: https://termbin.com/1k93
<matthewcroughan> I really cannot read this.
<matthewcroughan> I cannot see how podman ends up bringing in spidermonkey.
<matthewcroughan> how am I supposed to read it?
<clever> follow the line on spidermonkey, and go up
<clever> │ │ │ │ │ │ │ ├───/nix/store/2v0y0w1iha6v7izll0fc685mdm7iaqd9-polkit-armv7l-unknown-linux-gnueabihf-0.118.drv
<clever> │ │ │ │ │ │ │ │ ├───/nix/store/5xgsjch2lsbpldy9d335a97hcyfydrl7-spidermonkey-armv7l-unknown-linux-gnueabihf-78.8.0.drv
<clever> this says that polkit depends on spidermonkey
<matthewcroughan> which depends on pcsclite
<matthewcroughan> which depends on gnupg
<clever> other direction, pcsclite depends on polkit
<matthewcroughan> ah I see, very easy to read.. thanks <3
<matthewcroughan> clever++
<{^_^}> clever's karma got increased to 581
<matthewcroughan> so gpgme is the reason.. crap
<clever> i used to read this all the time, before why-depends automated it
<matthewcroughan> clever: I can't override the buildInputs, right?
<matthewcroughan> using overrideAttrs?
<clever> you should be able to, if its going thru something you can apply an overlay to
<matthewcroughan> if I do, I end up getting undefined variable 'stdenv'
<matthewcroughan> whether I do super, self, or old
<matthewcroughan> buildInputs = super.stdenv.lib.optionals stdenv.isLinux
<clever> can you pastebin your broken overlay?
<matthewcroughan> I realise old is the wrong thing to use, I was just trying it all :D
<clever> old in that context, is the attrs passed to stdenv.mkDerivation
<clever> so it will never contain another stdenv attr
<clever> you want super.stdenv.lib or just super.lib
<matthewcroughan> yeah, but as I said, neither super.stdenv or self.stdenv work
<matthewcroughan> why is that?
<clever> where did super come from? pastebin more!
<matthewcroughan> clever: https://dpaste.com/5DLKHJQUD
<matthewcroughan> thanks :D
<clever> that should work, what error does it give?
<clever> you can also just do plain lib and add lib on line 1
<matthewcroughan> that the stdenv is not defined
<clever> buildInputs = super.stdenv.lib.optionals stdenv isLinux [
<matthewcroughan> error: undefined variable 'stdenv'
<clever> your missing a super. before the 2nd stdenv
<matthewcroughan> ah
<matthewcroughan> right that's a function.. crap
<matthewcroughan> clever: does it need to be super.isLinux?
<clever> super.stdenv.isLinux
<clever> super and self are both copies of pkgs
<clever> so the super.pkgs further down is also redundant
<matthewcroughan> clever: I don't see what you're referring to
<matthewcroughan> there is no super.pkgs
<clever> wpa_supplicant = self.pkgs.runCommandNoCC "neutered-firmware" {} "mkdir -p $out";
<matthewcroughan> hmm.. it looks like I can't access any of those programs in buildInputs now, I need to prepend super to them?
<clever> mis-remembered it
<matthewcroughan> clever: oh that's something samueldr did that I'm not touching :D
<clever> add a `with self;` before the list
<matthewcroughan> buildInputs = with self;? or buildInputs = super.stdenv.lib.optionals super.stdenv super.isLinux with self; [...];
<matthewcroughan> neither :D
<clever> (with self; [...])
<clever> needs some hints to the parser
<matthewcroughan> oh! that's great
<matthewcroughan> a good use of (), really shows off the cases it's supposed to be used in
<matthewcroughan> oh.. hmm
<clever> lib.optionals only takes 2 args, your last example had 3
<clever> 2021-05-16 01:16:05 < clever> super.stdenv.isLinux
<matthewcroughan> clever: https://dpaste.com/599Q95Y7D.txt
<matthewcroughan> that error is as a result of only giving 2 args?
<clever> what is the current line?
<matthewcroughan> what I pasted to you
<clever> buildInputs = super.stdenv.lib.optionals super.stdenv super.isLinux ( with self; [
<clever> you gave it 3 arguments
<clever> 1: super.stdenv
<clever> 2: super.isLinux (doesnt exist)
<clever> 3: a list of packages
<clever> 2021-05-16 01:21:42 < clever> 2021-05-16 01:16:05 < clever> super.stdenv.isLinux
<matthewcroughan> derp, not sure how or why I did that.
<clever> a . vanished as the code evolved, and then a it grew an extra super
<matthewcroughan> so how does isLinux get defined?
<matthewcroughan> self.isLinux? Becuse it's not defined in any other way.
<matthewcroughan> It's not defined like that either.
<clever> > builtins.unsafeGetAttrPos "isLinux" stdenv
<{^_^}> { column = 29; file = "/var/lib/nixbot/nixpkgs/master/repo/pkgs/stdenv/generic/default.nix"; line = 146; }
<clever> self is a copy of nixpkgs
<clever> > pkgs.isLinux
<matthewcroughan> nvm, I see now, I put a space where I shouldn't have put it.
<{^_^}> attribute 'isLinux' missing, at (string):494:1
<clever> > pkgs.stdenv.isLinux
<{^_^}> true
<clever> its on line 146 of pkgs/stdenv/generic/default.nix
<matthewcroughan> ah damn, still wants spidermonkey, even after getting rid of gpgme
<matthewcroughan> I'm convinced this is actually a bug though, based on previous exp with overlays..
<matthewcroughan> it seems like it builds both, and errors
<matthewcroughan> Here's an example of a buggy overlay I wrote. It should work, but it doesn't. The reason it doesn't seems to be because it evaluated `prev.ndi`'s `src` function, which is set to requireFile.
<matthewcroughan> requireFile kills the build. But the point of this overlay was to override that behavior.
<matthewcroughan> Alas. It builds both the overrideAttrs version and the previous version, because it has to, and consequently kills the build.
<clever> it shouldnt build the old version
<matthewcroughan> But it indeed does :D
<matthewcroughan> I think this issue explains some of this behavior. But it is over my head. https://github.com/NixOS/nixpkgs/issues/34086
<{^_^}> #34086 (by twhitehead, 3 years ago, closed): overrideAttrs and overlays don't play well together (overrides get invoked twice)
<matthewcroughan> I've been meaning to make an issue about it, but don't really have the terminology to discuss it.
<clever> also, using a variable url (the ${version}) with a constant sha256, is a recipe for problems
<clever> the version will change, but nix will trust what you claimed (hash is the same) and keep using the old version
<matthewcroughan> there's no way to solve that though, I thought
<matthewcroughan> Here's the new podman dep, with gpgme omitted, hopefully https://termbin.com/qis7
<matthewcroughan> somehow, gpgme is still part of the package
<clever> │ │ │ ├───/nix/store/5080jdi4n7px7v9z7crichgk6gzwdjj1-podman-wrapper-3.1.2.drv
<clever> │ │ ├───/nix/store/4g0hh4bb4jagv64lrla2ndmas8jcnd9p-system-path.drv
<matthewcroughan> do you think L37-43 are unaffected by L14-24 then?
<clever> > podman.buildInputs
<{^_^}> [ ]
<clever> matthewcroughan: you wrapped the wrong package
<clever> > podman-unwrapped.buildInputs
<{^_^}> [ <CODE> <CODE> <CODE> <CODE> <CODE> <CODE> <CODE> ]
<clever> overrode*
<clever> you want to apply your overlay to podman-unwrapped
<matthewcroughan> if I do that, I get infinite recursion
<clever> how did you do that?
<matthewcroughan> OH
<matthewcroughan> lol
<matthewcroughan> I changed l14 to podman-unwrapped = super.podman.overrideAttrs(old: {
<matthewcroughan> derp
<clever> and there is a podman defined elsewhere, the depends on podman-unwrapped
<clever> which now depends on podman!
<matthewcroughan> is there a way to set something = super.<something>?
<matthewcroughan> like have the <placeholder> defined by the key on the left hand side?
<clever> a macro in your editor
<matthewcroughan> WELP
<clever> could maybe do it with nix, but it would be tricky to read
<matthewcroughan> gpgme is necessary to build podman.. guesss I need to see if gpgme can be compiled without polkit
<clever> try just `polkit = null;` in the overlay
<clever> that often disables things
<matthewcroughan> pcslite then dies
<matthewcroughan> gonna make that null too
<matthewcroughan> The real fix I think is to disable polkit support in here
<matthewcroughan> clever: There's no way to override this nicely, but how would you do it?
<matthewcroughan> I can either override the configureFlags, or I can od something with L61 and the buildInputs right?
<matthewcroughan> lib.optionals stdenv.isLinux [ dbus polkit systemd ]
<clever> you could try to override the configure flags, and append a --disable-polkit onto the end
<clever> what happens if you specify both enable and disable? :D
<matthewcroughan> implosion
<clever> it might be dumb enough to just do whatever one occured last
<matthewcroughan> gcc removes your root directory (if it's 12am on a wednesday)
<matthewcroughan> Oh.. I think Podman is just generally failing now.
<matthewcroughan> https://termbin.com/9txwq
<matthewcroughan> here be logs
<clever> no idea on that one
<matthewcroughan> Docker fails because of a perl script
<matthewcroughan> https://termbin.com/f46n
<matthewcroughan> clever: virtualisation.docker.package = inputs.old.legacyPackages.docker_18_09
<matthewcroughan> How could I refer, in a flake, to nixpkgs?
<clever> not sure, still figuring flakes out
<matthewcroughan> rather.. uh.. specific packages, like via `inputs. ...`
<colemickens> matthewcroughan: inputs.self.legacyPackages.${pkg.system}....
<matthewcroughan> self? how come?
<colemickens> if I understand the quesiton
<matthewcroughan> In my flake, old.url is equal to some nixpkgs repo
<matthewcroughan> ah you have to refer to the architecture
<matthewcroughan> legacyPackages.armv7l-linux.docker
<matthewcroughan> that's not gonna cross-compile it though.. is it?
<matthewcroughan> I think it actually is O.o
<samueldr> cool, so without any `console=` parameters, the kernel uses /chosen/stdout-path to determine the console to use, so by default on the pinebook pro that'll be the serial console
<samueldr> not nice when you want to input the passphrase
<samueldr> in other news, I'm not far from being able to actually start using UEFI on the PBP... once "known issues" are fixed
<clever> [1/0/169 built, 0.0 MiB DL] waiting for a machine to build '/nix/store/6hwd71r02hlkk4d0aaypa6kavj71fyvp-zlib-1.2.11.drv'
<clever> the new `nix build` api cant stop interrupting itself
<clever> the last line of build log, is always getting covered up by complaints about the dep tree being wider then the build machine list
<samueldr> in a pinch, to future-proof themselves, one can use the ESP as their /boot partition (as anyway NixOS assumes), but use extlinux.conf with it
<samueldr> you might just need to set the legacy boot flag on it in some ways or other
cole-h has quit [Ping timeout: 260 seconds]
<matthewcroughan> Wow, Docker takes absolutely forever to build :D
<matthewcroughan> OH, nvm, it was using emulation O.o
<matthewcroughan> I can't figure out how to do crossSystem there
<matthewcroughan> virtualisation.docker.package = inputs.old.legacyPackages.armv7l-linux.docker_18_09; will not cross compile, I'm thinking I've one something wrong ;D
<clever> because your flake file, said that legacyPackages.armv7l-linux is native
<matthewcroughan> well typically, you'd say `nixpkgs.crossSystem = { system = "armv7l-linux"; };`
<clever> that only impacts the nixpkgs nixos loaded, the { pkgs, config, ... }: one at the top
<matthewcroughan> how can I have it impact this too?
<clever> your flake is re-importing a different nixpkgs, with diff args
<clever> your flake needs to set system to x86 and cross-system to arm
<matthewcroughan> My flake isn't setting any args. https://dpaste.com/76AJ7T7S3
<clever> this example is rigged up to always build on x86
<clever> is that the one legacyPackages was coming from? i dont see it defined
<matthewcroughan> clever: I'm afraid I can't see how any of your inputs end up getting cross-compiled.
<matthewcroughan> pkgs = is bypassing inputs?
<matthewcroughan> your nixpkgs isn't defined anywhere, so this is just for rpi-tools, which input is being used?
<clever> line 34
<matthewcroughan> oh so it's impure?
<clever> and line 29-33
<matthewcroughan> it's importing nixpkgs from the system?
<clever> nixpkgs is a default input for all flakes
<matthewcroughan> that doesn't make any sense
<matthewcroughan> so you're saying it's impure?
<clever> just by defining nixpkgs on line 13, it gets pulled in as a flake
<clever> its pure
<matthewcroughan> so there's a nixpkgs in the flake.lock?
<clever> yep
<matthewcroughan> that's really silly and I hate it a lot :)
<clever> you dont have to specify where nixpkgs comes from, it knows where to find it
<clever> and the lock file manages the exact version as always
<matthewcroughan> Yeah I think that's really silly.
<matthewcroughan> Imagine if Github disappears tomorrow, the tooling of yesterday will be dumb.
<matthewcroughan> explicit always better than implicit (imo)
<matthewcroughan> clever: that's a really cool flake and I'm going to steal it, but how owuld I do crossSystem? in the traditional way here?
<clever> its using pkgsCross instead
<clever> which is another way to cross compile
<matthewcroughan> That actually doesn't work the same way, afaik.
<matthewcroughan> You can't produce a bootable system image with pkgsCross, I believe.
<matthewcroughan> Or rather, things break.. things that will compile just using crossSystem.
<clever> the bootable system part is handled by nixpkgs.crossSystem
<matthewcroughan> I can't access crossSystem in `inputs.old`, it's just not an attribute that I can find.
<matthewcroughan> why does nixpkgs.crossSystem exist, but inputs.old.crossSystem not?
<clever> nixpkgs.crossSystem is a nixos option
* clever gets link
<clever> this line here, will import the root of nixpkgs (the pkgs tree), and pass it nixpkgs.system and nixpkgs.crossSystem (some nixos options)
<clever> you need to specify those 2 attrs, at whatever site is importing nixpkgs
HenrikK has joined #nixos-aarch64
alpernebbi has joined #nixos-aarch64
HenrikK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orivej has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HenrikK has joined #nixos-aarch64
HenrikK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
HenrikK has joined #nixos-aarch64
HenrikK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gchristensen has quit [Ping timeout: 258 seconds]
gchristensen has joined #nixos-aarch64
superherointj has joined #nixos-aarch64
bennofs__ has quit [Read error: Connection reset by peer]
bennofs_ has joined #nixos-aarch64
superherointj has quit [Quit: Leaving]
<matthewcroughan> You seem to be aware of this comment, does that mean you tried it and found that it worked?
njd has quit [Ping timeout: 240 seconds]
njd has joined #nixos-aarch64
dev_mohe has joined #nixos-aarch64
dev_mohe has quit [Client Quit]
cole-h has joined #nixos-aarch64
<matthewcroughan> spidermonkey-armv7l-unknown-linux-gnueabihf-78.8.0
<matthewcroughan> THE MOMENT OF TRUTH
<matthewcroughan> After rebuilding the whole damned world
cole-h has quit [Ping timeout: 246 seconds]
<matthewcroughan> clever: gonna message here because arm
<matthewcroughan> I did what this comment said, and actually, got nowhere! Spidermonkey still fails hah.
<matthewcroughan> Took 2 hours to compile basically.
<clever> i'm still trying to fix native builds on my end
<matthewcroughan> These are the commits that I'm trying, to fix spidermonkey
<matthewcroughan> I just realised that what I linked (114942) was a PR and I had done it all wrong lol
orivej has quit [Ping timeout: 252 seconds]
<matthewcroughan> I had taken the advice from the comment, rather than actually try to compile it
<matthewcroughan> so I merged and reverted the stuff mentioned in the comment and totally omitted the PR itself. Haha
<matthewcroughan> Either way, it's building on stream right now, gonna get some stream.. I hope this works.
<matthewcroughan> Podman on a little board like this, so cool..
HenrikK has joined #nixos-aarch64
orivej has joined #nixos-aarch64
HenrikK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewcroughan> clever: omg, I can't cross compile git to armv7l because of perl
<matthewcroughan> craaapppp
<clever> ive been trying to fix native builds, because of closure size problems ive been having
<{^_^}> #54510 (by illegalprime, 2 years ago, closed): perl's TermReadKey fails to cross compile to armv7
<matthewcroughan> https://termbin.com/j20u
<matthewcroughan> in order, that's the full log + cli
<matthewcroughan> I can `nix-build '<nixpkgs>' -A pkgsCross.armv7l-hf-multiplatform.perlPackages.TermReadKey` just fine, can't be that.
<matthewcroughan> It's `nix-build '<nixpkgs>' -A pkgsCross.armv7l-hf-multiplatform.perlPackages.ModuleBuild` that I can't do
<matthewcroughan> clever: do you have a workflow you're following? How can I even go about debugging this issue?
<clever> [clever@amd-nixos:~/apps/rpi/rpi-tools]$ nix build .#packages.armv6l-linux.utils --option builders 'pi@pi400 armv6l-linux,aarch64-linux /etc/nixos/keys/distro 4 1 big-parallel'
<matthewcroughan> so you're native building it, right
<matthewcroughan> but then what kind of modifications are you making, to make it build
<clever> yeah, thats currently native
<clever> [clever@amd-nixos:~/apps/rpi/nixpkgs-test]$ git diff
<clever> diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
<matthewcroughan> in the case of perlPackages.ModuleBuild, I've got no idea how to decipher the log it outputs
<clever> - lib.optional stdenv.targetPlatform.isAarch32 ./R_ARM_COPY.patch;
<clever> + lib.optional (stdenv.targetPlatform.isAarch32 && (stdenv.targetPlatform != stdenv.hostPlatform)) ./R_ARM_COPY.patch;
<matthewcroughan> Couldn't run Build.PL: No such file or directory at lib/Module/Build/Compat.pm line 341.
<matthewcroughan> https://termbin.com/7mcd
<matthewcroughan> "Couldn't find a $VERSION in prerequisite File::Temp"
<matthewcroughan> Is it possible to disable tests globally?
<clever> not sure
<matthewcroughan> clever: can you try building git for armv7l?
<matthewcroughan> are you aware that it doesn't build ? Are you surprised by that?
<matthewcroughan> or is that expected, with the current state of armv7l?
<clever> arm32 native is currently broken in the stdenv, and unable to build anything
<clever> i'm attempting to fix that
<matthewcroughan> oh I see
<matthewcroughan> will fixing native builds fix cross-compilation?
<matthewcroughan> or will it improve things, in any way?
<clever> cross worked fine for me
<{^_^}> #107386 (by Gaelan, 20 weeks ago, open): Can't build linux-headers on armv6l
<matthewcroughan> what rev of nixpkgs are you on?
<clever> just switched to the tip of master
<matthewcroughan> I'm on `matthewcroughan/nixpkgs/armv7lfixes/podman`
* clever checks
<matthewcroughan> which is based on samueldr/nixpkgs/wip/armv7lfixes
<matthewcroughan> something must have recently fixed this then :)
<matthewcroughan> maybe I just need to rebase this on a certain hash
* matthewcroughan brb, store
rajivr has quit [Quit: Connection closed for inactivity]
<clever> matthewcroughan: this is what i last used: https://github.com/librerpi/rpi-tools/blob/master/flake.lock
<clever> line 9
<clever> [2/0/157 built, 38 copied (19.5 MiB)] building perl-5.32.1 on ssh://pi@pi400 (round 1/2): /nix/store/byndnq4xaay5g623gihk5kq3gr37yv6d-perl-5.32.1/share/man/man3/Locale::Maketext.3
jumper149 has joined #nixos-aarch64
<matthewcroughan> clever: yeah samueldr's fixes are before that
<matthewcroughan> so something in the meantime has fixed this issue
<clever> [1/0/150 built, 56 copied (87.6 MiB)] building python3-minimal-3.8.9 on ssh://pi@pi400 (round 1/2): gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict
<matthewcroughan> clever: what hardware are you doing all of this compilation on?
<clever> a pi400
<matthewcroughan> Lol, funny.
<matthewcroughan> It's like time has looped back on itself.
<matthewcroughan> I'm pretty sure people were doing compilation like this back in 1980
<matthewcroughan> The tooling is better, but the principles are the same. Do it on your big fat-ass computer over there and pump it over to your cheap one
<clever> yep
zupo has joined #nixos-aarch64
<n0emis[m]> I'am even doing the compilations for my aarch64 devices on a server with binfmt...
<matthewcroughan> n0emis[m]: binfmt is unbearable! :D
<clever> [1/0/149 built, 57 copied (108.1 MiB)] building glibc-2.32-40 on ssh://pi@pi400 (round 1/2): patching file support/resolv_test.h
<clever> progress is being made!
<matthewcroughan> clever: actually, looks like something broke between that commit you're locked on and now
<matthewcroughan> so if you did that darni
<matthewcroughan> whoops, premature enter key
<matthewcroughan> so if you did that compilation on nixos-unstable of today, or stable, you'd find git doesn't cross-compile because of perl532Packages.ModuleBuild
<{^_^}> #66741 (by lopsided98, 1 year ago, open): perlPackages.ModuleBuild (a dependency of git) fails to cross-compile
<matthewcroughan> :D
<clever> matthewcroughan: git.override { perlSupport = false; }
<domenkozar[m]> clever: what's the situation with pi400 and NixOS?
<matthewcroughan> where do overrides go again?
<matthewcroughan> in overlays? or can they exist on their own?
<clever> matthewcroughan: same as overrideAttrs, git = super.git.override { perlSupport = false; };
<clever> domenkozar[m]: i would assume its the same as the pi4, but ive not checked it recently
<matthewcroughan> I wish I could just blacklist Perl.
<samueldr> domenkozar[m] / clever: needs a u-boot update, and probably adding the vendor dtb to the FIRMWARE partition
<samueldr> as u-boot 2021.04 doesn't support the pi 400
<clever> domenkozar[m]: the biggest differences from a driver perspective, is that the pwm audio is missing, and i think the wifi chipset might be a little different, and the vl805 eeprom is gone
<clever> samueldr: ahh, what did they do to break uboot?
<samueldr> nothing
<samueldr> the vl805 eeprom being gone is not much of an issue since the newer rev of pi4 too lacks that eeprom
<samueldr> basically it just didn't know to look for it
<samueldr> now it knows
<clever> ah
<clever> so its more about the type-code being new, so it doesnt know which dtb to use
<samueldr> so in theory by 2021.07 it should work as long as we copy the dtb file too
<samueldr> yeah
<samueldr> trivial changes, the u-boot changes *could* be backported if we wanted to I guess
jumper149 has quit [Quit: WeeChat 3.1]
jumper149 has joined #nixos-aarch64
jumper149 has quit [Client Quit]
orivej has quit [Ping timeout: 265 seconds]
<matthewcroughan> hmm..
<matthewcroughan> Podman works on arm. But our package doesn't.
<clever> [3/0/141 built, 71 copied (171.8 MiB)] building xz-5.2.5 on ssh://pi@pi400 (round 1/2): checking if gcc accepts -Wextra... yes
<clever> another ~8 deps done
zupo has quit [Ping timeout: 240 seconds]
zupo has joined #nixos-aarch64
<matthewcroughan> clever: how would cross-compiling a go package even work
<matthewcroughan> pkgsCross on a buildGoModule doesn't make any sense as far as I can tell?
<matthewcroughan> arguments have to be passed that pkgsCross isn't going to be passing.
<samueldr> whatever ecosystem it uses, pkgsCross.[...].thing should do a cross-compilation... if the ecosystem handles it
<matthewcroughan> Well, in the case of Podman, I can't see how pkgsCross would have any effect.
<samueldr> why?
<clever> [clever@amd-nixos:~/apps/rpi/nixpkgs-test]$ nix repl .
<clever> nix-repl> :b pkgsCross.aarch64-multiplatform.ipfs
<matthewcroughan> The cli and log doesn't seem to change accordingly.
<matthewcroughan> `go build -mod=vendor -gcflags 'all=-trimpath=/build/source' -asmflags 'all=-trimpath=/build/source' -ldflags '-X github.com/containers/podman/v3/libpod/define.gitCommit= -X github.com/containers/podman/v3/libpod/define.buildInfo=315532800 -X github.com/containers/podman/v3/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v3/libpod/config._etcDir=/etc ' -tags " systemd
<matthewcroughan> exclude_graphdriver_devicemapper seccomp" -o bin/podman ./cmd/podman`
<matthewcroughan> whether I cross compile or not, doesn't matter, this cli remains the same
<samueldr> "can't see how i would have any effect" is totally different than "I see it having no effect"
<samueldr> and it may not be an issue
<matthewcroughan> Well, both are true.
<samueldr> if the ecosystem handles it
<clever> [1/0/2 built, 119 copied (1633.1/1633.6 MiB), 363.2 MiB DL] building go-1.16.4 (round 1/2) (buildPhase): Building Go toolchain1 using /nix/store/97pdgrxwgpnsmf4449cfr2jn0a19yl71-go-bootstrap/share/go.
<samueldr> you can't see how *configuring Nixpkgs to do cross-compilation* would have any effect?
<matthewcroughan> Oh, I can. I just cannot imagine how pkgsCross changes the CLI args of a go build.
<clever> matthewcroughan: it might be using env vars
<matthewcroughan> Would it not be better to build podman in accordance with the original makefile than to use buildGoModule?
<matthewcroughan> Since the original makefile already has all the architectures accounted for, even ppc.
<samueldr> the CLI args not changing is not necessarily an issue
<samueldr> the compiler tooling might have the same name, and have been built differently in a way it knows the default target is now cross-compilation
<matthewcroughan> Well, it errors with "error 1"
<matthewcroughan> It's a very non descript error.
<clever> [1/0/2 built, 119 copied (1633.1/1633.6 MiB), 363.2 MiB DL] building go-1.16.4 (round 1/2) (buildPhase): Building packages and commands for target, linux/arm64.
<matthewcroughan> It reports that there's an error on the Makefile at L208
<samueldr> if it runs with any sort of parallelism, it might as well be a few lines higher
<matthewcroughan> https://termbin.com/nwfr
<clever> the go compiler from pkgsCross.aarch64-multiplatform, is targeting linux/arm64
<clever> which seems to imply that it is a special build of go, that can only target arm64
<matthewcroughan> This is the Line it claims to fail on.
<samueldr> well
<matthewcroughan> Are we not doing something wrong by ignoring L109?
<samueldr> did you purposefully fail to read the preceding two error messages?
<matthewcroughan> You're referring to `make: git: No such file or directory`? samueldr
<samueldr> >> build constraints exclude all Go files in
<samueldr> I'm not a go developer
<samueldr> never gone go
<matthewcroughan> Did not assume that was an error, but a warning.
HenrikK has joined #nixos-aarch64
<samueldr> I would first search to see which assumption holds true
<{^_^}> golang/go#24433 (by pjebs, 3 years ago, closed): cmd/go: can't load package: build constraints exclude all Go files in
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<samueldr> but "Error 1" is make reporting that whatever it ran exited with exit code 1
<samueldr> and it looks like, at a glance, that there is only one thing ran beforehand, no parallelism interleaving messages
<matthewcroughan> > cgo is disabled when cross compiling.
<{^_^}> error: syntax error, unexpected ')', expecting ID or OR_KW or DOLLAR_CURLY or '"', at (string):495:1
<matthewcroughan> always do that by accident, sorry :P
<clever> imports github.com/coreos/go-systemd/v22/internal/dlopen: build constraints exclude all Go files in /build/source/vendor/github.com/coreos/go-systemd/v22/internal/dlopen
* clever opens grep.app
<matthewcroughan> Yeah the cross compilation is not being set up properly.
<{^_^}> golang/go#39398 (by lbbxsxlz, 49 weeks ago, closed): cmd/go, cmd/cgo: “ build constraints exclude all Go files“ error
<matthewcroughan> Actually proving this is going to be a very annoying process of modifying the derivation and overriding buildGoModule
<clever> the error occurs in this file
<clever> line 233
<clever> samueldr: by chance do you have @ powers in #nixos ?
<samueldr> nope
<clever> ah, gchristensen is awake
<clever> building go a 3rd time!
<clever> it seems `nix repl --option repeat 0` doesnt work
HenrikK has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bennofs_ has quit [Read error: Connection reset by peer]
bennofs_ has joined #nixos-aarch64
alpernebbi has quit [Quit: alpernebbi]
<clever> [1/0/129 built, 97 copied (202.9 MiB)] building gcc-10.2.0 on ssh://pi@pi400 (round 1/2): source root is gcc-10.2.0
<FantasyCookie17[> My RockPro64 seems to just hang at `U-Boot TPL 2020.07 (Jul 06 2020 - 19:22:53)` after the first reboot after applying my config (the `matrix` config from https://codeberg.rog/FantasyCookie17/nixos-server-configs)… Does the baud rate constantly stay at 1.5M or is it expected to change? Note: I don't have the eMMC fix applied (yet, at least), but given it worked so far, and I didn't even get to the appropriate
<FantasyCookie17[> error message, I assume that' not the issue here.
<FantasyCookie17[> Nvm. It stopped hanging there; I got a bit further now…
<FantasyCookie17[> I don't get any issues with hs200, though.
<clever> build of '/nix/store/wr2g8mfx73gknyfw1c4hvgq9iry9fxkh-gcc-10.2.0.drv' on 'ssh://pi@pi400' failed: builder for '/nix/store/wr2g8mfx73gknyfw1c4hvgq9iry9fxkh-gcc-10.2.0.drv' failed with exit code 1
<clever> samueldr: ack, something broke!
<clever> builder for '/nix/store/wr2g8mfx73gknyfw1c4hvgq9iry9fxkh-gcc-10.2.0.drv' failed due to signal 11 (Segmentation fault)
<clever> wut?
<FantasyCookie17[> This is the error I'm getting. Hitting `*` works, but…
<FantasyCookie17[> Why?
<FantasyCookie17[> `/dev/disk/by-uuid/794d7cce-5323-4e7e-af33-70162f4aa18b` is partition 2 on my NVMe SSD btw.
<samueldr> FantasyCookie17[: the baud rate stays 15... until getty kicks-in ("login prompt") where it may go down to 115200
<samueldr> 15... being how many zeroes rockchip uses
<samueldr> rounds like PCIe issues?
<samueldr> hitting * works (I think it's actually any other unlisted key)... but that path stays unmouted, right?
<samueldr> unmounted*
<samueldr> oh
<samueldr> it could be that it's being mounted in stage-2 by systemd
<FantasyCookie17[> <samueldr "15... being how many zeroes rock"> 1500000. 1.5 million.
<samueldr> ONE POINT FIVE MILLION ZEROES? ;)
<FantasyCookie17[> <samueldr "hitting * works (I think it's ac"> No, it's listed as `Ignore issues and continue`.
<FantasyCookie17[> And it doesn't stay unmounted.
<samueldr> oh, mnemonic I guess is "1 5 and 5 zeroes"
<samueldr> yeah, but "*" is not the actual key it needs, you could type e.g. a or z
zupo has joined #nixos-aarch64
* samueldr wonders if internet is bad or github having issues
<FantasyCookie17[> <samueldr "yeah, but "*" is not the actual "> Oh, really? It just mentions `r` and `*`…
<samueldr> yeah, "*" here is akin to "any key not listed in other options"
<FantasyCookie17[> <samueldr "it could be that it's being moun"> I guess?
<samueldr> most likely
<FantasyCookie17[> <samueldr "rounds like PCIe issues?"> Pretty sure they are.
<samueldr> most likely the modules
<samueldr> oh, I wonder if there's matrix lag right now
<samueldr> considering the time it takes to answer
<FantasyCookie17[> I have both my swap and my `/var/lib` on the SSD, and both get mounted only later in the boot process.
<samueldr> right, I would suspect the modules not being present
<samueldr> right now nixos-install does not know about those modules to add them to all-hardware
<samueldr> uh, not all-hardware
<samueldr> but your generated hardware.nix
<samueldr> (forgot the exact name)
<FantasyCookie17[> You mean `/etc/nixos/hardware.nix`?
<samueldr> hardware-configuration.nix
<elvishjerricco> ok I have a serial cable for my pi. Now... how do I use it? :P
<samueldr> elvishjerricco: the right way
<samueldr> elvishjerricco: ;) read their fine documentation
<FantasyCookie17[> <samueldr "hardware-configuration.nix"> Oh, right.
<FantasyCookie17[> Is there something I can do to fix this issue? Like, telling systemd to wait with mounting these or something?
<samueldr> elvishjerricco: note that RX/TX sometimes is... "weirdly labeled"... never clear whether the cable labels "you should plug this cable to RX of the board" or "this is the RX of the adapter"
<samueldr> elvishjerricco: so if you get no output from U-Boot, swap RX and TX as a first step
<samueldr> FantasyCookie17[: add moddules to boot.initrd.availableKernelModules; some of those https://github.com/NixOS/nixpkgs/blob/a5d04b89fd5238f0e38ef87de4678e378761d67b/nixos/modules/profiles/all-hardware.nix#L86-L92
<samueldr> most likely the two last ones, not sure what rockchip-rga is
<samueldr> 2D rastr
<samueldr> raster*
<samueldr> not needed for PCIe I would assume
<samueldr> though I'm not 100% positive this is enough to get PCIe in stage-1
<samueldr> I *think* it is, if I tested right when I tested
<samueldr> though if it needed "power regulators" it'll be hard to know for sure since they are weakly linked transitively through the DT
<samueldr> you could also import <nixpkgs/nixos/modules/profiles/all-hardware.nix> in your configuration
<samueldr> that would be way more than strictly required
<samueldr> but another option to see if any would be missing from that list
<elvishjerricco> But like, how do I actually look at the serial output on my desktop?
<samueldr> elvishjerricco: using something like picocom, or putty even (yes, even on linux)
<samueldr> you might want to add your user into the IIRC dialout group
<samueldr> so it has read/write access to /dev/ttyUSB*
<elvishjerricco> So just picocom /dev/ttyUSB0?
<samueldr> picocom -b 115200 /dev/ttyUSB0
<elvishjerricco> Hm. Not seeing any output...
<elvishjerricco> Oh wrong image
<elvishjerricco> Ok cool. Now I see what I normally see on the screen when plugged into a monitor. Sweet
<elvishjerricco> samueldr: is "Creating menu..." supposed to take a while?
<FantasyCookie17[> <samueldr "e.g. some of them https://github"> The comment says they're needed for USB…
<samueldr> elvishjerricco: pull master
<samueldr> FantasyCookie17[: I wrote that comment, it could also apply for PCIe if the PCIe drivers alone are not enough
<samueldr> *could*
<FantasyCookie17[> Turns out they're not needed.
<samueldr> good to know
<samueldr> that's one big issue with power management on ARM+DT compared to x86_64+ACPI
<FantasyCookie17[> I just added `phy-rockchip-pcie` and `pcie-rockchip-host` and now it seems to boot flawlessly.
<samueldr> great
<samueldr> AFAIUI ACPI has some form of programming that allows the power management to happen hidden from the OS
<samueldr> meanwhile with DT the OS has to power up the thing the different hardware needs
<elvishjerricco> Oh how I wish this had enableParallelBuildning...
<samueldr> elvishjerricco: try enabling it, I didn't dare because at some point before it wasn't working
<samueldr> that was before I was the maintainer
<samueldr> it might just as well work
<samueldr> if it doesn't, though, that's something to be fixed with upstream :)
<elvishjerricco> Ok, somewhat buggy menu is working now
<elvishjerricco> This is what I get when I choose USB boot from the menu: https://www.irccloud.com/pastebin/0dGzxTkO/
<elvishjerricco> So USB isn't working I guess
<elvishjerricco> That's what we'd figured
<samueldr> elvishjerricco: going to a console, then run `usb start`
<samueldr> try going to the firmware console*
<elvishjerricco> "No working controllers found"
<samueldr> good!
<samueldr> I don't have a clue off the top of my head
<samueldr> probably something about dtparams in config.txt?
<samueldr> *if* that dtb file it loads doesn't overwrite those?
<elvishjerricco> I'm supposed to use some overlay, and I do have that configured
<samueldr> right
<elvishjerricco> And I do have the overlays directory on the image
<samueldr> then the dtb it loads disables the change
<elvishjerricco> How can I debug which dtb it loads?
<elvishjerricco> Like, maybe it's just loading the wrong one
<samueldr> you can't exactly, but you know from the rpi.c file
* samueldr digs
<elvishjerricco> Also, does this matter? "There is no valid bmp file at the given address"
<samueldr> >> bcm2711-rpi-cm4.dtb
<samueldr> elvishjerricco: it's fine, known issue (I didn't file) with the pi family
<samueldr> somehow the bitmap embedding doesn't work there
<samueldr> I have to check why
<samueldr> it can be safely ignored
<elvishjerricco> Can I list files on the sd card and stuff from this console?
<samueldr> yes, with `ls`... but use `help ls` to know how to use it
<samueldr> IIRC it'll be something like ls mmc0 0 /
<samueldr> or
<samueldr> ls mmc 0:1 /
<samueldr> where those numbers are device and partition
<samueldr> but really I'm 99% sure the overlay configuration from the firmware is being overwritten
<elvishjerricco> Huh. ls mmc0:1 "Couldn't find partition mmc0:1"
<samueldr> probably need a space
Acou_Bass has joined #nixos-aarch64
<elvishjerricco> Is there not like lsblk or something?
<samueldr> mmc info IIRC
<samueldr> it's really not linux :)
<samueldr> on top of the vendor dtb
<samueldr> and probably with a different dr_mode
<elvishjerricco> Right, I've got `dtoverlay=dwc2,dr_mode=host`
<elvishjerricco> in config.txt
<samueldr> yeah, since u-boot loads a dtb file, those configuration changes do nothing
<elvishjerricco> Oh
<elvishjerricco> what
<elvishjerricco> then how do I do the thing?
<samueldr> I'm not sure why it doesn't just use the firmware provided DT
<samueldr> like it did previously
<samueldr> just for fun, delete the CM4 dtb file from the FAT32 partition
<samueldr> maybe it doesn't *need* them?
<elvishjerricco> Like after booting?
<samueldr> no, either from the tow-boot build, or imperatively to try
<samueldr> you will need to boot again
<elvishjerricco> FYI
<elvishjerricco> U-Boot> mmc info
<elvishjerricco> Device: emmc2@7e340000
<elvishjerricco> ...
<elvishjerricco> seems odd
<samueldr> those names are the names in the DT
<samueldr> which won't map (I think) with the "device names" in how U-Boot uses them
<elvishjerricco> Still no working controllers found after removing the cm4 dtb
<elvishjerricco> Does u-boot not have a way to apply overlays like I would with config.txt?
<elvishjerricco> I have to go for now. I'll come back to this later
ashkitten has quit [Quit: WeeChat 3.1]
<clever> elvishjerricco: nixos will instead pre-apply the overlays at build time, and give uboot the final merged result
<samueldr> device tree overlays are non-standard
<samueldr> clever: that's Tow-Boot here
<samueldr> no NixOS involved :)
<clever> ah
<samueldr> and it's the "wrong" dtb
<samueldr> elvishjerricco: though seeing that it boots still with the dtb removed is interesting
<samueldr> I'll have to do more testing
<samueldr> so yeah, the raspberry pi foundation has their _own_ device tree overlays semantics
<samueldr> which differs from what has been proposed elsewhere (mainly it builds on top of it)
<samueldr> those dtparams are AFAIUI from the foundatoin
<samueldr> raspberry pi foundation*
ashkitten has joined #nixos-aarch64
Acou_Bass has quit [Read error: Connection reset by peer]
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Acou_Bass has joined #nixos-aarch64
cptchaos83 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
cptchaos83 has joined #nixos-aarch64
<clever> samueldr: how much do you know of go?
<samueldr> clever: 0
zupo has joined #nixos-aarch64
<clever> ah
<clever> i had come across a rather pesimistic post on the rpi forums, asking "how slow is go?"
<clever> and after ipfs cross-compiled so easily, i gave their benchmark util a try with nix, so i would be using the exact same compiler on every target
<clever> and 32bit is performing way way worse then 64bit
Acou_Bass has quit [Quit: ZNC 1.8.2 - https://znc.in]
Acou_Bass has joined #nixos-aarch64
<FantasyCookie17[> I heard Go's GC was poorly designed.
<clever> FantasyCookie17[: i think the problem in this case, is using float64 based math on a 32bit build
<elvishjerricco> samueldr: Back for a while. So how do I do the equivalent of `dtoverlay=dwc2,dr_mode=host` with tow-boot?
<FantasyCookie17[> It doesn't free to the OS by default, only to itself, afaik, unless you set an environment variable, and it has rather poor performance.
Acou_Bass has quit [Read error: Connection reset by peer]
<samueldr> elvishjerricco: AFAIK you "can'T"
<samueldr> what you'd do is pre-apply the overlay
<elvishjerricco> :|
<elvishjerricco> How do I do that?
<{^_^}> nixos-hardware#261 (by samueldr, 3 days ago, merged): raspberry-pi/4: Add modesetting option
<{^_^}> nixos-hardware#262 (by samueldr, 3 days ago, open): Support for additional "dtparams" for Raspberry Pi
<samueldr> using fdtoverlay you can apply overlays... but won't be able to apply the parameters (e.g. dr_mode=host)
<samueldr> for that you'll have to hardcode it into the overlay
<clever> elvishjerricco: which model of rpi?
<elvishjerricco> Oh boy...
<elvishjerricco> clever: cm4
<elvishjerricco> 4GB, no wireless, no emmc
<elvishjerricco> with wireless*
<clever> elvishjerricco: then in addition to nixos applying the overlay for you, you ALSO need the matching dtoverlay in config.txt
<clever> or the firmware wont even enable the dwc2 controller
<samueldr> clever: are you sure
<samueldr> what a mess they made
<clever> samueldr: yes, the pi4 had very similar problems when getting the usb-c port online
<clever> the usb power domain is off by default, because nobody needs it
<clever> and there is an undocumented mux, to select between dwc2 or xhci
<clever> elvishjerricco: oh, and the xhci has far better host-mode performance, dwc2 sucks
<samueldr> elvishjerricco: though I find it odd that the board boots without the dtb file, but the firmware's device tree doesn't make USB work
<samueldr> oh... I wonder if that usb controller works in U-Boot at all for the CM4
<clever> elvishjerricco: is it booting from usb?
<samueldr> clever: hard to use the hardware that's not present
<elvishjerricco> clever: It's booting off sd card right now
<clever> if you add `otg_mode=1` to `config.txt`, then the firmware will activate the xhci controller instead
<elvishjerricco> samueldr: The dtb doesn't make usb work even if you're not using u-boot. You need the overlay
<clever> that has a different overlay
Acou_Bass has joined #nixos-aarch64
<elvishjerricco> clever: Ok... so I have to pre-apply *that* overlay now?
<clever> [clever@amd-nixos:~/apps/rpi/linux/arch/arm/boot/dts]$ vi bcm2711-rpi.dtsi
<samueldr> elvishjerricco: let me rephrase what should be tried
<clever> 66 xhci: xhci@7e9c0000 {
<clever> 68 status = "disabled";
<clever> elvishjerricco: the overlay file doesnt exist!, s you need to write your own, to turn this back on
<samueldr> elvishjerricco: without adding any dtb files to the Tow-Boot firmware partition, enable it in the config.txt
<clever> you could try just otg_mode=1 and see what happens
<elvishjerricco> With just otg_mode=1 in config.txt, I still get "No working controllers found"
<samueldr> clever: isn't that xhci hardware on the PCIe bus?
<samueldr> clever: which on the CM4 board here could be... anything else?
<clever> samueldr: the pi4 has 2 xhci controllers
<samueldr> oh
<samueldr> nice
<clever> one in the soc itself, usb2.0 only
<samueldr> not confusing at all :)
<clever> one on the pci-e bus, usb3 capable
<samueldr> oh, disregard
<samueldr> I knew that
<samueldr> but I thought you meant two on-board
<elvishjerricco> What do I try now?
<clever> the dwc2 and xhci controllers share the D+/D- pins
<samueldr> elvishjerricco: did you try no dtb files on Tow-Boot, and config.txt configured correctly?
<clever> elvishjerricco: let me gather some example dts files....
<samueldr> then => fdt addr ${fdtcontroladdr} and => fdt list ... I don't know what's the actual path here let me check
<elvishjerricco> Ah, no I left the cm4 dtb in for that test
<clever> root@pi400:~# dtc /proc/device-tree --sort > baseline.dts 2>/dev/null
<clever> first i record a baseline
<samueldr> clever: we don't have a linux running :)
<samueldr> clever: can you tell me the path for &dwc2_usb ?
<samueldr> I don't have a pi4 close to up and running
<clever> its not enabled yet
<samueldr> no need to enable it
<clever> i'm turning it on now, and getting a diff of the dts
<samueldr> it'll be present but offline
<elvishjerricco> Ok, with otg_mode=1 and no cm4 dtb, I get the exact same behavior
<clever> soc {
<clever> usb@7e980000 {
<clever> status = "disabled";
<clever> __symbols__ {
<clever> usb = "/soc/usb@7e980000";
<samueldr> elvishjerricco: I was thinking only the "known good for linux" configuration
<elvishjerricco> What do you mean by that?
<samueldr> no dtb file, and what is supposed to enable it for when the raspberry pi4 firmware boots linux
<samueldr> then run => `fdt addr ${fdtcontroladdr}` and => `fdt list /soc/usb@7e980000`
<samueldr> the status value should be "okay" if still enabled
<elvishjerricco> well fwiw even raspios doesn't enable usb automatically; you have to modify the config.txt after putting the image on the sd card.
<samueldr> if it is, then I guess that U-Boot mainline doesn't use the controller for some reason
<samueldr> yes
<samueldr> that option
<samueldr> turn it on
<elvishjerricco> Unrelated, how do I turn on the serial console in a working nixos install (no u-boot) on this?
<samueldr> uuh, console=something which is specific enough for the hardware
<samueldr> the rightmost valid console= value is used by the kernel as the console
<elvishjerricco> Alright I'll stick to ssh to access this.
<elvishjerricco> Anyway, where do I get the fdt command from?
<clever> samueldr: if you use console=serial0, the firmware will replace it with either ttyAMA0 or ttyS0, based on overlays that are present
<clever> also, i think my SD card just up and died
<clever> its now read-only, but claiming to accept writes
<clever> ive changed config.txt 3 times, and its undone after every reboot
<samueldr> clever: "the firmware" ??
<clever> i just changed it again, `echo 1 > /proc/sys/vm/drop_caches` and its undone again
<samueldr> clever: time for f3 !
<clever> samueldr: the rpi firmware mutates cmdline.txt, right uboot may not do the same...
<samueldr> right
<clever> f3?
<samueldr> f3!
<clever> > f3
<{^_^}> "x"
<samueldr> uh
<samueldr> ,locate bin f3write
<clever> > pkgs.f3
<{^_^}> Found in packages: f3
<{^_^}> "<derivation /nix/store/565qhs8xiljyid2wj4rdq5bbz4ywkn3p-f3-8.0.drv>"
<samueldr> it's meant to check cards you buy if they really are the size they say
<samueldr> but also good enough to check whether they're broken or not
<elvishjerricco> samueldr: So you're telling me to run `fdt addr ${fdtcontroladdr}` and => `fdt list /soc/usb@7e980000` in Linux, right?
<samueldr> in u-boot console
<elvishjerricco> oh
<samueldr> :)
<elvishjerricco> wait
<elvishjerricco> so
<clever> samueldr: let me make a backup with ddrescue first...
<elvishjerricco> Which u-boot/dtb/config.txt combination should I be using for this?
<samueldr> "correct" config.txt configuration for usb on CM4 according to the vendor, no dtb files
<samueldr> with Tow-Boot
<clever> elvishjerricco: my understanding is that you must have `dtoverlay=dwc2,dr_mode=host` (and the overlay may need to exist), or the usb controller will just hard fail when you access it
<clever> plus what samueldr is saying, so linux knows to access it
<clever> [12091731.197220] blk_update_request: I/O error, dev mmcblk0, sector 3553536 op 0x0:(READ) flags 0x80700 phys_seg 8 prio class 0
<samueldr> clever: there won't be a linux for what I want to see
<clever> or whatever os you plan to run below uboot
<samueldr> I want to see if without a dtb file, and the proper config.txt configuration, the fdt as seen by U-Boot is valid
<elvishjerricco> is ${fdtcontroladdr} supposed to be a variable I need to sub in?
<samueldr> it's a variable already built into U-Boot
<matthewcroughan> Welp, samueldr, thanks to you and a few others I got it all working
<samueldr> elvishjerricco: you may be right that the overlay files need to be at the right place
<samueldr> elvishjerricco: can you manage that too?
<matthewcroughan> about 40 lines of nix, docker on startup, on an orange pi zero, running the latest kernel
<clever> this dead SD card also explains the segfault gcc had earlier
orivej has joined #nixos-aarch64
cole-h has joined #nixos-aarch64
<elvishjerricco> samueldr: Ok. Booted with `dtoverlay=dwc2,dr_mode=host`, with the overlay files present, and without the cm4 dtb, then running `fdt addr ${fdtcontroladdr}` followed by `fdt list /soc/usb@7e980000`, I get this: https://www.irccloud.com/pastebin/qerjroMe/
<elvishjerricco> status = "okay";
<samueldr> yep
<samueldr> that's good news
<elvishjerricco> What does that mean?
<samueldr> status is a special flag in DTs
<samueldr> "disabled" means it's disabled, "okay" means it's usable
<samueldr> so for an OS (or for U-Boot) to use it, the status needs to be "okay"
<clever> samueldr: do you know if the pi4 uboot in nixos has the dwc driver enabled? its possible to avoid it if you use xhci for both internal and external usb
<elvishjerricco> So then why doesn't u-boot see it?
<samueldr> dr_mode = "host";
<samueldr> that is another thing the overlay overlaid
<samueldr> elvishjerricco: can you re-try `usb start`?
<samueldr> or did you already?
<elvishjerricco> "No working controllers found"
<samueldr> clever: why would you do that?
<samueldr> elvishjerricco: hmmm
<matthewcroughan> clever: did you ever get not-os booting on actual hardware?
<samueldr> I wonder if the driver has been built
<clever> matthewcroughan: i did have it netbooting on my rpi at one time
<samueldr> this says the compatible string is valid for this driver
<matthewcroughan> sweet
<matthewcroughan> this orange pi zero is running out of memory haha
<elvishjerricco> Alright I need to leave again for now. Might be a while before I'm back
<samueldr> so at a glance I don't know, it *looks* like everything is setup correctly
<clever> found at least one ~64kb range on the card, that cant read back
<clever> 50% recovered so far, and growing
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<clever> pct rescued: 99.99%, read errors: 0, remaining time: n/a
<clever> ipos: 1819 MB, non-trimmed: 65536 B, current rate: 38535 kB/s
<clever> Trimming failed blocks... (forwards)
<clever> 90 GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
<clever> samueldr: i think this might be harming arm32 cross-compiles with go
<clever> its not clear if hostPlatform is arm or x86, when doing an x86->arm cross
FantasyCookie174 has joined #nixos-aarch64
<clever> samueldr: what args should i run f3write with?
<samueldr> whatever the manual says I guess
<samueldr> though maybe f3probe first (and read the manual still)
<clever> the --help isnt very clear
<samueldr> with f3write you write to a filesystem IIRC
<samueldr> but in your situation you might not be able to format
<clever> Probe finished, recovering blocks... Done
<clever> Bad news: The device `/dev/mmcblk0' is damaged
<clever> *Usable* size: 0.00 Byte (0 blocks)
<clever> Announced size: 7.40 GB (15523840 blocks)
FantasyCookie17[ has left #nixos-aarch64 ["User left"]
<clever> openat(AT_FDCWD, "/dev/mmcblk0", O_RDWR|O_DIRECT) = 3
<clever> it opened it in direct mode, seeked around a bit, wrote, and then tried to read back
<clever> with some syncs and cache flushes in between
<clever> [root@system76:~]# blkdiscard /dev/mmcblk0 -f
<clever> blkdiscard: /dev/mmcblk0: BLKDISCARD ioctl failed: Input/output error
<clever> i'm also unable to just erase the whole thing
<samueldr> yep
<samueldr> looks like one of my SD cards
<samueldr> I think on mine there's music
<samueldr> frozen in time
<clever> i have heard rumors on the rpi forums, that you can somehow reset this with a camera
<samueldr> sounds unlikely
<samueldr> sounds like a good game of the ol' telephone
<samueldr> where someone relates something to someone else relating it
<clever> the claim is that the camera manufacturers know the secret handshake
<samueldr> and in the end the initial problem was something like "the sd card wasn't formatted right"
<clever> yeah, a common problem is that windows cant deal with partitioned sd cards
<clever> samueldr: what about the hostPlatform question further up?
<samueldr> no clue :)
<samueldr> I'd ask you
<clever> i'm still fuzzy on the details of how the cross-compiling works, despite adding an arch
ryantrinkle1 has quit [Ping timeout: 245 seconds]
Acou_Bass has quit [Quit: ZNC 1.8.2 - https://znc.in]