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

add support of RustyHermit's BSD socket layer #107405

Merged
merged 4 commits into from
Feb 25, 2023
Merged

Conversation

stlankes
Copy link
Contributor

RustyHermit is a tier 3 platform and publishes a new kernel interface. The new version supports a common BSD socket layer. By supporting this interface, the implementation of std can be harmonized to other operating systems. In sys_common/mod.rs we remove only a special case for RustyHermit. All changes are done in the RustyHermit specific directories.

To realize this socket layer, the handling of file descriptors is also harmonized to other operating systems.

@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 28, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs


[[package]]
name = "hermit-abi"
version = "0.3.0"
Copy link
Member

Choose a reason for hiding this comment

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

We will now have all three versions of hermit-abi required at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you are right. I will write PRs to upgrade num_cpus etc.

@stlankes
Copy link
Contributor Author

The last commit is more a suggestion from my side. I am not sure, where I should store the AsFd and similar traits. I trie to harmonize my implementation to other implementations.

@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2023
@Mark-Simulacrum
Copy link
Member

Please mark with @rustbot ready when this is ready for review -- looks like maybe some dependency upgrades are still in progress?

@stlankes
Copy link
Contributor Author

Ok, I will do it. However is-terminal depends on io-lifetimes. To update io-lifetimes I need the fd traits from the current PR. (hermit-os/io-lifetimes@dd05273).

@stlankes
Copy link
Contributor Author

@Mark-Simulacrum If I understand it correctly, atty is not longer maintained and not all crates moved to is-terminal. In addition, is-terminal depends indirectly from this PR (see above). How do you handle it?

@Mark-Simulacrum
Copy link
Member

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 31, 2023
@Mark-Simulacrum
Copy link
Member

@bjorn3 is there a reason I'm missing we shouldn't just land this PR, and then follow-up with dropping hermit-abi dependencies once the ecosystem syncs back up?

@bjorn3
Copy link
Member

bjorn3 commented Feb 12, 2023

That would work.

The changes in files not specific to hermit look correct to me. For the hermit specific files I didn't notice anything obviously wrong, but also didn't review it as closely. Given that RustyHermit is a tier 3 target and the PR author is a maintainer of RustyHermit, I think this is fine.

@bors r+

@bors
Copy link
Contributor

bors commented Feb 12, 2023

📌 Commit dd270f1f440831cd4b491185b2fa2c35b6bfd503 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 12, 2023
@bors
Copy link
Contributor

bors commented Feb 12, 2023

⌛ Testing commit dd270f1f440831cd4b491185b2fa2c35b6bfd503 with merge 3103afcd69f7155552cd4c91f644f1c2c4a8628c...

@bors
Copy link
Contributor

bors commented Feb 18, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 18, 2023
@rust-log-analyzer

This comment has been minimized.

Comment on lines 18 to 21
#[cfg(target_os = "hermit")]
use hermit_abi::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
#[cfg(not(target_os = "hermit"))]
use libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
Copy link
Contributor

Choose a reason for hiding this comment

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

The CI issue happens when documenting std on Windows. std::os::fd exists even on Windows with cfg(doc). We might work around like this:

Suggested change
#[cfg(target_os = "hermit")]
use hermit_abi::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
#[cfg(not(target_os = "hermit"))]
use libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
#[cfg(target_os = "hermit")]
use hermit_abi as libc;

This, together with changing the FILENOs back to libc::*_FILENO, should solve the windows docs issue.

@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

RustHermit publishs a new kernel interface and supports
a common BSD socket layer. By supporting this interface,
the implementation can be harmonized to other operating systems.

To realize this socket layer, the handling of file descriptors
is also harmonized to other operating systems.
By moving the IO traits, the RustyHermit support is harmonized to
of other operating systems.
@stlankes
Copy link
Contributor Author

@bjorn3 I think that @mkroening's comment is correct. The documentation was broken.

@bjorn3
Copy link
Member

bjorn3 commented Feb 25, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2023

📌 Commit af8ee64 has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 25, 2023
@bors
Copy link
Contributor

bors commented Feb 25, 2023

⌛ Testing commit af8ee64 with merge 34e6673...

@bors
Copy link
Contributor

bors commented Feb 25, 2023

☀️ Test successful - checks-actions
Approved by: bjorn3
Pushing 34e6673 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 25, 2023
@bors bors merged commit 34e6673 into rust-lang:master Feb 25, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 25, 2023
@mkroening mkroening deleted the bsd branch February 25, 2023 23:58
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (34e6673): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 20, 2023
dependencies: reduce the amount of crates pulling in atty

It would be nice to have only one `hermit-abi` in `Cargo.lock` (rust-lang#107405 (comment)).

The only crate pulling in the old `hermit-abi` version is `atty`, which is unmaintained.

This PR upgrades three dependencies, which then no longer depend on `atty`:
* `Cargo.lock`: `colored v2.0.0 -> v2.0.4`
* `Cargo.lock`: `tracing-tree v0.2.3 -> v0.2.4`
* Miri: `env_logger 0.9.3 -> 0.10.0`

The only dependency chain left that pulls in `hermit-abi 0.1.19` is:
`hermit-abi 0.1.19` -> `atty 0.2.14` -> `env_logger 0.7.1` -> `jsonpath_lib 0.2.6` -> `jsondocck 0.1.0` (src/tools/jsondocck)

Replacing jsondocck with jsondocckng is tracked in rust-lang#94140.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 21, 2023
dependencies: reduce the amount of crates pulling in atty

It would be nice to have only one `hermit-abi` in `Cargo.lock` (rust-lang/rust#107405 (comment)).

The only crate pulling in the old `hermit-abi` version is `atty`, which is unmaintained.

This PR upgrades three dependencies, which then no longer depend on `atty`:
* `Cargo.lock`: `colored v2.0.0 -> v2.0.4`
* `Cargo.lock`: `tracing-tree v0.2.3 -> v0.2.4`
* Miri: `env_logger 0.9.3 -> 0.10.0`

The only dependency chain left that pulls in `hermit-abi 0.1.19` is:
`hermit-abi 0.1.19` -> `atty 0.2.14` -> `env_logger 0.7.1` -> `jsonpath_lib 0.2.6` -> `jsondocck 0.1.0` (src/tools/jsondocck)

Replacing jsondocck with jsondocckng is tracked in rust-lang/rust#94140.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants