-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea/suggestion: Import future patches/features from Illumos/BSDs? #27
Comments
With exception with importing directly from Illumos, I think it could be a good idea to implement/port missing commands. I mean, my idea is to try to make this package not-so-CDDL'd, since it could cause annoyance later on to folks trying to use this in an embedded environment. |
By the way, about porting from OpenBSD, I had an idea of creating an "ucblib" package that could be used as a libbsd alternative. Not inside Heirloom NG, though. |
Alright, I understand! I'm not offended at all, and I understand the licensing issues & the need for updating standards. Is there any explicit tasks that should be done on that side? I know there's the docs for 2008 and 2017 and I could check for the behavior between expected in the standard and the results of Heirloom.
I was double-checking with the tools in the GNU coreutils (not saying at all to port from there, but I was looking for compatibility with it) and I could have sworn there was more that I wanted to port, but all I could find that was actually missing that wasn't 100% a GNUism was Also on the topic of standards like POSIX -- is there any test suite I could/should use to see how compatible Heirloom NG's utils are in comparison to other stuff? I know there's the Open POSIX test suite, but it looks to not have been updated in at least a decade, if not another 5 years after that. I've also heard of the GNU coreutils test suite that the folks over there use to test their software. |
Nothing that I can say at a first overview, besides the
These will do the trick. 😄
Well, I could argue that one may use
Definitively on the list. 👍🏽 Another two commands that I was thinking about implementing were |
I was thinking about that recently and... no, there's nothing to test all the utilities at once. |
vmactions has workflows for building on the BSDs and Solaris even though they're not officially supported (I believe it uses the macOS VM with a VM inside of that to do the trick). P.S. I once tried building on macOS and there were... several big issues. From a lot of missing headers (can be fixed with macbrew, but it's quite annoying) to similar issues with deprecated functions that OpenBSD had, and even things as basic as APFS not being case-sensitive (unless you specifically configured your Mac's FS otherwise in a rescue CD). I didn't want to create an issue at the time because it's a massive series of issues and I think it's better that we focus on primarily Linux & secondarily the BSDs for now. (Though I'm not the leader, so just take this as friendly advice) |
Yeah, I've been thinking about it! Although it is needed, maybe it's not our priority for now comparing to implementing those new tools.
I've imagined...
Sure, I agree with you. |
Also, I made a commit in my fork of the repository that changes the readlink makefile to where it will clean up the UCB binaries as |
Damn it, how could I have missed that out?
For me it seems O.k. |
Understood. I'll look into the test suites from toybox and get back to you. 😄 |
One more thing -- |
Actually, it's not. |
Oh wow, I didn't notice that. Thanks for informing me! |
O.k., the initial implementation wasn't standard, so I implemented EDIT: Kind of fixed at #29 |
Hi, Molly (@mamccollum), good night. How you are?
|
Hey, that's good to hear. I think a while back (probably around 3 weeks ago now) I was working on a feature here, but I sadly forgot what it was. My fork ended up just turning into a messy disaster and I had to re-start. Is there anything I should assist in working on? |
Well, just testing and completely porting to OpenBSD (although I think having contributions from more OpenBSD folks would help too). |
Just realized that |
I was busy to correct myself, but nevermind, it's part of the standard. |
@mamccollum I was messing around with Heirloom I usually copy folders using I'll take a deeper look on it later but, for now, I'll be using Schily's tar as always. |
chimera-utils has made a lot of the groundwork for using fBSD coreutils in Linux. We could take some of the patches from there. Also, what about the code from SBASE and UBASE? by suckless.org, its all MIT licensed. |
First of all, sorry for the delay on the response. About SBASE/UBASE, I have already taken a look at some of the code, I think that it would be equivalent to copying code examples. It may be useful as a reference, but I think that we can implement more complete utilities. But that's something to consider too. |
sbase is POSIX and minimalist. I thought that heirloom strived for that too. Is compatibility with GNU coreutils a wanted feature for the project? |
You got it a little bit off I what I meant. |
For a matter of honesty, I must say that Suckless {u,s}base may work as well as POSIX specification for enlightening the way to go --- but I wouldn't plain copy the code into Heirloom's source tree just because it's under a compatible licence, at most fork it and enhance it. |
I'm quite busy lately, so I can't burn daylight working on #36 for now, even having references instead of writing completely from scratch as you suggested, nor discussing this matter further. |
Okay, I think I get it. Then what about taking inspiration/work/code from Toybox? 0BSD licensed, by the same guy that started Busybox, its currently used in Android phones, it also works on MCU-less devices, and its pretty lightweight yet convenient. |
Yeah, that is somewhat the goal: a sane and yet convenient environment. Toybox uses too many internal functions, so porting code directly from it is more difficult than doing a clean-room implementing. I have taken your idea of basing some utilities on OpenBSD code when fixing/"filling" Heirloom NG's timeout implementation. |
Released 240220 today, I would like a feedback from some of you. @arthurbacci pointed out that my method for converting the float back to a string is redundant and could lose precision, I have already taken this into consideration to fix in the next release. |
Many fixes are now being addressed at #41. |
I would like to complement this issue with the fact that tar: 2 file(s) not extracted Maybe this can be fixed after some debugging, just taking notes here if someone got to it before me. |
Please open an issue for tar |
That's going to be fun. |
Opened a specific issue for tar at #44. |
@arthurbacci I was thinking, could we borrow the "libutf-8" from Plan 9 for libcommon? Or some other implementation of UTF-8 for C. I found this page which lists some implementations (including Plan 9's) and drawbacks: There's also utf8proc by the Julia Programming Language development team, it looks good, and it's also small. This would be a grand improvement on Heirloom, since we could make other programs UTF-8 compliant too. I'm saying this mostly because of #52, but we could apply this to |
|
Any way to drop-in in this project? |
The LibUTF from Sbase is also really good and tidy: https://git.suckless.org/sbase/files.html |
That's a good suggestion too, but maybe we will just stick to libgrapheme. |
@takusuman Is importing/porting code from https://github.com/illumos/illumos-gate/tree/master/usr/src/cmd acceptable? I don't know much C but I've been trying to create and port utilities from oBSD/Illumos to Linux, if I have any degree of success with it, would you be interested in adding them? Also, how do you feel about non-solaris code? Is Heirloom-ng the correct place to add these utilities or should there be another repo for additions that don't come from Heirloom nor are implementations of POSIX commands? |
G'day, pardon for the delay on the response --- I'm trying to configure a new domain to this project and it's been complicated because of, well, Brazilian internet bureaucracy probably inherited from the last days of the Military Regime.
About Illumos, the only problem to me is the licence --- I'm not against anything "quasi-copylefted", for instance, Copacabana's default shell (ksh93) is under something similar to CDDL ---, I'm aiming to have Heirloom NG in a permissive licence because I can see it running on embedded devices someday (under Copacabana or not), so I would like to keep it with the only restrictions being that our names as contributors being cited.
In this case, no problem. :^)
Fine. Most things here, although being based on Solaris/SunOS payloads, are pure reimplementations and/or have heavy modifications to be portable --- since the Sun crew, with their own obvious reasons, didn't made the code portable in many parts.
Even though this sounds contradictory, Heirloom is a set of UNIX utilities, but not strictly POSIX. By the way, I'm currently trying to implement wall (#46) and write (#47), which come from UNIX v7. Help on these would be appreciated since the change from utmp to utmpx broke a couple of things. I mean, a lot of things. |
I too think avoiding feature creep is crucial, and that copylefted licenses should be avoided. One last question: Are you okay with Go code? Not necessarily in this repo, but in Copabanaca, I'd like to contribute but I am not proficient nor understand enough C, I may get by porting some commands using things like libbsd, but that's it. |
Go? We're all for it! |
By the way, just a note: pacote isn't a direct competitor to bigdl nor other sophisticated package managers, it's the bare minimum to install packages reliably in an UNIX-compatible system. |
I can help with porting since I've done it before with another programs, no problem with that. By the way, C isn't as nearly as difficult if you're already programming in Go from a long time. |
I'm currently trying to port various utils to https://github.com/xplshn/a-utils, I've a local version of the source code of SystemV and UnixV32, I am re-implementing things in Go, using bits and pieces taken from https://github.com/u-root/u-root. I like Go because if you do everything using the language's |
I realized that what I was doing was totally wrong, I should have first checked if OpenBSD to POSIX ports already existed, and, apparently, this one which hasn't received updates in 5 years isn't really far behind, I ran a diff -Naru on each directory, the majority of changes are on the build system itself, removing the use of pledge() and etc. https://github.com/ibara/baseutils But you can do a quick and dirty trick, use the pledge() implementation of Cosmopolitan libc using -I/path/to/cosmopolitanSrc/libc/calls: https://github.com/jart/cosmopolitan/tree/master/libc/calls |
I know, it was one of the things that made me think about Go back in 2021.
That remembered me that I need to refactor Copacabana's build-system and work on the idea of pure cross-compiling. I'm a little bit worried about more complex parts such as OpenPAM, Xorg/Wayland, KDE and Pipewire, but I think we can.
Per my experience, the most annoying part is to remove OpenBSD-specific code such as
I remember having a plan to port pledge() into Linux and ship it per default on Copacabana, can we do that in small time or it would take more than two weeks? |
Cosmopolitan even ships a program called pledge that uses the Cosmopolitan libC pledge()'s that allows you to change what a program can do, I think it could be done in a few days, since Cosmopolitan libc is very portable, do you want to import only pledge() and adapt it to work with the rest of the codebase? |
I think we can go further: port it and implement as a patch/extension to musl --- or maybe into the kernel itself. Justine has written a blog post about porting it, so I think we can write some things from scratch: https://justine.lol/pledge/. |
I will be doing various "pre-releases" of Copacabana before getting on 0.5, so we can experiment a lot and fix along the way. |
Just a quick note -- While util-linux is licensed under the GPL 2.0, the code for write and wall appears to be still one of the BSD 4-Clause licenses from what I think is 4.4BSD's implementation, as the license headers at the top of the files for wall.c and write.c are the BSD licenses from UCB, but modified for Linux. The README for licensing of the files states that is indeed files under different (such as BSD) licenses. |
G'day @mamccollum, pardon for the delay (of months).
Yeah, it's pluri-licenced, I saw that. |
Hey there, I had an idea I wanted to share. I understand that future contributions are supposed to be in the Zlib License, & I know that Illumos & the BSDs are NOT under the Zlib License, however I was wondering if on new commands or commands already licensed under CDDL or existing compatible licenses, that we could potentially import commands, features, & more from Illumos and/or the BSDs such as OpenBSD.
Does anyone else believe this has potential? I could work on ensuring it uses libcommon, etc.
I understand that we already have some work to do with OpenBSD compatibility, but I believe this could help push some innovation and expansion of the project, albeit at the cost of maintaining more.
Thoughts? (PS: if we do go through with this, should we try to import the git history for the specific files from Illumos, etc.?)
The text was updated successfully, but these errors were encountered: