IRC channel logs

2021-10-07.log

back to list of logs

<oriansj>stikonas: thank you. I guess I was too tired to notice that.
<stikonas>well, this happens if you work too late
<stikonas>happened to me too...
<stikonas>anyway, I've got the next interesting thing
<stikonas>fossy, oriansj: do you want conditionals in kaem?
<oriansj>well with it we could enable the use of kaem scripts for mescc-tools and M2-Planet tests.
<stikonas>so I mostly got it working
<oriansj>nice
<stikonas>it's not 100% nice with output in --verbose mode but not too bad
<oriansj>So it'll be some work
<stikonas>well, let me paste how it looks
<oriansj>and I have some work to do on untar to address: https://www.openwall.com/lists/oss-security/2021/10/03/1
<stikonas>so for this kame file https://paste.debian.net/1214547/
<stikonas>I get the following output https://paste.debian.net/1214548/
<oriansj>so didnt' echo the else
<stikonas>if I have else block, it echos just else but nothing after else
<stikonas>but else is printed
<stikonas>and then in that case fi is not printed
<stikonas>so maybe it's acceptable...
<stikonas>and this is the implementation: https://github.com/stikonas/mescc-tools/commit/8831dac1366c979df3e1d226e30bf6c8f5729c46
<stikonas>ok, I made a PR now
<oriansj>the old_VERBOSE might not be the right way.
<stikonas>fossy: you might want to take a look https://github.com/oriansj/mescc-tools/pull/28
<stikonas>hmm
<stikonas>oriansj: what do you suggest?
<stikonas>well, even with this PR conditionals are not fully useful as one needs test command...
<stikonas>but one step at a time...
<oriansj>break it into 2 loops, one for the if and one for the else (if it exists)
<stikonas>yeah, maybe that would be clearer...
<stikonas>hmm, somehow 2 loops look worse...
<stikonas>or at least my implementation
<stikonas>wrote something like https://paste.debian.net/1214551/ but I don't like it...
<stikonas>it's basically twice as much code
<stikonas>probably can't do much more with kaem without requiring extra syscalls
<stikonas>globs need opendir, $() needs dup2. for loops might not need extra syscalls but tricky to implement with current design (kaem reads line by line)
<oriansj>stikonas: absolutely true. kaem was never designed for half the things it does. They kind of grew organically.
<oriansj>So the question becomes should we continue to extend kaem or should we pick up a better shell?
<stikonas>well, we have bash
<stikonas>which is built fairly quickly
<stikonas>but I don't know if we want something between bash and kaem
<stikonas>at some point we might get gash
<oriansj>for example: https://github.com/rain-1/s
<stikonas>but we should definitely keep a shell (kaem) that requires minimal number of syscalls
<stikonas>I think I saw this s
<stikonas>I don't remember what was the issue with it that prevented it from being included into live-bootstrap
<oriansj>it wasn't buildable previously as if I remember correctly.
<stikonas>possibly
<stikonas>maybe tcc had problems with it
<stikonas>or maybe uses more libc than mes has
<stikonas>probably the latter
<oriansj>but that is the problem with shell interpreters.
<oriansj>They are very heavy in syscalls required and can easily turn into unmaintainable messes
<stikonas>well, I started working on if/else cause that might be useful for multiple arch support...
<oriansj>with get_machine I am guessing
<stikonas>hmm
<stikonas>get_machine needs modifications I guess
<oriansj>no
<stikonas>we can't redirect stdout
<oriansj>but I got an idea
<stikonas>hmm
<stikonas>well, it can return arch number...
<stikonas>oh, that's still trickyu
<stikonas>hmm
<oriansj>get_machine -if x86 -exec "./kaem -f foo"
<stikonas>do we actually need get_machine?
<stikonas>if we just define ARCH="whatever" in initial kaem.arch
<oriansj>no we could create something custom
<stikonas>although, initial kaem.arch is kaem-minimal
<stikonas>so can't define much
<stikonas>well, actually we can define after we build full kaem
<oriansj>but kaem might benefit from being able to do: ./kaem -f foo.$(get_machine)
<stikonas>but $() needs extra syscalls
<stikonas>dup2
<oriansj>yeah unfortunately
<stikonas>hence I'm thinking of just defining it as env variable
<stikonas>which should be doable
<stikonas>(possibly just before after.kaem)
<stikonas>or maybe even earlier
<oriansj>well extending kaem to have access to the uname data would be trivial
<fossy>stikonas[m]: conditionals would be nice it was ob my todo list a while ago
<pabs3>will bootstrappable be at LibrePlanet? https://www.fsf.org/blogs/community/libreplanet-2022-returns-online-submit-your-session-proposal-by-dec-1
<oriansj>pabs3: well the last 3 proposals were rejected. So I think I need to make a much better proposal to get accepted.
<stikonas>fossy: if you have some spare time maybe review my kaem PR?