IRC channel logs

2021-02-14.log

back to list of logs

<stikonas>fossy: ok, so I can create embed.h in perl 5.000, so that's good
<stikonas>anything newer needs perl
<stikonas>let's see if I can build miniperl there...
<stikonas>hmm, miniperl 5.000 is not easy either :( I managed to build it with gcc, but when trying to build in live-bootstrap, there seem to be incompatibilities with musl and FILE* pointer...
<stikonas>fossy: oh, partial success!
<stikonas>/after/perl5.000 # ./miniperl ../hw.pl
<stikonas>Hello World
<stikonas>although, I still need to create proper config.h
<stikonas>the one from my work on 5.8.9 is not usable
<stikonas>and no problems with bison here...
<stikonas>so I think I'll be able to get something working tomorrow
<stikonas>argh, but there are still two header files created by perl scripts...
<stikonas>keywords.pl and opcode.pl -> keywords.h opcode.h
<stikonas>well, keywords.h is simple enough, either we treat it as original source or write some bash script to generate it...
<stikonas>opcode.h is not so clear-cut...
<stikonas>fossy: can you at some point take a look at those two perl scripts https://github.com/Perl/perl5/tree/perl-5.000 ? keywords.pl and opcode.pl
<stikonas>we'll have to decide what to do with them
<stikonas>but at least they are simpler than that embed script
<stikonas>hmm, maybe we should start with perl4...
<gforce_de1977>fossy: ok, had the think the whole night about: checking build-bin-hashes from external or internal and you are right: from internal is better and check from both sides is even better 8-))) i will try to make sha256 working from an early stage and add the hashes, ok?
<gforce_de1977>fossy: i see https://github.com/fosslinux/live-bootstrap/pull/39 ("Checksumming") and will read, but using !SHA256 seems odd to me
<gforce_de1977>fossy: anyway, i like your 'fletcher16.c'!
<gforce_de1977>fossy: and i even more like 'mescc-tools-extra.kaem '
<stikonas[m]>Let's not overcomplicate with both internal and external I think, just one is enough
<fossy>I agree with stikonas[m]
<gforce_de1977>fossy: regarding your fletcher16.kaem: shouldt it be e.g. '-f /M2-Planet/functions/numerate_number.c' instead of '-f functions/numerate_number.c'
<fossy>gforce_de1977: no, they are different
<fossy>(confusingly)
<fossy>gforce_de1977: we cannot use sha256
<fossy>it is not implemented in coreutils 5.0
<stikonas[m]>fossy any idea on generated perl5.000 headers?
<fossy>stikonas[m]: oh, sorry, i forgot
*fossy looks now
<stikonas[m]>We can recheck everything with sha256sum later
<stikonas[m]>Once we have newer coreutils
<fossy>yes
<fossy>hm, maybe i should recheck fletcher binaries with sha1sum
<fossy>cause fletcher16 has highish collision chance
<stikonas[m]>Well, we'll recheck with sha2 later, so rechecking now is optional
<fossy>stikonas[m]: oh, i can implement keywords.pl very trivally
<stikonas[m]>Keywords yeah, that one is simple...
<stikonas[m]>I am more worried about opcodes
<stikonas[m]>I also tested my miniperl on these two
<stikonas[m]>Keywords was regenerated
<fossy>opcodes...
<stikonas[m]>But opcodes.h was truncated
<fossy>that isn't super duper hard to reimplement in shell
<fossy>wait what
<fossy>can you pastebin a real opcodes.h then
<stikonas[m]>Real is on github
<fossy>this is real opcodes.h untruncated no? https://github.com/Perl/perl5/blob/perl-5.000/opcode.h
<stikonas[m]>I mean my miniperl was buggy
<fossy>ohh
<fossy>that's no good :|
<stikonas[m]>For some reason
<stikonas[m]>Yes
<stikonas[m]>Perl4?
<stikonas[m]>That one doesn't seem to have these
<fossy>i'm not convinced perl4 will be able to do this
<fossy>perl4 is quite different to perl 5
<stikonas[m]>OK, reimplement in bash/sed/awk?
<fossy>yeah
<fossy>if you want me to do that i can probs do that tomorrow
<fossy>or you can do it if you want
<stikonas[m]>Well, I'll probably spend today fixing other issues and getting it to build
<fossy>ok, i'll do opcode.h and keywords.h in shell
<fossy>and you can use pregenerated for now
<fossy>cause it's pretty easy to slot it in
<stikonas[m]>Yeah... Keywords.h is basically source like anyway
<stikonas[m]>Easy if a bit annoying to modify
<stikonas[m]>(Just need to renumber everything if you insert something in the middle)
<gforce_de1977>fossy: stikonas: what about suck in "https://codereview.stackexchange.com/questions/182812/self-contained-sha-256-implementation-in-c"
<fossy>gforce_de1977: hm ty for this
<fossy>this could work quite well
<fossy>ill try this tomorrow :D
<stikonas[m]>All these implementations seem to use precomputed constants... Does coreutils to that as well?
<stikonas[m]>(It's not a super big problem though)
<fossy>stikonas[m]: well they are mathematically generated
<fossy>but yeah it is somewhat annoying
<fossy>i don't have much of a problem with it either
<fossy>even if it was wrong it just is not to spec
<stikonas[m]>Well, that's why I'm not too worried
<fossy>same
<stikonas[m]>I guess they do it for performance
<fossy>yeah that is the reason
<bauen1_>i'm pretty sure they're part of every implementation
***bauen1_ is now known as bauen1
<bauen1>sha256 is quite simple (and easy to verify opposed to a C compiler ...)
<fossy>yeah
<fossy>gforce_de1977: unfortunatly that implementation is only a library
<fossy>not a command line tool :|
<fossy>if you (or someone else) wrote a frontend for it though i would be happy to use it
<gforce_de1977>fossy: here a naive implementation, which compiles with 'tcc sha256sum.c'
<gforce_de1977> http://intercity-vpn.de/sha256sum.c
<gforce_de1977> http://intercity-vpn.de/sha256sum.h
<gforce_de1977>./sha256sum filename
<gforce_de1977>i can make it work with mescc if needed
<gforce_de1977>(i just added a main)
<fossy>gforce_de1977: :D
<fossy>mescc is probably unnessecary
<fossy>actually quite unnessecary
<fossy>gforce_de1977: this is a good implementation thanks
<gforce_de1977>fossy: whats missing is something like ./sha256sum filename -check $HASHXY
<fossy>gforce_de1977: ah, true
<fossy>this does generation
<fossy>but not checking
<fossy>we do need that
<gforce_de1977>yes, but checking is easy
<fossy>yeah
<fossy>it's just read from a file and compare generation
<gforce_de1977>(ok, have to go in the kitchen now, the bird gets ready, awk for a while...)
<fossy>cya!
<stikonas>pder: do you think perl output truncation might be the same problem that you saw with pipes?
<stikonas>(i.e. file is truncated)
<stikonas>but maybe not stdout writing but when writing tofile
<stikonas>hmm, definitey...
<stikonas>when I replaced commented open file call, it produces correct file
<stikonas>anyway, miniperl 5.000 seems doable and once we have something, it will hopefully be much easier to build newer perl using that
<pder>stikonas: definitely the truncation is still happening. An easy fix is make sure you close any open file handles in the program
<pder>I am still looking at trying to fix this issue properly, but havent had much time to look at it
<stikonas>pushed wip version of perl https://github.com/stikonas/live-bootstrap/commit/perl
<stikonas>(no PR for now)
<stikonas>and I think miniperl might be enough to drive autotools...
<stikonas>I think I can run automake (have some unrelated problems with autoconf but that's not perl based)
<stikonas>hmm, and live-bootstrap's gawk segfaults :(
<gforce_de1977>fossy: i added a 'check' function: http://intercity-vpn.de/sha256sum.c - i'am unsure about licencing, it's public domain....
<gforce_de1977>stikonas: you are right, i only tested "gawk --version"
<gforce_de1977>some things are working (Hello World), but this segfaults: gawk '{ print or(4294967295,1) }'
<stikonas>hmm, but do we know it's public domain, we can't assume that...
<stikonas>yeah, so for now I'm trying to use sed instead of gawk to build miniperl
<stikonas>fossy: I've generated keywords.h with sed, defines are off by one, but I don't think that matters
<stikonas>this worked sed -e '1,/__END__/ d' keywords.pl | sed -e '1d; s/^/#define KEY_/' | sed -n 'p;=' | paste - - > keywords.h
<gforce_de1977>stikonas: it has a LICENCE file: https://github.com/amosnier/sha-2/blob/master/LICENSE
<stikonas>oh, that's good
<stikonas>so I think if we make any changes, we can also put GPLv3...
<gforce_de1977>stikonas: your sed-oneliner looks like it would be better a shell-script... (just saying), but thats something for later...
<stikonas>ok, draft PR for perl https://github.com/fosslinux/live-bootstrap/pull/40
<stikonas>I'll take a break from perl for now...
<stikonas>(opcode.h should be recreated before we can merge it)
<gforce_de1977>stikonas: fetch a beer!
<gforce_de1977>and look into the campfire
<fossy>gforce_de1977: stikonas I think I will put sha-2 right after patch, that way we dont have to vendor files (which I dont really enjoy doing)
<stikonas>yeah, ok...
<stikonas>fossy: so I've done the easy file for now in perl (keywords.h)
<stikonas>the harder one still remains
<gforce_de1977>fossy: i have updated http://intercity-vpn.de/sha256sum.c with some comments, just change what you need (e.g. OK and ERROR messages)
<fossy>:)
<pder>stikonas: I might have a better musl fix for the truncated output shortly
<pder>Did you work around your issue by doing an fclose before exiting?
<stikonas>pder: no, I didn't look at it yet, but it might not be critical
<stikonas>pder: it might be causing problems with perl scripts that we need to bootstrap perl more properly but I think automake might be working fine
<pder>stikonas: I just pushed a branch stdio-flush-on-exit. Seems to be working better and doesnt require my previous patch.
<pder>On a side note, we can easily rebuild bash now with CC=tcc AR='tcc -ar' bash configure --without-bash-malloc && make
<pder>And it is interactive
<pder>But I know we would like to have autotools before running configure scripts
<stikonas>pder: yeah, I think we should try to run autotools first
<stikonas>I'm not an expert on autotools though. Do we need to have different versions of autotools for different software?
<stikonas>pder: I guess bash is interactive because it builds with readline?