On 2020-08-11 09:37, Jonathan Perkin wrote:
I'll second this sentiment. The bootstrap script has many shortcomings, but given the variety of platforms supported, it can't do everything. It has to work reliably for everyone, so complexity is enemy #1.* On 2020-08-11 at 14:54 BST, Denys Nykula wrote:"Jonathan Perkin" <jperkin%joyent.com@localhost> 11 August 2020, 16:07:04:You can pass --full to bootstrap to force lang/nawk to be built and used, so you shouldn't need to do this manually.Unless there's awk in PATH, --full exits with an error.I don't think adding detection to do this automatically would be a great idea, awk is a mandatory utility and there needs to be some cut-off point where anyone deliberately running a system without it or some other critical command will need to just work this out for themselves, otherwise where do we stop down the rabbit hole of trying to bootstrap everything from nothing.Ideally at cc, sed, and sh. But other required bootstrap utils are all much simpler than awk, essentially wrappers around libc functions: cat, chmod, cp, echo, dirname, groups, id, ln, ls, mkdir, rm, rmdir, tr, uname, whoami. All of them are present in sbase+ubase and toybox, which are both common starting points for modern embedded Linux, and neither implements awk (both provide sed though). Since pkgsrc tree contains its own awk source, why require one from a base system?It comes down to who you believe should suffer the burden of cost in making this work. In my opinion, our bootstrap script is already far too complicated and is difficult to test and change without risk of breaking many esoteric bootstrap situations that happen to work ok right now. Adding the ability to bootstrap on a system without a working awk would add yet more complexity at further cost to the simplicity of the script and the ability for people to make changes without causing regressions. I also believe that users who are choosing to use pkgsrc on such esoteric systems will already be fully capable of applying whatever workarounds necessary to get bootstrap working themselves (as you've demonstrated). It's also worth noting that awk is in toybox's list of "Packages toybox plans to provide complete-ish replacents for". I just don't think this is something that pkgsrc should be paying for.
I would suggest instead a collection of wrapper scripts specific to one or a few environments. This way, each of them can remain fairly simple and maintainable, and regressions in one of them won't impact the entire pkgsrc community. As an example, I created and maintain auto-pkgsrc-setup (http://netbsd.org/~bacon/) to simplify bootstrapping and ensure consistency and stability for typical PC and Mac users. It's currently ~1500 lines of Bourne shell code, most of which I would not want to push upstream into the bootstrap script.
The bootstrap script can be thought of as the kernel of the bootstrap process, around which we can build platform-specific applications.