On 12/3/22 10:50, enh wrote: > At which point it dies trying to build openvt and not finding linux/vt.h > so I > remove CONFIG_CHVT=y from kconfig/freebsd_miniconfig and try again, and > now the > linker failed with undefined symbol get_block_device_size because > lib/portability.c has #if defined(__APPLE__) elif defined(__linux__) #elif > defined(__OpenBSD__) and I need to step away from the keyboard for a bit. > > yeah, if they'd spent less time fighting each other, they might have had more > direct impact (rather than indirect through having bits reused in > Android/macOS/Windows)! > > i think the ifdefs are mostly my fault,
No, it's my fault for not regression testing this sooner. (Even with fewer distractions there's still a whole lot of balls to juggle.) > because i was only thinking in terms of > __APPLE__ and __linux__, and since __linux__ was the default for toybox > _without_ portability.c, i was using #if defined(__APPLE__) as a "here's the > weird special case". I added an #else return 0; because it's just used as an optimization. Freebsd can do the bisect on device nodes. > but if we're expecting to support macOS/iOS _and_ the three main BSDs (and we > haven't even heard from the really niche ones yet, which have their _own_ > #defines!), maybe > > #if defined(__linux__) > #else // Some kind of BSD > #endif There is no DIOCGDINFO in /usr/include of freebsd 13, so the OpenBSD case is distinct from FreeBSD. Theo did his asshole thing and got kicked out of FreeBSD development at the end of 1994: http://mail-index.netbsd.org/netbsd-users/1994/12/23/0000.html They've had almost 30 years to diverge since then, and Posix remains <strike>useless</strike> of primarily historical interest. > should be the default idiom? and we can just add #elif as/when needed for > genuine special cases? I'm all for a passable #else case that at least builds. Not just bsd, I got a couple github pokes from a guy building toybox on qnx, and other pokes about merging toysh into non-GPL bootloaders (I think u-boot uses an old fork of busybox hush... yup, https://github.com/u-boot/u-boot/blob/master/common/cli_hush.c .) > Note I did _NOT_ give it O_NOFOLLOW. In fact the Linux man 2 openat says > that > O_NOFOLLOW is a FreeBSD extension. I wonder if FreeBSD gets it right? > > yeah, hard to know without trying it. i've no idea how much apple's BSD > "personality" grafted on to the mach stuff actually shares code with BSD. (or > whether it _did_ once but effectively forked in the 1980s in the NeXT days, > and > has gone its own path since then.) Apple hired FreeBSD's maintainer away to work on Darwin in 1999: https://landley.net/history/mirror/unix/jordanhubbard.html Here's a post-mortem on how Apple killed Darwin: https://rixstep.com/2/20190728,00.shtml Years ago I had a theory that the GPL's main pragmatic advantage was it prevented your developers from being hired away to work on a proprietary fork of the open source codebase, as happened to BSD three times (when Sun hired Bill Joy in 1982, when BSDi hired a bunch of people away from CSRG around 1990 (the AT&T lawsuit days), and Apple hiring Jordan Hubbard in 1999 above). Any time FreeBSD got any sort of traction, it got harvested to feed a proprietary fork. The proprietary guys offer "get paid to do what you love" deals and always tell the developers they can still work on the open source version in evenings and weekends. Then they work them 90 hours/week so they have no time/energy. The proprietary guys also promise to do eventual open source releases of the proprietary-side code the devs are working on, ala abandonware dumps long after the fact which outsiders can't contribute to or report bugs in because the internal version is 18 months newer than that and external contributions are too stale to be relevant. But said open source releases are pie-in-the-sky "real soon now" things that never happen anyway: https://en.wikipedia.org/wiki/The_Bugs_Bunny_Show#:~:text=Last%20week However, this never happened to Apache: their dev team stayed intact for decades. And the REASON was, they had a strong coherent internet community that did all its development online. Nobody was willing to be hired into an environment that would cut them off from their online communication channels all day. BSD development didn't primarily happen through the internet, Apache development did. So the two of them having similarly forkable licensing didn't matter, because Apache developers didn't flake off to proprietary forks. The GPL licensing probably helped Linux grow in the 90's, but by IBM CEO Sam Palmisano's 2000 announcement of $1 billion/year investment into Linux guaranteed for the next 5 years, working for a proprietary fork was perceived as a career limiting move by the Linux developer base. (I left a job in 2016 when I found out that ITAR export restrictions would attach to casual online conversations while I worked there. (My boss described it as "you buy a screwdriver at home depot it's just a screwdriver, you use it to turn a screw on a spacecraft it's now a munition and cannot be discussed with non-US persons".) And FreeBSD hasn't suffered similarly prominent proprietary harvesting in 20 years, because their development community is now online and a job that cuts you off from that means you stop being a FreeBSD developer. (They have other problems, but their licensing has pivoted to being an advantage.) (A note on timing: the NSF AUP change that allowed global access to the internet happened in 1993, resulting in the "september that never ended" via AOL etc. Linux was only 2 years old by that point. When the students working on Linux at universities graduated, they didn't have to leave their good internet connections behind. There were now home ISPs. I tried to give a talk about all this in 2003, but they only recorded audio not video so you couldn't see the historical references I was showing on screen, and I didn't manage to edit it down to fit in the time slot anyway, but if you're bored: https://archive.org/download/OhioLinuxfest2013/24-Rob_Landley-The_Rise_and_Fall_of_Copyleft.mp3 .) Sigh. I need to revisit so many old things and clean them up and redo them properly... Rob P.S. The reason the Apache project got derailed was instead they wanted windows support to compete with IIs on windows hosts, and windows can't sanely fork and have processes share resources, instead they needed to rewrite the whole thing to be threaded which was the Apache 1.x vs 2.x difference and why the Linux community DESPERATELY clung to the much superior fork-and-scoreboard based 1.3 release instead of the threaded 2.0 release. When the developers finally did the python thing of discontinuing the old version and ONLY supporting the new one, they ost most of their non-windows userbase to new implementations. Linux only bothered to implement nontrivial threading in the first place because the flood of Java developers in 1998 demanded it, because James Gosling never added poll/select bindings to Java so the ONLY way you could do nonblocking I/O was by forking a thread to wait on each input source. The Linux developers themselves thought threading was actively stupid, and a hack solaris invented because their fork was so terrible: https://web.archive.org/web/20130117105522/http://cryptnet.net/mirrors/texts/kissedagirl.html _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
