IRC channel logs

2025-02-01.log

back to list of logs

<lanodan>Yeah enough of a replacement that I'm not too worried about autotools->meson.build transitions (at least if upstream can accept possible few rare patches for muon compat), as it could simplify things
<lanodan>Specially as bootstrapping autotools involves pulling historical versions of it and involves Perl which too involves pulling historical versions.
<stikonas>jackdk: yeah, I'm aware of muon
<stikonas>we didn't really need to use any of meson/ninja stuff in live-bootstrap yet...
<stikonas>that only becomes relevant once you start bootstrapping your distro
<jackdk>fair
<stikonas>well, so far none of the really core system stuff uses those
<stikonas>for example toolchain: compiler, binutils is autotools
<jackdk>The fact that meson knows about a hard-coded list of compilers and doesn't work with tcc means that you have to go pretty far before you can start using it. for that reason, I still lean towards autotools if building projects I want in a bootstrap chain
<aggi>since meson involes python, i recall another argument for the presence of python in modern distros
<aggi>i would argue python does not belong into base system components, it should remain optional
<aggi>that's how *BSD approach it btw.; inside their base system the packaging tools are implemented in C, instead of python
<matrix_bridge><Andrius Štikonas> Well, you need python for any more complex scripting
<matrix_bridge><Andrius Štikonas> Bash is not a good language for that
<aggi>and many if not _all_ development utilities for a complete no-c++ profile can avoid autotools, if gcc/binutils were replaced with tinycc or any other alternative toolchain
<aggi>stikonas: with regards to scripting languages, that's an important detail imo, shell script is the only covered by POSIX
<aggi>M4 macros too are covered by posix, make is; python and perl are not
<aggi>relying on components which are not covered by POSIX becomes critical, if such components are not optional
<aggi>that's how autotools become critical, because such need Perl which is not covered by standardization
<aggi>since such are not optional, it can be considered a violation of POSIX
<aggi>bison/yacc got a POSIX mode switch it seems; didn't check all details yet how bootstrappable got hit by related issues
<aggi>another detail, if bash (or oksh) set POSIXLY_CORRECT, the 'eval' method is forbidden, which too got some security implications inside build-system/makefiles
<lanodan>Well a reason BSDs typically don't have Perl/Python/… in the base is more that Perl/Python aren't very useful without a lot of their surrounding ecosystem and unlike shell they're not really friendly towards using utilities as building blocks.
<lanodan>(And problem of the ecosystem bit is then you'd have conflicts with ports if like a library in base is too old)
<stikonas>Linux distros generally package enough of those packages to make it useful, Gentoo has no problem with python packages in portage
<stikonas>anyway, I was mostly trying to say that writing non-trivial code in bash quickly gets error prone
<stikonas>generally people use global variables, since otherwise it's hard to return values from functions...
<stikonas>error handling is somewhat harder than in other scripting languages
<stikonas>and posix sh is even more restricted than bash
<stikonas>e.g. even set -o pipefail is bashism
<stikonas>so if you want to stop on pipe error in posix sh, it's quite hard
<lanodan>Nah set -o pipefail is a bashism no more, it's in POSIX.1-2024
<lanodan>And yeah would be cool to have a better shell language for sure but so far… not really a thing, although I thought few times about using lua instead in my bootstrap-initrd.
<stikonas>oh, that's good
<matrix_bridge><cosinusoidally> awk is a passable (but slightly quirky) scripting language that is part of posix. eg I wrote a (likely incomplete) hex2 compiler in awk https://github.com/cosinusoidally/tcc_bootstrap_alt/blob/dev/m2min/hex2.awk
<matrix_bridge><cosinusoidally> https://github.com/cosinusoidally/tcc_bootstrap_alt/blob/dev/m2min/mk_hex2_awk_full_fast can bootstrap a very cut down version of M2-Planet using awk. It works with several different implementations of awk (but mawk/gawk are the versions most likely to work).
<stikonas>well, I had to rewrite a few perl scripts in awk for perl 5.000 bootstrap
<stikonas>e.g. here https://github.com/fosslinux/live-bootstrap/blob/master/steps/perl-5.000/files/opcode.awk
<stikonas>this one is fairly simple and readable...
<matrix_bridge><cosinusoidally> yep, unfortunately bitwise operations like "or" are not part of posix awk, they are gnu extensions. If you use -W posix that script will probably fail. Not an issue for live-bootstrap though as you'll have gawk by that point. I had to implement bitwise operations in terms of other maths operations as I wanted my code to work with posix awks...
<matrix_bridge>... (https://github.com/cosinusoidally/tcc_bootstrap_alt/blob/dev/m2min/m2_lib.awk#L344). I then also had to implement caching of bitwise operations to improve performance.