IRC channel logs
2021-10-27.log
back to list of logs
<oriansj>very easy to test just put 2 fputs in in mes.c: try_open_boot <stikonas>so argments ended up in the wrong registers <oriansj>oh god the garbage collection from 32bit to 64bit pointers <stikonas>hmm, changing M2_CELL_SIZE from 1 to 12 (as in CONSTANT) <stikonas>oh, I probably should update M2_CELL_SIZE in more places <oriansj>CONSTANT M2_CELL_SIZE 12 means in M2-Planet the cell size is 3 4byte words. So you'll need a bit more logic <oriansj>but because 1U is used with the #define, it means you'll need to do it as a preprocessor block <oriansj>possibly with -D to switch between 32bit and 64bit <stikonas>and __M2_PLANET__ might not be defined in #if... <stikonas>somehow preprocessor doesn't seem to pick that branch <oriansj>So #if defined(__M2__) && defined(64bit) .. #elif defined(__M2__) ... #else .... #endif <oriansj>or you could do 3* sizeof(long) as M2-Planet supports sizeof <stikonas>and the same cane be done for pointer size... <oriansj>yep (garbage collection and pointer arithmetic is one of the few places where M2-Planet doesn't act like C) <muurkha>I don't think ( is a thing you can #define <stikonas>strange, #if defined(__M2__) doesn't seem to work for some reason <stikonas>oriansj: ok, I think I've got it working with some hacks (will have to clean it up before other stuff, e.g. x86 is unbroken) <stikonas>had to add that constant to #else branch <stikonas>hmm, sometimes mes-m2 still crashes on hello world, somehow it's non-deterministic <oriansj>stikonas: if you used #if defined(__M2__); it should never use the else branch as can be seen in my example paste <oriansj>umm the word defined is no where on that page <gbrlwck>good news, everybody! mes-m2 works on hardware :) <gbrlwck>i get a bunch of warnings, though (#error and #undef unsupported in M@2 <fossy>gbrlwck: Out of interest what hardware, <gbrlwck>is it possible mes-m2 is relatively slow? <gbrlwck>i'm still also doing other jobs on the machine by the side, but the simple (display 'foo) (newline) takes 2 minutes(!) <stikonas>on qemu printing (newline) takes maybe 2 seconds <stikonas>for me things have about 50/50 chace of working <stikonas>and rest of the time it crashes in gc_push_frame <stikonas>but when it works, it works even for complicated programs <stikonas>also need to unbreak other arches before this can be merged to mes-m2 <gbrlwck>if you point me to things, i'll try to execute them :) otherwise i'd have to come up with nice test-cases myself <stikonas>yesterday I mostly debugged things with gdb <stikonas>now I just saw that crash happens in gc_push_frame function <stikonas>but haven't checked why data is corrupted there... <stikonas>gbrlwck: btw, if you want to check for slowness <stikonas>MES_ARENA=20000000 MES_MAX_ARENA=20000000 MES_STACK=6000000 strace -c ./bin/mes-m2 -c "(display 'Hello,M2-mes) (newline)" <stikonas>might show which syscalls (if any) are taking time <stikonas>oriansj: and what are the longer term plans for mes-m2? <stikonas>is it going to be integrated back into mes? <stikonas>half of my time is spent on read, but still on <stikonas>% time seconds usecs/call calls errors syscall <gbrlwck>yeah, i guess it takes so long because i'm heavily using the machine on the side <gbrlwck>so we now have a full source bootstrap for riscv64 (at least up to mes)? next step would be compiling guile with mes? and then we can bootstrap a full guix system on top of that? <gbrlwck>stikonas: how did you test c compilation? just `./scripts/mescc foo.c` ? <stikonas[m]>The one in scripts is almost identical but templatefmd values were nit filled not filled <stikonas[m]>Also grabbed config.h from there but that can probably be replaced with -D define <stikonas[m]>You'll also have to get nyacc and define GUILE_LOAD_PATH <stikonas[m]>Once mescc is ported, you can 1) rebuild mes with it (optional but easy) or try to port tinycc to RISC-V (hard) <stikonas>so tinycc will be the first tricky step (right now it doesn't work even on amd64) <stikonas>then after that it would probably be not too hard until binutils (although, old autotools versions might not like risc-v too but probably fixable) <stikonas>one is very old 0.9.26 patched by janneke <Hagfish>"The go command now embeds version control information in binaries including the currently checked-out revision and a flag indicating whether edited or untracked files are present." <Hagfish>it would be nice if it also indicated that every commit was signed by a PGP key <Hagfish>civodul: do you think that will make it non-reproducible? <civodul>Hagfish: i think commit IDs are the new timestamp :-) <civodul>the change less often than timestamps, so they're less of a problem from a reproducibility viewpoint <civodul>but still, they're "silent metadata" <civodul>but i don't know, there are also advantages to embedding provenance metadata like this (as --save-provenance in Guix) <Hagfish>i think that commit IDs should (ideally) change exactly as often as the code itself changes <Hagfish>i guess someone might create version 1, then version 1.1, then remove that code and call it version 1, even though it is later in the revision history <Hagfish>in other news, the Qubes-OS people have tried rebuilding the packages in Debian buster and have confirmed that 92.1% of them are reproducible: <Hagfish>a little less than the number that Debian's own reproducible builds effort calculated <civodul>actually Debian was building slightly different packages than those people actually use <civodul>also, the Qubes OS folks are starting from pre-built binaries from snapshot.* <civodul>so my understanding is that they're not rebuilding "recursively" <Hagfish>it's slightly worrying if "recursiveness" is what causes the difference <Hagfish>that would mean that a non-reproducible change is infecting builds further down the line, i.e. the output of a system isn't dependent on its source + input <stikonas>that's not the branch that you can build with mescc <vagrantc>Hagfish: the difference with the builds from debian.notset.fr and the builds at tests.reproducible-builds.org are that debian.notset.fr builds the packages with the same toolchains that the packages in the debian.org archive used, whereas the tests.r-b.org builds use whatever happens to be currently in the relevent debian release <gbrlwck>`git checkout g5bba73cc` does not seem to work (on that source tree) <vagrantc>both of which are basically using binary seeds of "what was once in the debian.org archive" or "what is currently in the debian.org archive" <vagrantc>Hagfish: also the tests.r-b.org builds intentionally vary a bunch of arbitrary things to trigger reproducibility, the debian.notset.fr tries to minimize differences ... neither project really does any bootstrappable sort of stuff <gbrlwck>is mescc more than invoking mes with a mescc.scm script? <stikonas>gbrlwck: well, mescc.scm script doesn't have much logic in the file itself <stikonas>so depends on what you mean by "more than" <stikonas>if you mean do you need to run anything else than no <stikonas>it's just mescc.scm that you need to run <stikonas>but under the hood it loads much more code <stikonas>and all the C code is split between parser (nyacc) and mescc module <gbrlwck>makes sense :) i was wondering if there was another repo involved which i couldn't find <gbrlwck>so, since we can not /compile/ scheme yet, i simply have to make the nyacc modules available in the load path of mes, right? <stikonas>mes itself is a C program and can be compiled <stikonas>but at the moment you can only recompile mes for x86 <gbrlwck>yeah, just bc nyacc's make actually compiles the modules (and install probably copies them to $GUILE_LOAD_COMPILED_PATH) <stikonas>if you want to rebuild it on riscv64 you need to first port mescc to it <stikonas>there is some initial work done in mes branch <stikonas>guile does some processing from scm files to guile objects, but I'm not very familiar with it <Hagfish>vagrantc: thanks for the extra context <stikonas>Hagfish: well, we also rebuild some stuff twice in live-bootstrap <vagrantc>it's a project i'm following with much excitement :) <stikonas>so there are some bugs that propagate a bit <Hagfish>it's interesting that t.r-b.org deliberately tries to trigger non-reproducibility, and yet i think they also achieve a higher percentage of reproducible packages <stikonas>so if binary snapshot used for building is older, having to rebuild everything twice is not entirely surprising <stikonas>at least when you do that in bootstrapping it's a bit less dodgy <stikonas>since everything in the end is built from source <vagrantc>Hagfish: possibly due to toolchain fixes introduced since the original package build <stikonas>especially considering that toolchains often does source optimization <stikonas>so if you have newer toolchain, it will compile packages differently <vagrantc>well, debian.notset.fr is one build with old toolchain compared against another build with old toolchain, and tests.r-b.org is one build with current toolchain compared against another build with current toolchain <vagrantc>but the current toolchains have fixes that fix reproducibility issues ... nobody's expecting bit-for-bit identical with different toolchains (other than with projects where that's a design goal like mes) <stikonas>well, even different versions of mes and M2-Planet are not guaranteed to produce the same bit-for-bit identical binary <stikonas>and adjust assembly output, then binaries will change <stikonas>Mutabah seems to be doing good job with mrustc. Almost done with rust 1.54. Which is still fairly new <fossy>yes, tcc is synonym of tinycc <gbrlwck>does linux-libre build reproducibly? <stikonas>at least by default kernel does have timestamps (compile date) but I don't remember if you removed that <stikonas>and initramfs is definitely not fully reproducible bit-by-bit because we don't strip timestamps from it <fossy>it is reproducible, I checked <stikonas>but the contents of initramfs should reproducible, I think it's only metadata that differs <stikonas>at the very least all binaries and sources in it are checksumed <oriansj>stikonas: to the question of what is the future of mes-m2; well that is hard to answer. Ideally porting to multiple architectures but I doubt it will be backported into Mes as M2-Planet builds don't comply with the GNU build standards. (lack of autotools and all that jazz) <stikonas>well, I guess it's fine keeping it separate... <stikonas>although then the question is how to merge mes updates back <oriansj>as for what go is doing. seems like just minor metadata additions. Personally if I were to go that route, I'd just add a source section to the ELF binaries themselves (trivial to do in M2-Planet) and distribute the source code used in making the binary in the binary itself. <stikonas>by the way, that diff I posted has #if defined at the end... <oriansj>well mes.c doesn't get updated much, but MesCC bit certainly does. <oriansj>odd ctrl-f search didn't find the word defined at all <stikonas>well, mes-m2 actually doesn't have to deal with mescc much <stikonas>as long as we can build mes-m2, we can then switch to upstream mes <stikonas>I think mescc is somewhat compatible across mes versions