IRC channel logs

2021-02-28.log

back to list of logs

<OriansJ`>The closer you get to GCC, the more LFS documentation becomes a better and better reference.
<OriansJ`>Although I wonder if the LFS community might be interested in a FULL bootstrap book
<stikonas>well, we basically have everything to build gcc now (once we merge what we have in local git repos)
<stikonas>well, maybe some minor things will be needed...
<stikonas>but tcc with binutils and musl should be quite good
<stikonas>and once we have gcc, like you say, it's just LFS
<OriansJ`>with a very aggressive root of trust.
<stikonas>yeah, stage0 + kernel...
<stikonas>although, it might be that binutils will introduce some non-reproducibility...
<stikonas>well that can hopefully be patched
<Hagfish>i like the idea of "linux from scratch from scratch" :)
<Hagfish>i also think that each distro should create an appendix to LFS which documents how to build an ISO image of their minimal install image
<Hagfish>apparently a debian install image is "generally 150-300 MB"
<Hagfish>it should be possible to build that image from source, bit for bit, from an LFS system
<Hagfish>stikonas: i love the dedicated "parts" page here: https://github.com/stikonas/live-bootstrap/blob/master/parts.rst#36perl-5005_03
<Hagfish>i think there is a contradiction, though: "This is the last version buildable with 5.004." vs "5.6.2 is the last version buildable with 5.004."
<stikonas>Hagfish: oh, should be 5.005 there
<stikonas>I think you have just volunteered to do a PR
<Hagfish>i want to say i don't have an account, but it's more true to say that i shouldn't use my work account
<Hagfish>i could download the file and create a diff for you, if that would be acceptable :)
<stikonas>well, in that case maybe I'll fix it...
<Hagfish>i'm happy for you to receive the credit for that epic patch :)
<stikonas>ok, sneaked it into autoconf PR...
<pabs3>Hagfish: I would have thought distro ISO images would require tools from the distro, so the path to build the ISO should be hex0 -> distro build-essential -> ISO build-deps -> ISO
<pabs3>for Debian, the debian-cd package is how the ISOs are built
<stikonas>and for binary distros the point is moot anyway
<stikonas>if they don't switch to bootstrapping
<Hagfish>pabs3: yeah, i guess there are 2 complementary philosophies: distros should be self-hosting, and also the distro's build essentials should be buildable from the simplest possible binaries
<pabs3>Debian already has a cross-bootstrapping project, so I think would be amenable to full bootstrap
<pabs3>agreed Hagfish
<stikonas>and self-hosting in reproducible way
<stikonas>then there is at least hope of reproducing exactly the same binaries
<Hagfish>in the back of my mind i have this worry that trying to build, say, the Debian package of gcc, or the kernel, from an LFS system will fail in some subtle way because the system isn't "Debian" enough
<stikonas>well, official packages are built in Debian chroot...
*pabs3 would like to see hex0 etc in every Debian apt mirror so you could bootstrap Debian solely from a source-only apt mirror
<Hagfish>that would be amazing
<Hagfish>stikonas: i don't think it's documented how to build a Debian chroot from source on a non-debian system, right?
<Hagfish>i guess you are supposed to run debootstrap or something, in a Debian machine?
<pabs3>debootstrap doesn't require Debian machines and is available in Fedora/etc
<Hagfish>wow, nice
<stikonas>debootstrap runs anywhere, but it downloads binary debian packages
<Hagfish>hmm, tricky
<pabs3>its very hacky though, it hardcodes ordering information, the apt/dpkg folks are working on a spec to eliminate that
<pabs3> (https://wiki.debian.org/Teams/Dpkg/Spec/InstallBootstrap)
<Hagfish>maybe there needs to be a debootstrapbootstrap which downloads the debian source package and turns them into binaries using the non-debian host system
<pabs3>but yes, getting from LFS to the first .deb would be the hard bit, I think Daniel Schepler has been doing work on that
<Hagfish> https://packages.debian.org/buster/mmdebstrap "is bit-by-bit reproducible if $SOURCE_DATE_EPOCH is set"
<pabs3>that uses .debs too
<Hagfish>thinks keep moving in the right direction, though, i'm pleased to see
<stikonas>that's why I was thinking we should first pick easier targets...
<pabs3>some links to the cross-bootstrap stuff: https://wiki.debian.org/HelmutGrohne/rebootstrap https://wiki.debian.org/DebianBootstrap
<Hagfish>stikonas: something intermediate between LFS and Debian?
<stikonas>source based distros rae probably as easy as it can get...
<stikonas>Hagfish: yeah, like Gentoo
<Hagfish>that makes sense
<pabs3>what is the status of hex0 -> GuixSD?
<stikonas>hmm, not sure if we can produce guix bootstrap binaries...
<stikonas>and guile also has some bootstrap problems if I recall correctly
<stikonas>(pp_syntax or something like that)
<stikonas>somebody here was working on it
<fossy>stikonas: what do we need 2.13 for
<fossy>stikonas: and there are no binary or binary like files for any of these yeah?
<stikonas>fossy: 2.13 and 2.12 is needed for binutils
<fossy>odd, two different versions lol
<stikonas>fossy: no, those are just scripts
<fossy>cool
<stikonas>original binutils configure scripts are done with mix of 2.13 and 2.12.1
<fossy>and none are generated by the build system? (I mean fully, not trivial sed)
<fossy>scary :p
<stikonas>fossy: well, autoconf automake and friends are produced
<stikonas>but it's just plaholder replacements
<stikonas>that can be done with sed
<fossy>yeah, like seds, thats fine
<fossy>Ok ill merge
<fossy>Acrually ill wait a couple for the ci
<stikonas>yeah, that's fine...
<fossy>Cause its nearly done
<stikonas>testing binutils now...
<stikonas> https://github.com/stikonas/live-bootstrap/blob/binutils-wip/sysa/binutils-2.14/binutils-2.14.sh
<stikonas>(can start reviewing)
<stikonas>fossy: it might need more work to make binutils create reproducible executables, in case they insert time or date...
<stikonas>but I think we can at least build them first and then iterate from there
<stikonas>and binutils 2.14 seems the be the limit for tcc...
<stikonas>2.15 was complaining...
<Hagfish> https://sources.debian.org/src/debootstrap/1.0.123/scripts/debian-common/ recreating that without using apt/dpkg doesn't look any harder than what live-bootstrap does
<Hagfish>(although i say that based on my ignorance of the details of both processes)
<stikonas>well, maybe at some point later in live-bootstrap we can have distro "plugins"
<stikonas>where live-bootstrap branches to bootstrap chosen distro
<fossy>that is basically my plan from the start
<fossy>;)
<fossy>kexec-tools goddamnit
<fossy>why does ur tar file have to use all these gnu extensions which we dont yet support
<stikonas>well, some other tar files also used them but those were optional
<stikonas>so just unnecessary file in extracted dir
<stikonas>in the worse case we can repack tar...
<fossy>stikonas: yeah, these are key source files :|
<fossy>however, the git snapshot is fine
<fossy>so i'll use that
<stikonas>ok, binutils were successfully built
<stikonas>now I need to get checksums done...
<fossy>wow, that was fast!
<stikonas>well, we now have autotools
<stikonas>so no need to write build system...
<stikonas>fossy: although, I suspect some of them might have problems with reproducibility
<stikonas>but we'll see
<stikonas>fossy: maybe merge autotools?
<stikonas>then I'll rebase on top of it and make PR for reviewing
<fossy>stikonas: yep, merged, ygot that tick
<fossy>stikonas: also, gentoo bootstrap is trivial (although slightly messy);
<fossy>you just have to use gentoo prefix
<fossy>create a prefix, ./bootstrap-prefix.sh, then use the prefix to create a stage3 and extract that in a real root
<fossy>alterntaively we can attempt to use catalyst
<stikonas>yeah, either of those should work...
<fossy>well catalyst does need a seed tarball
<fossy>but one can probably use a prefix tarballed as the seed
<stikonas>fossy: https://github.com/fosslinux/live-bootstrap/pull/54
<stikonas>(probably not for merging today)
<stikonas>hopefully tomorrow
<fossy>identation is off in the for loops
<stikonas>oh, emacs again..
<fossy>where does pder deserve attribution?
<fossy>(anywhere?)
<stikonas>can't see tabs vs spaces there...
<fossy>its only one space..
<stikonas>fossy: pder wrote configure command and those alloca hacks
<fossy>oh
<fossy>i see
<stikonas>well, first commit is his
<stikonas>(I am committer because I did rebase)
<fossy>yeah could you add pder to SPDX-FileCopyrightText
<stikonas>oh didn't he add?
<stikonas>I will then
<fossy>nope, not in binutils-2.14.sh
<stikonas>hmm, indeed
<stikonas>I'll fix that
<fossy>hm, i am seeing a .y file
<fossy>oh
<fossy>we rebuild those
<fossy>nvm
<stikonas>yeah, I think not all are used
<stikonas>there was also some problem there
<stikonas>which i workarounded
<fossy>i assume the touch command makes them be regenerated?
<stikonas>touch should be enough
<fossy>and the absence of the files
<stikonas>well, there are .c and .h files
<stikonas>in principle touch should be enough even without removing
<stikonas>because date will be newer
<stikonas>fossy: maybe you can also clean up some old branches?
<stikonas>number of branches in the main repo is getting quite large
<fossy>stikonas: oops, yeah
<stikonas>and what about those 4 sed lines. I guess they are acceptable?
<stikonas>in binutils-2.14.sh
<fossy>they are fine
<fossy>the TODO makes it even finer
<stikonas>yeah...
<stikonas>we have used similar hacks in other places
<fossy>stikonas: also, your checksums need full paths, preferably
<stikonas>oh, yeah...
<stikonas>probably this will fail...
<stikonas>I'm still running local test
<stikonas>which will finish in a minute
<stikonas>fossy: hmm, looks like the build is not fully reproducible
<fossy>which binaries?
<stikonas> /after/bin/as: FAILED and /after/bin/objdump: FAILED
<stikonas>rest are OK
<fossy>diffoscope time :D
<stikonas>well, I'll push full path change for now to checksums
<fossy>ok, i'll pull and test also
<stikonas>yeah, if you can find what's wrong...
<fossy>yeah i'll try
<stikonas>ok, pushed
<fossy>thanks
<stikonas>fossy: oh, I'm missing a few other files
<stikonas> /after/lib/libintl.a
<stikonas>and /after/lib/libiberty.a
<stikonas>there is also /after/lib/libopcodes.{a,la}
<stikonas>and /after/lib/libbfd.a
<stikonas>yeah, I think that's it
<stikonas>I'll checksum those tomorrow...
<stikonas>since those might be failing too
<stikonas>enough for today anyway
<stikonas>autotools done and binutils mostly done
<Hagfish>incredible work again
<Hagfish>if there were a way of trading shares in developers, i'd be fully invested in stonksinas
<Hagfish>well, i'd have a portfolio consisting of all the developers here :)
<OriansJ`>Hagfish: there is a way of trading shares in developers. It is called a vested co-op.
<OriansJ`>or MacArthur style grants
<OriansJ`>or for those more sports minded: fantasy software development
<OriansJ`>in mescc-tools news; debug for ppc64le is now working
<plasma41>Recursively vendored libraries are driving me nuts. All I wanted to do was play the new release of 0AD after making sure I could properly compile it using only system libraries.
<fossy>hooray ppc64le
<fossy>plasma41: i know right, i hate them
*fossy shakes fist at go and rust
<plasma41>fossy: I haven't even gotten to the flying circus that is Spidermonkey yet. I'm still only wrestling with premake.
<plasma41>premake5 comes bundled with curl, libzip, lua, mbedtls, zlib.
<plasma41>I'm using Devuan, which doesn't have premake5 packaged yet, so as a starting point I took a look at the Guix premake5 package definition. What I found was that Guix just uses the bundled libraries instead of properly bootstrapping them. (╯°□°)╯︵ ┻━┻
<plasma41>Reproducible != Bootstrappable
<OriansJ`>well yes, Guix cheats alot because it is less work for them.
<OriansJ`>But when we unpack all that shit for them and wrap it up nicely for them, they will use it.
<plasma41>OriansJ`: Which is really sad to see when at the same time by contrast Guix provides a full bootstrap chain for the ouroboros that is rust.
<OriansJ`>plasma41: where do you think that bootstrap chain came from? Developers here did al the leg work. Because if it wasn't for us, it would be just like the GHC situation in Guix. Just one big fat binary blob
<OriansJ`>Same for Java
<plasma41>Indeed, and I'm trying to unwind the madness, but it's so frustrating when I just keep finding layer upon layer.
<OriansJ`>all of the Guix developers who care about bootstrapping are here.
<OriansJ`>and sadly, we are outnumbered by those who just want their toy or app or feature.
<OriansJ`>So there is eternally churn to keep things bootstrappable
<plasma41>OriansJ`: Don't get me wrong, I fully credit you and janneke and fossy and the others in this channel for Guix being at the level of bootrappability that it is. Y'all have done and continue to do amazing work
<OriansJ`>plasma41: and I am sorry that despite everything we are slowly getting further behind.
<OriansJ`>substitues are too easy of a default and hide all of these bootstrapping details from guix users.
<OriansJ`>So most guix developers skip bootstrap chain work that would have been easy but instead punt it to those of us who care and I am sorry that you are stuck working on it plasma41. I just hope you upstream the work into Guix so that others don't deal with that same pain too.
<plasma41>It's just a bit disheartening to look in Guix and see amazing achievements in bootstrapping like Rust, Java, and Haskell right next to packages like fpc (Free Pascal) and premake5.
<fossy>plasma41: bundled binaries, or bundled source?
<OriansJ`>fossy: bundled binaries
<fossy>that is disgusting
<fossy>:P
<OriansJ`>and more frequently "generated source"
<fossy>bundled source gets me annoyed slightly but bundled binaries make me very annoyed
<fossy>plasma41: free pascal is very hard
<OriansJ`>which honestly shouldn't even be called source
<plasma41>fossy: bundled sources in premake; bundled binaries in fpc
<fossy>plasma41: someone here was looking into pascal
<fossy>the best route seems to be to go back to the good old days of GCC Pascal
<fossy>and attemtp that to bootstrap fpc
<fossy>OriansJ`: i agree 100% on generated source
<OriansJ`>I vote we call "generated source" cheat-blobs
<fossy>aye
<plasma41>Regenerating generated source is far too often much less straightforward than it should be.
<OriansJ`>plasma41: especially because sometimes it doesn't actually correspond with the cheat-blob at all
<plasma41>Generated then hand-edited. :-/
<OriansJ`>or generated years ago and never updated to match the "source code"
<OriansJ`>or generated based on source that isn't included at all
<OriansJ`>or generated from malicious sources that are never shown but we are told it matches these sources over here
<OriansJ`>only for us to later discover: that too was a lie
<plasma41>"It's reproducible though. I can use the cp command to prove it." /s
<Hagfish>OriansJ`: perhaps there is a term like "compiler larping", based on your funny comment from before
<OriansJ`>plasma41: or It's reproducible (on my system) because we just copy the system copy of GCC
<OriansJ`>Hagfish: well traditionally the phrase around here would be: Blowing smoke out of one ass. In regards to pretending to do something you are actually not.
<OriansJ`>^one^one's^
<OriansJ`>But somehow I don't see that as being catchy enough
<Hagfish>it would be nicer to have a one-word term to describe the fakeness of other approaches, which is why i liked your choice of "larping" so much
<Hagfish>i don't want to get political, but there are terms like "alternative facts" and "fake news" and "sharpiegate"
<Hagfish>perhaps "kayfabe" is applicable
<OriansJ`>Hagfish: how about phantom-code
<OriansJ`>bootstrap-bunk
<OriansJ`>binary-bull
<OriansJ`>Jabberwocky
<OriansJ`>Logorrhoea
<OriansJ`>software-herpes
<OriansJ`>developer kipple
<OriansJ`>it does kinda match the definition of kipple: http://technovelgy.com/ct/content.asp?Bnum=128
<Hagfish>i hadn't heard of "kipple" before
<Hagfish>"phantom code" kinda works, because you're not sure whether the source code really exists or not
<Hagfish>schrodingsource?
<Hagfish>i'm trying to think of a type of monster that convinces you to trust it, and then reveals it was never really there, or something
<Hagfish>like a shapeshifter, or a mimic
<Hagfish>maybe "chort-code": https://en.wikipedia.org/wiki/Chort
<Hagfish>" Čert is trying to bring evil characters to hell, he often helps or befriends heroes in this process and gives them various magical items and treasures. "
***efraim_ is now known as efraim
***mephista is now known as spicy_icecream
***terpri_ is now known as terpri
<stikonas>fossy: oh, that objdump and as non-reproducibility issue is actually just sha256sum choking on 2MB files
<Hagfish>what's special about 2MB files?
<stikonas>Hagfish: it breaks gforce_de1977's sha256sum program
<stikonas>since we are not using sha256sum from binutils yet
<stikonas>Hagfish: https://github.com/fosslinux/live-bootstrap/blob/master/sysa/sha-2-61555d/patches/frontend.patch#L20
<stikonas>maybe I can just bump the limit...
<bauen1>sha256 could also be used for source tar files, so a non-existant limit would probably be best ?
<stikonas>bauen1: that's not what we use sha256sum for...
<stikonas>but yeah, we should fix the limit...
<stikonas>at the moment we only checksum tars outside live-bootstrap
<stikonas>and inside it we checksum binaries/libraries
<stikonas>but yeah, maybe eventually we can checksum source tar files too
<stikonas>thers is no reason why not even though we don't do it right now
<bauen1>stikonas: i mean, having sha256 available (for any amount of data you need) gives you one cryptographic primitive that can be used to "skip" reviewing code if you've already reviewed it once, and it is a lot less code to audit than coreutils
<Hagfish>thanks for the link. it seems that it doesn't actually check that the file fits within 2MB, and nor does it output an error code/message to the user if that assumption breaks
<Hagfish>i can't work out what would need to change for it to read an arbitrary amount of data in
<bauen1>also using fgetc when you have a fixed buffer is quite not as efficient as it could be
<bauen1>might need to adjust / fork sha-2 upstream, https://github.com/amosnier/sha-2/blob/master/sha-256.c#L116 what you want to do is init the sha2 state, and then operate on "chunks" for as long as you have input, at the end add padding if necessary and get the hash
<Hagfish>yeah, that sounds right
<stikonas>it might be simple to split executables that we want to hash into chunks using "split"
<Hagfish>would the hashing code call that directly, or would the split happen first and then the parts specified in order when calling the hash function?
<Hagfish>the latter would sort of be backwards compatible, if you wanted to preserve the behaviour of it giving the wrong answer on big files (but that would be weird)
<stikonas>another option is to backport sha256sum from coreutils 6
<stikonas>that might be the best option...
<stikonas>we have coreutils 5...
<stikonas>so hopefully patch applies without too much trouble
<stikonas>hmm, gnu.org is donw...
<bauen1>stikonas: but you can have sha-2 a lot sooner than coreutils ?
<stikonas>well, we can use current broke implementation from amosnier
<bauen1>i'm wondering why the sha2 single file implementation doesn't expose "sha2_init", "sha2_dowork", "sha2_gethash" or something like that, might be a bit more complicated but then you've covered basically every usecase
<nckx>‘all of the Guix developers who care about bootstrapping are here’ is unprovoked nonsense, OriansJ`.
<nckx>Conversely, you've made 0 documented effort to report the problem with premake5 anywhere I can find it, yet find the time to rant about it here.
<nckx>Colour me unimpressed with your ‘leg work’ here.
<nckx>I hope you find the time to do something more productive. As you say: it's easy work!
<pder>stikonas: great work on autotools and binutils. I'll have bash cleaned up shortly and I'll rebase it on top of binutils for now
<stikonas[m]>Well, I still need sha256...
<stikonas[m]>Trying to build just that from coreutils 6
<OriansJ`>nckx: you are absolutely right. I don't document problems for guix anymore. I just document solutions when I find time to make them. Which I figure is more productive use of my time.
<OriansJ`>stikonas: if you look at my last paste, it is a tweak to gforce_de1977's sha256sum program to read the files before allocating a buffer to hold their contents (and added support for sha256sum's -c file behavior)
<OriansJ`>nckx: as for the existence of Guix developers who care about bootstrapping that are not here; you are right it might be entirely unprovoked nonsense. But it is just an observation from my limited experiennce; which very much may be wrong.
<civodul>definitely :-)
<civodul>again, i don't see the need for an us/them kind of discourse
***Noisytoot is now known as [[
***[[ is now known as Noisytoot
<stikonas>OriansJ`: thanks, although I also got sha256sum from coreutils now
<OriansJ`>civodul: exactly we have shared goals and benefit from our mutual cooperation.
<OriansJ`>stikonas: well that is even better. Good job ^_^
<stikonas>well, wasn't too hard, since I am only building one single binary from coreutils 6.3... and was able to reuse most of the stuff from 5.0
<fossy><stikonas> maybe I can just bump the limit...
<fossy>yep, do that
<fossy>perhaps 10m
<stikonas>fossy: it didn't work
<fossy>regarding guix, idk how many ppl here are guix devs
<fossy>stikonas: huh
<stikonas>just bumping the limit somehow didn't work for me...
<fossy>my local diffoscope said they were identical
<stikonas>doesn't matter... I've got coreutils sha256sum now
<stikonas>so that will work
<fossy>stikonas: i wonder if theres an overflow of an int or smth
<stikonas>could be...
<stikonas>that's why I'm more keen on using old gnu tools
<stikonas>than custom software
<stikonas>especially with cryptograpy
<stikonas>*cryptography
<fossy>anyway idk how many ppl are guix Devs but I extremely doubt any bootstrapping project would have got any traction without lots of support from all devs
<stikonas>yeah, although strictly speaking those guix devs that are in this channel can't take that comment personally, since by definition they are in this channel and thus excluded
<stikonas>(from the critisism of that comment)
<stikonas>but yeah, I think bootstrapping wouldn't have been that far without support from all devs...
<OriansJ`>well Guix devs are the majority, followed by nix and Debian.
<OriansJ`>But the majority people here are not Distro Devs
<stikonas>fossy: pder: this should now pass https://github.com/fosslinux/live-bootstrap/pull/54 (binutils)
<stikonas>and hopefully I've got all generated files...
<stikonas>argh, actually no
<stikonas>hopefully will just work, but we have a lot of .l files
<nckx>OriansJ`: Hi! <I don't document problems for guix anymore. I just document solutions [...] more productive use of my time> That's reasonable. Your time is yours alone.
<nckx>I'm just pointing out you spent it doing the former, not the latter.
<nckx>Complaining about the problem here to make a point, without making anyone who could actually fix it aware of it.
<nckx>Like we're not on the same team.
*vagrantc hedges bets and plays on several teams :)
<stikonas>fossy: ok, fixed binutils build now, luckily everything just worked, pushed PR now
<nckx>vagrantc: And, weirdly, they all seem to be winning. How can this be? 🌈 magic.
<stikonas>nckx: anyway, if you want to be informed, live-bootstrap now has some useful tricks that might be nice to adopt in guix (at least in longer term)
<nckx>Yeah, I heard, thanks!
<stikonas>but yes, without guix it would have been much harder to do that. live-bootstrap borrowed a lot from guix bootstrap
<nckx>From my (super limited) understanding it seems more orthogonal, but that's good too.
<nckx>We're talking about <https://github.com/fosslinux/live-bootstrap>, right?
<stikonas>nckx: yes
<stikonas>well, it is a bit orthogonal
<stikonas>but we are also bootstrapping gcc and friends
<stikonas>and tried to do it in a bit more strict way
<stikonas>e.g. no pregenerated files (e.g. bison or lex generated files)
<stikonas>(actually not even using configure scripts until we manage to regenerate them)
<nckx>Right.
<nckx>We all agree that should be nice to do in Guix as well, it's merely a lot of work.
<stikonas>yes, I guess so...
<stikonas>although, there is an example to follow now. Just as we followed Guix too :)
<nckx>So I'm very happy that someone (you?) is demonstrating that it's feasible.
<stikonas>well, not just me, and we built on others work...
<stikonas>(e.g. bison boostrap was done by gio)
<nckx>It's certainly interesting.
<stikonas>pder: before you rebuild bash, we probably need to figure out where binutils inserts non-reproducibility
<stikonas>I guess ar inserts timestamps