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

cc 1.0.86 seems to erroneously enable parallelism by default on certain platforms #964

Closed
IGI-111 opened this issue Feb 23, 2024 · 2 comments

Comments

@IGI-111
Copy link

IGI-111 commented Feb 23, 2024

Compiling openssl-sys on aarch64-unknown-linux-gnu, which uses cc fails with the following error:

 --- stderr
  make: *** read jobs pipe: Resource temporarily unavailable.  Stop.
  make: *** Waiting for unfinished jobs....
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-300.2.3+3.2.1/src/lib.rs:611:9:



  Error building OpenSSL:
      Command: cd "/target/aarch64-unknown-linux-gnu/release/build/openssl-sys-6a5ed052a12e98be/out/openssl-build/build/src" && MAKEFLAGS="-j --jobserver-fds=7,8 --jobserver-auth=7,8" "make" "build_libs"
      Exit status: exit status: 2

This is a known issue with building openssl on this platform using parallelism:
rust-lang/cargo#13476
sfackler/rust-openssl#2179

However, the parallel feature is not enabled by openssl-sys and compiling with the exact same version of openssl-sys but using cc 1.0.83 succeeds, which leads me to believe there is a breaking change or bug in the 1.0.86 version.

IGI-111 added a commit to FuelLabs/sway that referenced this issue Feb 23, 2024
cc version 1.0.86 has a bug that blocks our cross compilation pipeline
rust-lang/cc-rs#964
@NobodyXu
Copy link
Collaborator

Duplicate of #962 , there's probably another crate that enables feature cc/parallel

To solve this problem once and for all, I believe we need to change rust-lang/jobserver.

A temporary fix can be done here for openssl-sys, by disabling O_NONBLOCK when the jobserver is not used, though it is racy and if you spawn make on another thread it could still fail, but it will work for openssl if its build.rs is single-thread only.

@IGI-111
Copy link
Author

IGI-111 commented Feb 23, 2024

Indeed after some investigation I think I found another crate that enables it in my own build, since building openssl-sys on its own does not fail.

In this case it was libgit2-sys, which does so even when configured to vendor openssl.

Since this doesn't seem to be a cc issue, I'll close this.

Good luck trying to fix this permanently and thanks for the pointers.

@IGI-111 IGI-111 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
IGI-111 added a commit to FuelLabs/sway that referenced this issue Feb 23, 2024
cc version 1.0.86 has a bug that blocks our cross compilation pipeline
rust-lang/cc-rs#964
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

No branches or pull requests

2 participants