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

Fix nix on FreeBSD (rebased on master) #397

Merged
merged 3 commits into from
Aug 11, 2016
Merged

Fix nix on FreeBSD (rebased on master) #397

merged 3 commits into from
Aug 11, 2016

Conversation

fiveop
Copy link
Contributor

@fiveop fiveop commented Aug 10, 2016

No description provided.

Rules for generic types were located above rules for specific types, so the
rules for specific types never got matched.  This caused the
sys::socket::sockopt::test::can_get_listen_on_tcp_socket test to fail on
FreeBSD.  The solution is to put all of the generic rules at the bottom.
On Linux, the cmsg_len field of struct cmsghdr has type size_t, but it
has size socklen_t on POSIX-compliant operating systems.  So on
POSIX-compliant 64-bit operating systems, struct cmsghdr has padding
gaps that aren't present on Linux.  Most of the issues fixed by this
commit related to those gaps.

src/sys/socket/ffi.rs
	Fix the type of the cmsg_data field so the struct layout will be
	correct.

src/sys/socket/mod.rs
	In CmsgIterator.next, only return a single file descriptor.
	sendmsg(2) can only stuff a single file descriptor into each
	cmsg.

	In cmsg_align, fix the rounding calculation, and eliminate a
	division instruction.

	Add a missing cmsg_align call in ControlMessage.len

	In ControlMessage.encode_into, add any necessary padding bytes
	between the cmsghdr and the data.

	In sendmsg, fix some len<->capacity confusion.
@fiveop
Copy link
Contributor Author

fiveop commented Aug 10, 2016

@posborne could you have a look at the build failures. Given that the failing builds, fail due to some problems with docker images you created, you probably know what the problem is.

@posborne
Copy link
Member

@posborne could you have a look at the build failures. Given that the failing builds, fail due to some problems with docker images you created, you probably know what the problem is.

Strange. I'll try to figure out what is going on. Thanks for the rebase.

@posborne
Copy link
Member

Update: Looks like there was a change to remove the /.dockerinit file in newer version of docker which is why this is failing. I'll prepare a PR that fixes that. moby/moby#18355

@fiveop
Copy link
Contributor Author

fiveop commented Aug 11, 2016

@homu r=@posborne

@homu
Copy link
Contributor

homu commented Aug 11, 2016

📌 Commit 077d979 has been approved by @posborne

@homu
Copy link
Contributor

homu commented Aug 11, 2016

⌛ Testing commit 077d979 with merge 1ae7f8e...

homu added a commit that referenced this pull request Aug 11, 2016
Fix nix on FreeBSD (rebased on master)
@fiveop fiveop mentioned this pull request Aug 11, 2016
@homu
Copy link
Contributor

homu commented Aug 11, 2016

☀️ Test successful - status

@homu homu merged commit 077d979 into nix-rust:master Aug 11, 2016
@posborne
Copy link
Member

Thanks @asomers @fiveop

@posborne
Copy link
Member

As an FYI, I'm taking a fresh look at some of the docker stuff to see if I can come up with some kind of circus act in order to get some BSD builds into the mix.

@fiveop fiveop deleted the asomers_master branch October 15, 2016 17:48
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.

4 participants