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 the tests with libc 0.2.49 and Rust 1.33.0 #1033

Merged
merged 4 commits into from
Mar 4, 2019

Conversation

asomers
Copy link
Member

@asomers asomers commented Mar 1, 2019

Several symbols are now marked as deprecated on OSX.

@asomers
Copy link
Member Author

asomers commented Mar 1, 2019

This should fix PR #1031

@asomers
Copy link
Member Author

asomers commented Mar 1, 2019

Can one of the @nix-rust/nix-maintainers with an OSX machine please verify whether Nix 0.13.0 can even build with libc 0.2.49?

@asomers
Copy link
Member Author

asomers commented Mar 1, 2019

Ok, I'm stumped. Why didn't the #[allow(deprecated)] fix the tests on OSX?

@Susurrus
Copy link
Contributor

Susurrus commented Mar 1, 2019 via email

@asomers
Copy link
Member Author

asomers commented Mar 1, 2019

That would indeed be helpful. But don't bother with my first question; 0.13.0 should still work fine, because we only #[deny(warnings)] during #[cfg(test)].

@asomers
Copy link
Member Author

asomers commented Mar 3, 2019

Ok, I'm an idiot. I never actually committed the important part.

@asomers
Copy link
Member Author

asomers commented Mar 3, 2019

The Linux failure looks like a regression in Cargo 1.33.0. I'll fix it.

@asomers
Copy link
Member Author

asomers commented Mar 4, 2019

It looks like Cargo <= 1.32.0 would create a new thread for every test, even if --test-threads=1. And in-between tests it would destroy the test thread and recreate it. But Cargo 1.33.0 skips creating a new thread when --test-threads=1. And even if --test-threads=1, it reuses threads for multiple tests. This has exposed a failure to teardown some per-thread data in one of our unit tests.

Weirdly, this is a case where --test-threads=1 is more likely to make the test fail.

Several symbols are now marked as deprecated on OSX.  Fix the build by
marking these symbols' Nix wrappers as deprecated, too.
Previous versions of Cargo would create and destroy a new thread for
each test.  Cargo 1.33.0 instead creates a thread pool and reuses the
same thread for multiple tests.  Some Nix tests that changed the
per-thread sigmask began to fail as a result, because they didn't do any
cleanup.

The easiest solution is to spawn a new thread for each of those tests.
It was disabled long ago and nobody remembered to reenable it.  I'm
guessing it's fixed by now.
@asomers asomers changed the title Fix the build on OSX with libc 0.2.49 Fix the tests with libc 0.2.49 and Rust 1.33.0 Mar 4, 2019
@asomers
Copy link
Member Author

asomers commented Mar 4, 2019

bors r+

bors bot added a commit that referenced this pull request Mar 4, 2019
1033: Fix the tests with libc 0.2.49 and Rust 1.33.0 r=asomers a=asomers

Several symbols are now marked as deprecated on OSX.

Co-authored-by: Alan Somers <asomers@gmail.com>
@bors
Copy link
Contributor

bors bot commented Mar 4, 2019

Build succeeded

@bors bors bot merged commit 439b930 into nix-rust:master Mar 4, 2019
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.

None yet

2 participants