Skip to content
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

Haiku: add definitions for the Haiku's native sytem API. #2034

Merged
merged 3 commits into from Feb 8, 2021

Conversation

nielx
Copy link
Contributor

@nielx nielx commented Jan 13, 2021

On the Haiku platform, the POSIX (and BSD) API coexists with the native API,
that has its origins on the BeOS platform. Unlike other UNIX-like platforms,
the native API is not an extension of the POSIX API, but instead exists sui
generis, and many of the POSIX concepts have their own native variety, with
relatively limited interoperability.

Nonetheless, the native API coexists in the same library as the standard C and
POSIX functions, namely libroot.so, and therefore this crate is a good place
to add bindings to it.

This commit implements most of Haiku's support kit, the most important parts
of the kernel kit, and a part of the storage kit.

@rust-highfive
Copy link

r? @JohnTitor

(rust-highfive has picked a reviewer for you, use r? to override)

@nielx
Copy link
Contributor Author

nielx commented Jan 13, 2021

@kallisti5 @jessicah @ahwayakchih Since you have contributed to the Haiku bindings before, could you have a look and perhaps add some comments?

@nielx
Copy link
Contributor Author

nielx commented Jan 14, 2021

I'm working on the style and semantic issues pointed out by the CI.

@kallisti5
Copy link
Contributor

This patch looks like an awesome start to Haiku having improved rust support. Our rust toolchain is fairly up to date, and critical rust crates have been receiving patches improving support.

@nielx
Copy link
Contributor Author

nielx commented Jan 16, 2021

Changes since previous push:

  • reorder the file a bit more to be consistent with the other files
  • added some more bindings to the native API (kernel/fs_*.h)
  • checked the validity using the libc-test process. I will send a PR to enable libc-test for Haiku soon.

This change is ready for review.

@kallisti5
Copy link
Contributor

@JohnTitor This one's looking pretty solid and fills in a lot of missing base libc stuff from Haiku. Thoughts?

@JohnTitor
Copy link
Member

JohnTitor commented Jan 27, 2021

Hey, thanks for PR!

@nielx Do you want me to make a new relase for ctest2 so that we can run libc-test here?

@nielx
Copy link
Contributor Author

nielx commented Jan 27, 2021

@JohnTitor That would be appreciated. I have some follow-up work to this commit that adds support for libc-test and that applies some fixes that it pointed out, so if there is a ctest2 package that supports Haiku, it will allow others to reproduce the tests and build on that work.

@JohnTitor
Copy link
Member

Okay, published ctest2 0.4.0.

On the Haiku platform, the POSIX (and BSD) API coexists with the native API,
that has its origins on the BeOS platform. Unlike other UNIX-like platforms,
the native API is not an extension of the POSIX API, but instead exists sui
generis, and many of the POSIX concepts have their own native variety, with
relatively limited interoperability.

Nontheless, the native API coexists in the same library as the standard C and
POSIX functions, namely libroot.so, and therefore this crate is a good place
to add bindings to it.

This commit implements most of Haiku's support kit, the most important parts
of the kernel kit, and a part of the storage kit.
@nielx nielx force-pushed the haiku-native branch 2 times, most recently from c1b2e0d to b4262af Compare January 28, 2021 14:21
@nielx
Copy link
Contributor Author

nielx commented Jan 28, 2021

I added support for Haiku in the testing framework, and the fixes for the issues that it pointed out.

@nielx
Copy link
Contributor Author

nielx commented Feb 8, 2021

@JohnTitor Anything I can do to help you progress this?

@JohnTitor
Copy link
Member

Hey, thanks for the ping!
Could we add a Docker image and tweak the CI config so that we can run CI for Haiku?
One question, it seems this has some breaking changes, does it mean the old definitions are incorrect and won't work anyway? If so, I think this is acceptable. If not (e.g. it has been recently changed), I wonder this breaks some uses.

@nielx
Copy link
Contributor Author

nielx commented Feb 8, 2021

Could we add a Docker image and tweak the CI config so that we can run CI for Haiku?

It should be possible to set up a cross-compiling CI configuration to build libc for Haiku. I don't think it is possible to build and run the tests that way. Haiku is not (yet) virtualizable friendly, so I there's not such a thing as a Haiku VM image yet. I do wonder what the relative value of a continuous CI build would be, but we can certainly try to set it up.

One question, it seems this has some breaking changes, does it mean the old definitions are incorrect and won't work anyway? If so, I think this is acceptable. If not (e.g. it has been recently changed), I wonder this breaks some uses.

The old definitions have always been incorrect.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Okay, thanks for clarifying! Looks good to me now.

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 8, 2021

📌 Commit 813d7d8 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Feb 8, 2021

⌛ Testing commit 813d7d8 with merge 05cc796...

@bors
Copy link
Contributor

bors commented Feb 8, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: JohnTitor
Pushing 05cc796 to master...

@bors bors merged commit 05cc796 into rust-lang:master Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants