Skip to content

haiku: Fix sockaddr_in/sockaddr_in6; Solves #108 #109

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 1 commit into from
Dec 9, 2020

Conversation

kallisti5
Copy link
Contributor

Bugfix only, solves final remaining build issues under Haiku (a new Rust platform)

/Data/Code/net2-rs> cargo test
   Compiling libc v0.2.81
   Compiling cfg-if v0.1.10
   Compiling net2 v0.2.36 (/Data/Code/net2-rs)
    Finished test [unoptimized + debuginfo] target(s) in 3.53s
     Running target/debug/deps/net2-11767bb81e44864e

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/all-83c169dcd3ae1663

running 2 tests
test smoke_build_listener ... ok
test smoke_build_listener_v6 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests net2

running 1 test
test src/lib.rs - (line 27) ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@kallisti5
Copy link
Contributor Author

Historic information I was able to dig up:

sin_zero is 24 under Haiku because our network stack was originally based on the BeOS "bone" network stack circa 2001. The sin_zero was an early attempt at preperation for IPv6 before the common tatic of appending 6 in the POSIX api's.

(they were expecting ipv6 to use sockaddr_in instead of making a new sockaddr_in6)

@pfmooney I know time is running out on these crates... but a lot of stuff still references net2-rs and a broken net2 create means a lot doesn't compile under Haiku.

Thanks!

@kallisti5
Copy link
Contributor Author

Oh.. I just got word something simular was just fixed in socket2-rs:

rust-lang/socket2#136

@pfmooney
Copy link
Member

pfmooney commented Dec 8, 2020

@pfmooney I know time is running out on these crates... but a lot of stuff still references net2-rs and a broken net2 create means a lot doesn't compile under Haiku.

Deprecated means we won't be merging feature additions or big refactors (if we can help it), but fixes like are absolutely covered under the mission of sustaining maintenance.

Thanks for submitting it with all the context info

@pfmooney pfmooney self-assigned this Dec 8, 2020
@kallisti5
Copy link
Contributor Author

Ah. Thanks for the clairification! I saw the new deprecrated owner and was wondering if it was a march towards the repo being read-only.

Let me know if you see anything off here. Thanks for maintaining these old but important crates!

src/socket.rs Outdated
#[cfg(target_os = "haiku")]
sin_zero: [0; 24],
#[cfg(not(target_os = "haiku"))]
Copy link
Member

Choose a reason for hiding this comment

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

Sorry to pick a style nit like this, but would you mind swapping the order on these, so the more common not-haiku comes first in the order?

@kallisti5
Copy link
Contributor Author

No worries :-) Done. Thanks!

@pfmooney pfmooney merged commit 6081dff into deprecrated:master Dec 9, 2020
@pfmooney
Copy link
Member

pfmooney commented Dec 9, 2020

No worries :-) Done.

Thanks.

Are you looking for a release after this, or are there other haiku-related fixes you might have in the pipeline?

@kallisti5
Copy link
Contributor Author

nothing else really at the moment. To be honest, i'm not really sure how these fixes got missed. I'm pretty sure Haiku was cargo test'ing ok with the last round of patches.

Haiku is at Rust 1.48.0, so the port is pretty recent. I think we're cross-compiling our rust toolchain from Linux still though... not sure why. (i can dig into that)

https://github.com/haikuports/haikuports/blob/master/dev-lang/rust_bin/rust_bin-1.48.0.recipe

@pfmooney
Copy link
Member

pfmooney commented Dec 9, 2020

Released in v0.2.37

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.

2 participants