IRC channel logs

2021-04-16.log

back to list of logs

<bauen1>stikonas: your rootfs.py script is nice, but lacks some feedback (more on that tomorrow)
<stikonas>bauen1: oh, what kind of feedback?
<stikonas>if it wasn't present in rootfs.sh, it's not regression :)
<OriansJ`>well I got tests 000 to 009 working in mes-m2
<OriansJ`>So it isn't completely borked
<OriansJ`>test010 however is a bit of a problem because quasiquote isn't implemented in mes.c but I guess I'll deal with that later
<OriansJ`>(probably have to define a minimal boot.scm which provides quasiquote)
<OriansJ`>(or I'll have to port the C version of quasiquote that I previously wrote to mes-m2)
<OriansJ`>I guess cond isn't a primitive either, so guess I need to fix test017
<OriansJ`>or move load-module to test010 and write a cond definition in terms of if and stick to pure guile syntax for the remaining tests
<OriansJ`>although guile can't do (define (display n) (display n)); mes.c can so why do core:display when you can define display in terms of a more primitive display?
<OriansJ`>ok mes/module/mes/boot-02.scm loads just fine but mes/module/mes/boot-03.scm segfaults
<OriansJ`>ok boot-03.scm fixed by doing (primitive-load (open-input-file "/dev/stdin")) instead of (primitive-load 0)
<OriansJ`>or even just plain (primitive-load "/dev/stdin")
<OriansJ`>up to test017 working (except 10 of course)
<OriansJ`>So progress being made; just haven't figured out the cause of the segfault yet.
<OriansJ`>I guess I'll hammer more tomorrow (unless someone else spots the problem first)
<gforce_d11977>stikonas: fossy: i again simplified my PR: https://github.com/fosslinux/live-bootstrap/pull/104
<bauen1>stikonas[m]: so rootfs.sh was verbose and actually showed me what is was doing, the python one doesn't
<stikonas>bauen1: oh I see what you mean. Yes, we can add some more print() stagements to make things more verbose
<bauen1>also i've noticed that live-bootstrap has this odd dependency on env = { PATH="/bin" } ; not sure why
<stikonas>bauen1: chroot mode?
<stikonas>bauen1: this is known and fix is clear, I just didn't get to it yet
<stikonas>feel free to fix this
<stikonas>that's PATH=/bin is needed to find chroot binary
<stikonas>ideally we would run in empty environment with just env -i
<stikonas>so we need to find where chroot binary is located and use absolute path
<stikonas>rootfs.sh had similar problem
<stikonas>it was actaully running with even more poluted environment
<bauen1>stikonas: if you hardcode chroot path and remove the PATH= then the chroot and initial few steps of build will succeed but eventually kaem will terminate with failure during the early stages (long before bash)
<stikonas>hmm, that is strange...
<stikonas>because it runs just fine in qemu which clearly has no initial environment
<bauen1>stikonas: are you sure ?
<stikonas>bauen1: well, what would set the environment in qemu?
<stikonas>kaem-optional-seed is pid 1 there
<bauen1>i wouldn't be surprised if the kernel does it
<stikonas>at least on my current system environment of pid 1 is really small
<stikonas>TERM=linuxBOOT_IMAGE=/rootfs/boot/vmlinuz-5.10.27-gentoo-gnuintel_iommu=on
<stikonas>nothing that can affect bootstrap
<gforce_d11977>this is the output of kernel-5.11.15+busybox_as_PID1 and the output of 'env' + 'set': i think the PATH comes from busybox: https://paste.debian.net/1193968/
<bauen1>i'll look into what exactly went wrong
<stikonas>(my output was from cat /proc/1/environ but inside live-bootstrap /proc is not mounted)
<stikonas>with busybox you can mount it though
<gforce_d11977>stikonas: i have not compiled in /proc 8-))))
***pgreco_ is now known as pgreco
<stikonas>pder: maybe it's worth upstreaming your mes crt1 fix?
<dongcarl>In case you guys didn't see (riscv mescc can generate assembly, compile the minilibc, as well as a working ELF binary): https://twitter.com/orionwl/status/1382947841413414913
<dongcarl>All wumpus' doing
<vancz>beware the wumpus
<fitzsim>is anyone working on ppc64le support for mescc?
<fitzsim>Guix ppc64le support is making progress, which I was happy to see
<stikonas>hmm, riscv will probably be trickier in later bootstrap stages
<stikonas>(tcc, binutils-2.14, and gcc I guess don't support it)
<bauen1>tcc has some support for risc-v in mob
<bauen1>or you could do some x86-to-risc-v emulation layer up until you have a gcc that can cross compile to risc-v again
<bauen1>funny, i could work on a "risc-v to x86 transpiler for static binaries" this semester so maybe lol
<bauen1>wait no that's the wrong way around
<wumpus>yup i noticed that tcc has been adding riscv support (64 bit, the same i'm focusing on), agree gcc is likely going to be an obstacle; also thought of the x86 transpiler thing but thought it would be too circuitous, but if it is acceptable as a temporary solution at least, it seems more straightforward than porting fully fledged riscv support so far back
<bauen1>that's the nice thing about having all the pieces laid out in front of you: you now know where changes are necessary, and in the best case can optimise the bootstrap or change it to add new architectures more easily
<wumpus>absolutely!
<stikonas>wumpus: well, gcc 4 might be doable, it's not too old
<stikonas>although, probably still not easy
<wumpus>very likely less bad than 2.95, is the problem that tcc cannot compile it directly
<wumpus>i mean, gcc 4.x ?
<stikonas>wumpus: yes, gcc 4.x
<stikonas>wumpus: and tcc can compile it directly just fine
<stikonas>at least 4.0.4 is known to work
<stikonas>I've built 4.0.4 directly and with no pregenerated files
<stikonas>that means not using shipped configure, Makefile.in, config.h files, no bison/flex prebuilt files
<stikonas>wumpus: that's a rough representation of dependencies https://stikonas.eu/files/bootstrap/live-bootstrap.svg
<wumpus>oh perfect that's very enlightening
<stikonas>it's slightly out of date though, and was never 100% accurate
<stikonas>bottom of the graph has much better dependency arrows, but later, once autotools are used, it's probably quite inaccurate
<wumpus>understandable, it becomes so complex there
<stikonas>that's dot file https://github.com/oriansj/talk-notes/blob/master/live-bootstrap.dot
<bauen1>stikonas: if you want to improve the autotools part you can take a look at my add-gnu-stow branch that specifies the concrete version of autotools used in every script
<stikonas>hmm, I probably won't update that graph right now...
<stikonas>and I'm doing some refactoring at the bottom
<Hagfish>i've not kept track of all the great ideas being implemented right now
<Hagfish>is stow actively being pursued as something like a package/dependency manager?
<Hagfish>and what is the refactoring that's planned for the bottom steps in the graph?
<bauen1>yes
<bauen1>stow is my doing, current work is at https://github.com/bauen1/live-bootstrap/tree/add-gnu-stow
<Hagfish>cool, thank you
<bauen1>Hagfish: if you want to test something with stow i can also pr my commits that add stow and chroot to live-bootstrap
<Hagfish>i don't really have an environment for testing things, but i've enjoyed reading the diff
<Hagfish>nice use of the "local" keyword
<bauen1>oof i messed up rebase and now github thinks i've made all those commits by other people ...
<bauen1>well i'll be pushing a rebased onto latest master with rootfs.py momentarely
<Hagfish>what is rootfs.py for?
<bauen1>Hagfish: a replacement for rootfs.sh
<Hagfish>right
<Hagfish>it actually has some great comments in it too, thank you
<stikonas>Hagfish: rootfs.py is just because shell is not really ideal language for anything more complicated
<Hagfish>yeah, that's fair
<stikonas>for small scripts it might be very good
<stikonas>but once things start growing
<Hagfish>what version of python does it need?
<bauen1>stikonas: so i've reproduced the error, not sure if it's due to wrong user namespace / chroot setup, but `../bin/kaem --verbose --strict -f mescc-tools-full-kaem.kaem` exits with an error (without any additional output) when the env used to enter the chroot is empty
<Hagfish>at least v3, i see
<stikonas>Hagfish: not sure, I guess any recent 3.x would work
<stikonas>bauen1: hmm, so that's even in stage0-posix...
<stikonas>that's really early
<Hagfish>i was mostly wondering in terms of how "self-hosting" the repo is, even if that's not something that's needed in practice
<stikonas>well, we haven't bootstrapped python yet...
<stikonas>but in any case live-bootstrap system is not really ready yet
<Hagfish>python looks relatively sane in terms of bootstrapping
<stikonas>we just reached gcc (C only)
<stikonas>yeah, python should be almost buildable (might need to build some dependencies like openssl first)
<Hagfish>cool
<xentrac>yaay
<bauen1>alright, properly rebased now
<bauen1>let's actually test it then, see you in ~1-2h lol