IRC channel logs

2021-01-14.log

back to list of logs

<fossy>stikonas: are you using the makefile from the bzip2 project or no?
<fossy>because there is no makefile checked into that commit...
<stikonas>fossy: yes, bzip2 has makefile
<stikonas>it's a proper makefile
<stikonas>not autogenerated makefile
<stikonas>I even patched it a bit in that patch
<Hagfish>the LWN article has just come out of embargo, for those who didn't see it earlier: https://lwn.net/Articles/841797/
<fossy>stikonas: I see
<xentrac>thanks Hagfish!
<fossy>I will not do the same thing for bash despite it being handwritten, as bashs makefile is much too complex as it uses things like install
<fossy>and sh etc
<stikonas>yeah, we don't have install yet
<stikonas>fossy: I only build one target from that makefile in bzip2
<stikonas>well, there is also bzip2recover but we definitely don't need it for bootstrapping
<stikonas>fossy: did you mention make binary is also non-functional?
<stikonas>could it be the same problem as patch?
<fossy>it was
<fossy>i just fixed it I thini
<fossy>bbl need to go so something irl
<stikonas>sure :)
<stikonas>oh, bash doesn't have tar.bz2 file. Well, in that case bash and bzip2 can be in any order...
<stikonas>maybe it makes more sense to build bash first
<stikonas>and get out of after.kaem.run file
<vagrantc>weird, with mescc-tools 1.1.0 Kaem/test/test14/kaem.test fails amd64 and arm64 (i386 and armhf not yet tested) on the reproducible builds of debian test intrastructure: https://tests.reproducible-builds.org/debian/rb-pkg/unstable/arm64/mescc-tools.html but worked fine on debian's official build servers: https://buildd.debian.org/mescc-tools
<vagrantc>and of course, also worked for me when i uploaded, and several tests i've done now
<vagrantc>main difference that seems like it might be relevent is the user's shell... but i can't reproduce it by changing the user's shell on my local builds
<vagrantc>well, will have to follow up on mescc-tools another time ...
*vagrantc waves
<gforce_d11977>vagrantc: can you link to the build-fail/logfiles?
<bauen1>xentrac: yup, it works, i never really changed the irssi default keybindings
<xentrac>yaay
<fossy>jeez bash has a lot of files
<bauen1>and requires so many different syscalls
<bauen1>or rather libc functions
<xentrac>yeah
<stikonas[m]>fossy: how are you building bash?
<fossy>stikonas[m]: makefile
<stikonas>I think I'll use makefile too for m4...
<stikonas>are you going to push make build first to live-bootstrap?
<fossy>no i'll push it with bash
<fossy>are you doing m4 now?
<stikonas>later this evening
<fossy>coolcool
<stikonas>that's why I was wondering when make will be available :)
<siraben>fossy: would live-bootstrap work on macOS?
<gforce_de1977>siraben: at the moment i'am preparing am qemu-image for this task
<stikonas>siraben: in qemu?
<stikonas>it should
<gforce_de1977>(mainly for CI integration, e.g. a github action)
<stikonas>more interesting and known to fail would be arm bootstrap...
<gforce_de1977>stikonas: arm is ocourse an qemu-trget too
<siraben>fossy: macOS can run qemu as well
<siraben>yeah a github action would be nice
<stikonas>gforce_de1977: yeah, but I couldn't get any screen output on arm qemu...
<stikonas>I've recompiled my arm kernel with some driver but that diddn't help
<stikonas>for github action it might be simpler to use chroot build...
<stikonas>then we don't have nested virtualization
<stikonas>or maybe Docker container...
<stikonas>in CI we wouldn't have KVM so qemu would be really slow
<bauen1>stikonas: do you know if gitlab has KVM / nested virtualization for the public runners ?
<fossy>gforce_de1977: look at my pr... i have started ci
<stikonas>bauen1: nobody has
<stikonas>bauen1: at least nothing free
<stikonas>bauen1: on gitlab you can have you own runners, but then you need to host your own builder
<fossy>what?
<fossy>there is free gitlab ci
<gforce_de1977>nested virt is not needed, qemu can emulate all archs
<stikonas>fossy: yes, but it runs in VM already
<fossy>oh eyah
<stikonas>yes, qemu can but it will be quite slow
<fossy>gforce_de1977: nested virt is needed for it to run at any reasonable speed
<stikonas>because it's real emulation
<fossy>hence why if you look at my pr i am using cirrus ci
<fossy>because they officially support nested kvm
<stikonas>without kvm it's about 20 times slower
<stikonas>but maybe something more lightweight is enough for CI?
<stikonas>either chroot or docker
<fossy>well now that we have chroot mode i'll adapt it to use that
<stikonas>those are widely available
<fossy>anyway make is working welll so i will push it
<stikonas>ok, nice!
<fossy>pushed
<fossy>also, FWIW, stikonas this is my current bash makefile, if you want to draw inspiration at all
<fossy> https://ttm.sh/dMc.txt
<stikonas>sure, thanks
<stikonas>ok, makes sense
<stikonas>m4 will be quite a bit shorter
<fossy>^-^ i should hope so, lol
<fossy>Hm, does anyone remember who boootstrap bison
<stikonas>fossy: maybe you can have simpler list for all those objects and append extention/folder using make functions?
<stikonas>so then you just have a list of files
<stikonas>anyway, i'll try that with m4 first
<stikonas>hmm, bison is used by gcc?
<stikonas>or is it also needed by autotools
<stikonas> https://gitlab.com/giomasce/bison-bootstrap
<stikonas>so gio solved it
<fossy>stikonas: no curently unrelated to live-bootstrap, just wondering who did it
<fossy>stikonas: plan to get to that at some point, but wasn't bothered at the time of making the list
<fossy>if you come up with something for m4 i'll apply that
<fossy>otherwise i'll make my own make rule for that
<stikonas>fossy: yeah, I'll try to write something this evening before you wake up
<fossy>grr. bison depends on flex which uses bison to generate something else :(
<stikonas>well, I guess that's why gio write his code...
<stikonas>well, autotools is the same...
<stikonas>they depend on autotools to build
<gio>stikonas: You can build bison without autotools, manually calling gcc.
<gio>It's not beautiful, but you can do it.
<stikonas>gio: we'll have autotools before
<gio>Ok, great.
<stikonas>we we manually calling tcc for evrything up to now, but we have now bootstrapped make
<stikonas>so now it's manual makefiles
<stikonas>which is a bit more powerful
<gio>Same thing I did for nbs: https://gitlab.com/giomasce/nbs/
<fossy>gio: your statement that "it is possible
<fossy>to compile Flex without using Bison
<fossy>"
<fossy>is not true unless you use a pregenerated file
<fossy>as per included with a source distribution
<gio>I do that in nbs, using stuff from the Heirloom project.
<gio>It requires some more steps, but it can be done.
<gio>See the README: https://gitlab.com/giomasce/nbs/
<fossy>hm, heirloom project.....
<gio>In nbs only binary stuff available at the beginning is tinycc and musl. Everything else cames in source form, unless something slipped though. Let me know if you see anything autogenerated in nbs.
<fossy>this looks quite useful
<gio>It definitely is.
<fossy>i'm working on something similar and stikonas has provided a lot of help, https://github.com/fosslinux/live-bootstrap, readme is in progress
<stikonas>gio: so we only have any posix kernel (for now linux), hex0 (357 bytes) and kaem shell (753 bytes)
<gio>Hairloom might probably give you a lot of shortcuts.
<fossy>yeah.
<stikonas>and this point we have tcc/tar/gzip/make/diff/patch/sed
<gio>What is your first compiler?
<stikonas>gio: hex0
<fossy>um
<fossy>well yeah
<gio>What is your first real compiler?
<fossy>if you call hex0 a compiler
<stikonas>cc_x86?
<fossy>M2-Planet? mescc?
<stikonas>I guess
<fossy>tcc?
<stikonas>well, tcc is first fairly powerful compiler
<gio>In other words, what do you "compile" with hex0?
<fossy>gio: well it just goes through mescc-tools-seed to start off with
<stikonas>another hex assembler: hex1, then hex2, then cc_x86
<stikonas>cc_x86 then builds M-2 Planet which is the first compiler in C
<stikonas>cc_x86 is C compiler in hex2 assembly
<fossy>then it uses janneke's wip-m2 of GNU Mes to compile Mes using M2-Planet, then uses MesCC to compile TinyCC and then we move on
<gio>So, you consider this to be source code? https://github.com/oriansj/mescc-tools-seed/blob/0e6d8d6d3f261b550af1768b767f66b30fd07854/x86/cc_x86.M1
<fossy>yes
<fossy>it was hand written
<fossy>abliet hard to read without appropriate background, but that's low-level assembly
<stikonas>and fairly well commented
<gio>Ok, I think I still prefer my path through asmg.
<fossy>yeah i like asmg a lot too
<fossy>asmc*
<rain1>same!
<rain1>it's absolutely amazing!
<gio>(not to dismiss your effort, of course, everything is good; it's just that I don't completely agree your count of 357+753, as it leaves out a lot of other not-really-easy-to-check stuff)
<fossy>oh, of course
<fossy>the linux kernel is much too large for an end project
<fossy>i kinda want to implement asmc as an alternative starting point
<fossy>because it is "around 15KB"
<fossy>and M1/M0/hex* is not all that easy to verify
<rain1>that's a great idea
<gio>I believe that Linux kernel would not be far from the reach from asmg, it I had time to spend on that. And maybe eventually I will have some, but not now.
<gio>Linux is not that complicated; there are some linker shenanigans and some assembler syntax that tcc doesn't handle, but that's all.
<fossy>gio: theoretically, it would be possible to run asmc from a floppy right?
<gio>It's possible, depends on whether you can fit the source code it needs on it. Eventually it boots iPXE, so at that point it can fetch further code from the network.
<fossy>is that required?
<fossy>(iPXE)?
<gio>Not necessarily; for the moment it is the most Linux-like thing it is able to compile, and it was basically an exercise for me to show that something Linux-like could be compiled at boot time, without directly attacking Linux.
<fossy>right, i see
<gio>If you manage to compile Linux-with-network (hard) and a stupid HTTP client (easy), you don't really care for iPXE.
<gio>So if you can pack asmg (very little), the C compiler in G (quite little), tinycc and enough of Linux source code on a floppy, there you are.
<fossy>yea
<stikonas>well, if we can compile linux without network, and have a bit more space, we can easily compile linux with network
<gio>So far I did my experiments with hard disks, but it doesn't change much.
<stikonas>and I don't have floppy drive at home...
<gio>stikonas: Yes, the hard part is Linux itself. Especially the linking and loading part.
<fossy>gio, afaict, asmc does not have a libc involved, is this true?
<gio>There is actually nothing intrinsically difficult, it's just a few linker magic that you have to unwind and implement your way.
<gio>fossy: No, it doesn't.
<fossy>cool
<stikonas>well, you only need libc one you have kernel
<stikonas>and even then you can do syscalls directly...
<stikonas>we can definitly look at this once we are done with curent live-bootstrap
<gio>stikonas: Yes, although at some point you'll want to have an actual libc anyway, and that might be a tad more difficult (unless you've already solved this with live-bootstrap).
<fossy>Mes LibC is what we currently use
<gio>Once you have tinycc and musl, you can start back from nbs, in my plans.
<stikonas>we didn't get musl yet...
<gio>Or from live-bootstrap if you can join there.
<fossy> https://gitlab.com/janneke/mes/-/tree/master/lib
<stikonas>might go for glibc directly
<gio>Yeah, libc's are hard...
<gio>I find them hader than kernels.
<fossy>kinda following guix's bootstrpaping route to a full toolchain in live bootstrap rn but filling in holes like autotools
<gio>*harder
<stikonas>musl is probably possible but need some patching to build with tcc
<stikonas>and holes like smaller driver
<stikonas>guix is now using 50 MB driver to drive 357 byte hex0
<gio>What is a driver here?
<stikonas>gio: guile
<stikonas>it's scripting engine
<gio>Ok.
<stikonas>I mean like bash
<stikonas>something to automate bootstrap
<stikonas>(drives the whole thing)
<stikonas>not driver as in hardware driver
<stikonas>so in guix guile prepares build environment and also runs some tools (gash, bootar, etc)
<stikonas>we don't have that in live-bootstrap
<stikonas>although, tar is already done, and bash is almost done
<civodul>stikonas: that's a temporary situation though
<civodul>(plus nobody's done any better, right? :-))
<stikonas>civodul: well, our live-bootstrap will be doing better, but if you talk about distros, then yes
<stikonas>no distro is doing better than guix
<civodul>nice, i didn't know about live-bootstrap
<civodul>reminds me of an experiment we did at the RB summit last year: https://guix.gnu.org/en/blog/2019/reproducible-builds-summit-5th-edition/ (under "Extreme Bootstrapping")
<civodul>we didn't pursue it, but the idea was to "unfold" the operations normally performed by the Guix build daemon & co.
<civodul>so you would boot a system that starts building from scratch the package graph
<bauen1>in theory every distribution should be interested in bootstrapping, if only as a way of breaking cyclic dependencies that are annoying to deal with
<civodul>yeah
<bauen1>is there maybe some more up-to date information on debian bootstrapping than https://wiki.debian.org/DebianBootstrap ?
<stikonas>civodul: yeah, for now we use linux kernel, hex0 and kaem
<stikonas>so a bit lower level than guix-daemon
<pabs3>bauen1: this is probably a better link https://wiki.debian.org/HelmutGrohne/rebootstrap
<pabs3>(CI for cross-bootstrap stuff)
<gforce_de1977>
<bauen1>pabs3: thanks
<janneke>stikonas: the guile-2.0 driver is much smaller than 50MB (although still huge0
<janneke>du -sh $(guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)')
<janneke>14M /gnu/store/lgi9x15a0w35mcpd7g1kb9274r6wy4pv-guile-bootstrap-2.0
<stikonas>yeah, I guess I didn't remember it correctly...
<stikonas>I thought guile is the biggest part of current reduced bootstrap (which is guile + mes) which is about 60MB...
<stikonas>(according to https://guix.gnu.org/manual/en/html_node/Reduced-Binary-Seed-Bootstrap.html)
<janneke>stikonas: that's right, i assumed we were talking about the full source bootstrap:
<janneke> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm?h=wip-full-source-bootstrap
<stikonas>oh, it's smaller there?
<janneke>i.e., where mes' wip-m2 branch was first shown to be feasible for the bootstrap
<stikonas>well, you know these things better :)
<janneke>stikonas: didn't you catch that i managed to build mes (wip-m2 branch) with m2-planet?
<stikonas>janneke: no, this I understand
<janneke>people are now trying to reproduce outside of guix too
<stikonas>I was confused by other things
<stikonas>janneke: oh yeah, that's what I'm doing
<janneke>ok
<stikonas>with fossy
<janneke>right
<stikonas>janneke: so we have a fairly good progress now
<stikonas>last thing built is now make
<janneke>nice, that's progress
<janneke>then you probably already have gzip
<stikonas>yeah, and we are not using pregenerated scripts like configure,
<stikonas>yes, gzip , tar
<stikonas>sed, diff
<stikonas>patch too
<stikonas>bzip2 almost done
<stikonas>and fossy is working on bash
<stikonas>we don't have any of the gash or bootar like guix does
<stikonas>but we won't need them
<janneke>good
<stikonas>they don't seem to run on mes and require guile
<stikonas>after bash we need to bootstrap autotools (m4/autoconf/automake) I guess...
<stikonas>possibly perl
<janneke>that's right, running gash, gash-utils on mes is one possible future path
<stikonas>well, we just wrote enough kaem scripts to build what we need
<stikonas>(inclusing mes)
<janneke>very nice
<stikonas>e.g. for mes we ran this https://github.com/fosslinux/live-bootstrap/blob/master/sysa/mes.kaem
<stikonas>well, no more kaem scripts from now on, since we now have make
<stikonas>janneke: by the way, we managed to build sed 4.0.7 instead of very old 1.18 that is used in your branch
<stikonas>janneke: 1.18 was of no use for us, had to build at least v4
<stikonas>(without gash we needed -i flag in sed for in place editing)
<janneke>stikonas: oh, that's nice; i'll have a look
<janneke>i was hoping we can gradually get rid of most ancient softwares
<stikonas>this is how we built sed https://github.com/fosslinux/live-bootstrap/blob/master/sysa/sed-4.0.7.kaem
<stikonas>and 4.0.7 is probably not the limit
<stikonas>I just picked something > 4
<janneke>i don't remember why that didn't work at the time, could be need for a newer awk, or bash
<stikonas>could be, we don't use bash though...
<stikonas>we just wrote our own build script
<janneke>right, going around the problem altogether
<stikonas>(since bash is no available for us yet when we build sed)
<janneke>i wanted to use guix's gnu-build-system as much as possible initially
<stikonas>(we use sed for early patching of other software)
<fitzsim> xeww
<janneke>that makes sense
<stikonas>janneke: yeah, but in live-bootstrap we dont' have gnu-build-system, we need to bootstrap our build systems...
<janneke>sure
<stikonas>and building patch also needed some patching :)
<stikonas>so we used sed
<janneke>yes, iwbn to get a series of "bootstrappable" releases that don't need patching
<janneke>could be a next step, someday
<stikonas>well, most of the patching is very light
<stikonas>and much smaller than rewriting build scripts :)
<civodul>stikonas: philosophical question: to what extent can https://github.com/fosslinux/live-bootstrap/blob/master/sysa/mes.kaem be considered "source"? :-)
<stikonas>civodul: it's handwritten
<stikonas>civodul: so if we say that handwritten things are source, then to full extent
<stikonas>but yes, it's a lot of copy-pasting...
<stikonas>since we can't do any advanced stuff in kaem...
<stikonas>civodul: well, hex0/1/2 are even less "source", but they are also handwritten
<stikonas>in any case, mes.kaem is basically a list of files to compile
<stikonas>we run the same command over and over again
<civodul>stikonas: i thought this shell scripts were automatically-unrolled makefiles
<civodul>*these
<civodul>(to me, "source" is the "preferred form for making modifications to it", as the GPL puts it)
<stikonas>not really automatically... although I did look make output :)
<stikonas>well, I was making modifications to this file, not some makefile and run script on it
<stikonas>so I guess it satisfies GPL definition of source
<civodul>yeah
<civodul>though the form we really "prefer" is the original makefile (or similar)
<civodul>but i guess that's always the case, we always "prefer" the higher-level thing
<civodul>tricky concepts :-)
<stikonas>yeah, people also prefer "configure" files even though that's definitely not preferred form for modifications
<civodul>i meant "prefer" as in "prefer to make modifications"
<civodul>configure files are definitely not "preferred" in that sense :-)
<stikonas>gforce_de1977: remember that asterisk that I got wrong inside quotation mark
<stikonas>you and fossy moved it outside
<stikonas>it's still wrong!
<stikonas>shell scripting is so easy to get wrong :(
<gforce_de1977>stikonas: i send the proposal: for FILE in foo/${var}.*; do test -f "$FILE" && ...; done
<stikonas>yeah, that's what I have now in my commit queue too
<gforce_de1977>stikonas: fossy: finally my arm-qemu-setup-CI-runner is ready, i'am tired now and will send the pullrequest tomorrow. I also had to fight with arm to output text 8-)))
<stikonas>gforce_de1977: oh, you managed to solve it, nice!
<gforce_de1977>stikonas: fossy: because of the asterisk: will send the PR also tomorrow morning
<gforce_de1977>stikonas: arm is really tricky..., but now the way to aarch64 is also clear...
<fossy>arm?
<fossy>how will live bootstrap work on arm
<fossy>janneke: whats the total seed size inc guile for full source bootstrap?
<janneke>fossy: %bootstrap-guile is 14Mb, and hex0 is 357 bytes, oh and we have kaem ;-)
<stikonas>so I'm still confused why older reduced bootstrap is 60 MB. Didn't it have just guile and mes?
<stikonas>fossy: I have a few patches to review while I'm working on m4
<stikonas>fossy: I've built bzip2 (with some patching to patch out dependencies on bash and coreutils)
<fossy>janneke: i see
<stikonas>in principle bash we'll soon have...
<janneke>stikonas i believe that was calculated when we aimed to switch to guile-2.2, so that number is over-estimated
<fossy>yep
<stikonas>but it's just a test
<stikonas>oh I see... my confusion is finally resolved :)
<janneke>bootstrap-mes and bootstrap-mescc-tools are about 12MB
<stikonas>fossy: https://github.com/fosslinux/live-bootstrap/pull/11
<stikonas>ok, so you'll go down from 26 MB to 12MB
<janneke>we aimed to halve the size of the bootstrap twice and that sort of worked
<stikonas>indeed
<stikonas>that's an order of magnitude better than anybody else already
<fossy>hm, stikonas, i think that i still prefer doing patch/make/install/test in a kaem subfile, even if we are only doing make
<fossy>otherwise after.kaem.run will get very long very fast
<stikonas>fossy: oh I see
<stikonas>fossy: I thought we'll call after.sh file soon
<stikonas>and work there
<fossy>stikonas: we will but consistency
<stikonas>anyway, I can split it out
<fossy>i think i still prefer splitting it out
<stikonas>and what about roofs.sh changes?
<fossy>well, only issue is that if someone ctrl-c's in the middle of a download then it will use a corrupted source code tarball
<fossy>but does significantly reduce time..
<stikonas>yeah...
<stikonas>and load on servers...
<fossy>yeah, it's fine
<stikonas>fossy: ok, pushed new change with split out file, will test it now
<stikonas>although, it's a trivial change...
<stikonas>nothing ever breaks on trivial changes /s
<fossy>well we should keep all of the tar/gunzip/cd's outside or all inside
<stikonas>hmm, ok, maybe outside then...
<fossy>yeah
<fossy>but keep the make inside
<bauen1>shouldn't the downloaded files be compared to a checksum ?
<stikonas>and patches?
<fossy>inside
<stikonas>ok
<fossy>as per make, the patch dosen't have any prefix on the file
<fossy>bauen1: yes, they should
<stikonas>yeah, I agree that we should do checksum
<stikonas>and only skip download if it succeeds
<stikonas>probably as part of that get_file function
<fossy>yeah
<stikonas>first argument url, second checksum
<fossy>and rm it if it dosen't match
<stikonas>bauen1: I think you just volunteered to make a patch :D
<fossy>:P you don't have to bauen1
<stikonas>anyway, if bauen1 doesn't do that I can do it (maybe tomorrow)
<stikonas>first want to finish m4
<stikonas>need to get the right defines for CFLAGS there...
<bauen1>stikonas: i haven't tried live-bootstrap yet, so you should do it
<bauen1>stikonas: i'll be sure to add :+1: on the merge request though :p
<stikonas>fossy: this is my makefile for m4 (still need to test in live environment) https://stikonas.eu/files/Makefile.txt
<fossy>stikonas: if you look at your bzip2 PR you'll see what i want you to do to make the blocks consistent
<stikonas>ok, let me check, I haven't looked on GH
<fossy>stikonas: ahh, very nice manipulation with addprefix/suffix
<fossy>is there a need to redefine %.o: %.c? it's fine if there is but just interested
<stikonas>oh, maybe not
<stikonas>actually, I don't even define INCLUDE_DIRS
<stikonas>and no clean target until we get coreutils :(
<stikonas>but I think by then we'll have autotools
<stikonas>ok, it works even without .o -> .c rule
<stikonas>anyway, I'll try to test in live-environment too now
<fossy>stikonas: remember we need to do coreutils pre autotools
<fossy>because configure sripts use coreutils
<stikonas>oh ok...
<stikonas>well, m4 didn't use anything
<stikonas>well, probably autotools can be compiled but I guess can't run configure
<stikonas>so yeah, need at least some coreutils
<stikonas>do you know which tools we need?
<stikonas>hmm, probaly try to build as many as possible...
<stikonas>they are useful tools...
<stikonas>strange, how did guix handle this?
<stikonas>oh, I guess via gash-utils
<stikonas>hmm, I wonder if we need to build perl before autotools
<stikonas>I think for autoconf we can do without it
<stikonas>hmm, but automake needs perl...
<fossy>stikonas: we do need perl
<fossy>stikonas: a patch series i did last year: https://github.com/fosslinux/coreutils-5.0/commits/master