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

rust: update jobserver-rs for rust platform builds #34505

Closed
wants to merge 2 commits into from

Conversation

bennofs
Copy link
Contributor

@bennofs bennofs commented Feb 1, 2018

Motivation for this change

This fixes the following error that sometimes occurred during rust builds with nix:

thread '<unnamed>' panicked at 'failed to acquire jobserver token: Resource temporarily unavailable (os error 11)', src/librustc_trans/back/write.rs:1619:28
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to acquire jobserver token: Resource temporarily unavailable (os error 11)

I can cleanup the changes to cargo / rust build support before merging if the general idea for these changes is accepted.

Cargo is now built from the rust source tarball as that's the way upstream recommends, see rust-lang/cargo@5c9665f#commitcomment-27271420 and it also needs the patch so it was easiest to just make it use the same source tree.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This commit updates the jobserver library used for building the rust platform
to version 0.1.9, which fixes the following error that sometimes happens during
large builds:

```
thread '<unnamed>' panicked at 'failed to acquire jobserver token: Resource temporarily unavailable (os error 11)', src/librustc_trans/back/write.rs:1619:28
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to acquire jobserver token: Resource temporarily unavailable (os
error 11)
```
# patches that apply to both cargo and rustc
commonPatches = [
# this patch can be removed when rustc is upgraded to 1.23
./patches/1.22.1-update-vendored-jobserver.patch
Copy link
Member

Choose a reason for hiding this comment

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

rustc is released since 4. January.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but I didn't feel confident enough to do a rustc upgrade. If you want to do that instead, go for it. Also note that this bug affects bootstrapping as well, so you'll probably need to use the 1.23 binaries itself for bootstrapping.

Copy link
Member

Choose a reason for hiding this comment

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

Those are necessary now anyway as we have rustc 1.24 now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay we can close the PR then

@Mic92
Copy link
Member

Mic92 commented Feb 16, 2018

You're changes are included in #35030
Looks good so far.

@Mic92 Mic92 closed this Feb 16, 2018
@Mic92 Mic92 mentioned this pull request Feb 16, 2018
8 tasks
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Feb 28, 2018
`uutils-coreutils` is an a cross-platform rewrite of GNU/coreutils based
on Rust. It aims to increase portability and improve Windows support
(see https://github.com/uutils/coreutils#why).

Since the derivation provides the same binaries as `coreutils` does a
`prefix` argument as been added to the function to avoid any conflicts
that can be used like this:

``` nix
self: super:
{
  uutils-coreutils = self.uutils-coreutils.override { prefix = "uutils"; };
}
```

Resolves NixOS#28114 /cc @NeQuissimus

-----
Important notice: the patch depends on NixOS#34505 which needs to be merged
*FIRST* as it fixes a bug in the `rustc` setup of nixpkgs (see the PR's
discussion and rust-lang/cargo@5c9665f#commitcomment-27271420 for further reference).
@bennofs bennofs deleted the rust-update-jobserver branch April 6, 2018 09:29
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

3 participants