Skip to content

std.Target: Remove more dead OS/architecture tags #20870

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

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Jul 30, 2024

See commit messages.

@alexrp alexrp force-pushed the target-cleanup-3 branch 2 times, most recently from e8e87bb to f7bd88b Compare July 30, 2024 02:48
alexrp added 6 commits July 30, 2024 06:30
What is `sparcel`, you might ask? Good question!

If you take a peek in the SPARC v8 manual, §2.2, it is quite explicit that SPARC
v8 is a big-endian architecture. No little-endian or mixed-endian support to be
found here.

On the other hand, the SPARC v9 manual, in §3.2.1.2, states that it has support
for mixed-endian operation, with big-endian mode being the default.

Ok, so `sparcel` must just be referring to SPARC v9 running in little-endian
mode, surely?

Nope:

* https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L226
* https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L104

So, `sparcel` in LLVM is referring to some sort of fantastical little-endian
SPARC v8 architecture. I've scoured the internet and I can find absolutely no
evidence that such a thing exists or has ever existed. In fact, I can find no
evidence that a little-endian implementation of SPARC v9 ever existed, either.
Or any SPARC version, actually!

The support was added here: https://reviews.llvm.org/D8741

Notably, there is no mention whatsoever of what CPU this might be referring to,
and no justification given for the "but some are little" comment added in the
patch.

My best guess is that this might have been some private exercise in creating a
little-endian version of SPARC that never saw the light of day. Given that SPARC
v8 explicitly doesn't support little-endian operation (let alone little-endian
instruction encoding!), and no CPU is known to be implemented as such, I think
it's very reasonable for us to just remove this support.
This is a fairly small hobby OS that has not seen development in 2 years. Our
current policy is that hobby OSs should use the `other` tag.

https://github.com/zhmu/ananas
Revert this commit on the next glibc abilists update.
@alexrp alexrp force-pushed the target-cleanup-3 branch from f7bd88b to 62a0185 Compare July 30, 2024 04:30
Copy link
Collaborator

@linusg linusg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our current policy is that hobby OSs should use the other tag.

Can you link to anything supporting that, and a rough definition for "hobby OS"? I think Haiku is widely regarded as one, and I have a feeling that the policy is actually looking at popularity :^)

@rohlem
Copy link
Contributor

rohlem commented Jul 30, 2024

Our current policy is that hobby OSs should use the other tag.

Can you link to anything supporting that, and a rough definition for "hobby OS"? I think Haiku is widely regarded as one, and I have a feeling that the policy is actually looking at popularity :^)

I agree that some definitive wording to point to would be nice.
I personally think that, besides "popularity", activeness and collaboration are maybe more important factors.
(EDIT: I guess that could also be called "popularity among developers (and users)" though.)
I remember there being a couple of PRs specifically fixing and adding functionality for Haiku to std, and there are still many mentions of the .haiku tag in std.
Maybe that effort could be externalized into a separate package using the bring-your-own-OS mechanism, but before those mechanisms are finalized it makes some sense to have it upstream.

In comparison, .ananas seems to not have any specialized code paths anywhere, and as the commit message points out, even their upstream repo hasn't had activity in the last 2 years, so it's unlikely we'll see contributors wanting to fix std, nor use it as a field test for the BYO-OS design.

@alexrp
Copy link
Member Author

alexrp commented Jul 30, 2024

Can you link to anything supporting that, and a rough definition for "hobby OS"? I think Haiku is widely regarded as one, and I have a feeling that the policy is actually looking at popularity :^)

I do not know that we have an actual, objective definition. But see #3784.

I think Ananas is an open-and-shut case, though. It's written in C, development has stalled for 2 years, and it only has 55 stars on GitHub. I think most would agree that it falls squarely in any reasonable definition of "hobby OS". It was only ever included in std.Target because LLVM for some reason included it in its TargetParser at one point (but no longer).

OTOH, Haiku seems to be actively developed and it seems to have an actual user base. For comparison, like Haiku, I didn't remove Hermit either. I think both of these have enough of a following that "hobby OS" is no longer an appropriate moniker.

This is just my thinking, though; I don't know what Andrew considers a "hobby OS" in the context of #3784.

@Vexu
Copy link
Member

Vexu commented Jul 30, 2024

Are Arch, Abi and Os.Tag sorted in any way? If not could you sort them alongside one of your other PRs? It'd at least be nice to have ps3 next to 4 & 5. none and other should be kept separate though.

@alexrp
Copy link
Member Author

alexrp commented Jul 30, 2024

Are Arch, Abi and Os.Tag sorted in any way? If not could you sort them alongside one of your other PRs? It'd at least be nice to have ps3 next to 4 & 5. none and other should be kept separate though.

They are mostly sorted according to the order they appear in LLVM. I assume it's done this way to make LLVM upgrades easier. I'd be fine with sorting them in a more 'sensible' way, but since Andrew is the one doing the LLVM upgrades, I'll defer to him on this.

@andrewrk
Copy link
Member

andrewrk commented Aug 1, 2024

Regarding "other": this tag is intended to facilitate the use case when no other tag is appropriate. Maybe your OS did get added to the zig std lib but you're stuck on an old zig version for example. The policy about adding OS tags is that any active project is a candidate. If the project looks dead, it's fair game to remove; if the project looks alive, it's fair game to add. Old consoles should be kept because these are permanently alive thanks to emulator communities.

In short summary, if any OS tag is desired, then it has a home in the std lib. Deleting a "dead" CPU arch or OS should never be controversial.

And it's perfectly fine to sort them.

@andrewrk andrewrk merged commit 8f7cbaa into ziglang:master Aug 1, 2024
10 checks passed
@alexrp alexrp deleted the target-cleanup-3 branch August 1, 2024 08:35
alexrp added a commit to alexrp/zig that referenced this pull request Aug 1, 2024
kubkon pushed a commit that referenced this pull request Aug 1, 2024
Happened because I wrote #20869 before #20870.
andrewrk pushed a commit to ziglang/libc-abi-tools that referenced this pull request Aug 1, 2024
SammyJames pushed a commit to SammyJames/zig that referenced this pull request Aug 7, 2024
igor84 pushed a commit to igor84/zig that referenced this pull request Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants