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

error while building app #2184

Closed
Masber opened this issue Feb 22, 2024 · 22 comments
Closed

error while building app #2184

Masber opened this issue Feb 22, 2024 · 22 comments

Comments

@Masber
Copy link

Masber commented Feb 22, 2024

Dear rust-openssl community,

I have a github pipeline to build the artifacts of my application, for some reason the pipeline fails when building the binaries for the apple target.

 error: failed to run custom build command for `openssl-sys v0.9.101`

Caused by:
  process didn't exit successfully: `/Users/runner/work/manta/manta/target/dist/build/openssl-sys-48e4210274a29364/build-script-main` (exit status: 101)

and

  --- stderr
  make: *** read jobs pipe: Resource temporarily unavailable.  Stop.
  make: *** Waiting for unfinished jobs....
  thread 'main' panicked at /Users/runner/.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 "/Users/runner/work/manta/manta/target/x86_64-apple-darwin/dist/build/openssl-sys-a8c5a16dc1fd68a5/out/openssl-build/build/src" && MAKEFLAGS="-j --jobserver-fds=15,20 --jobserver-auth=15,20" "make" "build_libs"
      Exit status: exit status: 2


      
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
  × failed to find bin manta (manta 1.22.16 (path+file:///Users/runner/work/manta/manta)) -- did the cargo build above
  │ have errors?

Full pipeline output can be seen here https://github.com/eth-cscs/manta/actions/runs/8004159748/job/21860989556#step:8:607

Any advice?

thank you very much

@Skepfyr
Copy link
Collaborator

Skepfyr commented Feb 22, 2024

It looks like you've hit the same issue as #2179, which appears to be caused by an issue with the cc crate, although you might be able to workaround it by disabling the parallel feature. It might be worth raising this with cc directly (if it hasn't been done already).

@Masber
Copy link
Author

Masber commented Feb 23, 2024

but rust-openssl is the one using cc as a dependency, I think it is also in their benefit to contact the developers of cc crate? I checked and I have the impression the cc developers are already working in a solution

@Skepfyr
Copy link
Collaborator

Skepfyr commented Feb 23, 2024

Yeah ok looks like this will be fixed by rust-lang/cc-rs#962

@NobodyXu
Copy link

cc 1.0.87 has released which shall fix this.

@Skepfyr
Copy link
Collaborator

Skepfyr commented Feb 24, 2024

@Masber can you check that this has fixed the issue for you. I can't see why it wouldn't but best to check.

@ohsayan
Copy link

ohsayan commented Feb 24, 2024

Tuning in here because we also had one of our builds crash as well after bumping the openssl dependency (src)

@NobodyXu
Copy link

NobodyXu commented Feb 24, 2024

I checked the commit triggering the build and I see that both cc and openssl(-src) is bumped.

That's strange because cc 1.0.87 should fix that by only setting O_NONBLOCK when Build::try_compile* is called, and AFAIK openssl-src does not call any compile function from cc.

Original:
@ohsayan Did it work before bumping openssl-src, while using cc 1.0.87?

NobodyXu added a commit to rust-lang/cc-rs that referenced this issue Feb 24, 2024
It could be the reason why the failure still happens in sfackler/rust-openssl#2184 (comment)
@NobodyXu
Copy link

@ohsayan can you try rust-lang/cc-rs#973 to see if it fixes your issue?

ohsayan added a commit to skytable/skytable that referenced this issue Feb 25, 2024
OpenSSL fails to build on macOS due to issues with parallel builds.

Context:
- sfackler/rust-openssl#2184
- rust-lang/cc-rs#973
@ohsayan
Copy link

ohsayan commented Feb 25, 2024

@NobodyXu Reverted dependency updates to openssl-* and cc as well. Builds are passing with this change.

@NobodyXu

This comment has been minimized.

@NobodyXu
Copy link

I got absolutely no idea why it fails.

I checked the openssl-src, it doesn't call Build::compile anywhere so cc won't even try to build jobserver, let alone setting O_NONBLOCK on it.

@ohsayan
Copy link

ohsayan commented Feb 25, 2024

Tested separately. As soon as I bump OpenSSL, the build fails (see this workflow run).

The only change that was made:

- openssl = { version = "0.10.63", features = ["vendored"] }
+ openssl = { version = "0.10.64", features = ["vendored"] }

and after a cargo update, cc was updated in the lockfile:

[[package]]
name = "cc"
- version = "1.0.83"
+ version = "1.0.87"

@NobodyXu
Copy link

Can you test rust-lang/cc#975 please?

It should finally fix the bug.

@ohsayan

This comment was marked as resolved.

@NobodyXu
Copy link

@ohsayan I'm not sure if specify a git dependency in your project works, I think you might need to use patch.crates-io instead.

checking your Cargo.lock, you got two cc, one is 1.0.87, another is git version of it.

@ohsayan
Copy link

ohsayan commented Feb 25, 2024

@NobodyXu my bad, I'll use an override (patch) and see. I'll get back to you in a moment.

@ohsayan
Copy link

ohsayan commented Feb 25, 2024

@NobodyXu confirming that this change indeed fixes the build

@NobodyXu
Copy link

cc 1.0.88 has released!

@frol
Copy link

frol commented Feb 26, 2024

Users of my CLI have just also reported and I confirmed that I still see this error even though I have cc v1.0.88 (only one) and openssl-sys v0.9.101. Here is the command to reproduce:

cargo install cargo-near

@brynary
Copy link

brynary commented Feb 26, 2024

This error is still occurring for mv on cc v1.0.88 as well

@leighmcculloch
Copy link

This error still occurred for me on cc v1.0.87, and v1.0.88. Upgrading to v1.0.95 resolved it though.

@Skepfyr
Copy link
Collaborator

Skepfyr commented May 7, 2024

The last few comments suggest to me this is resolved, I'm on a little bit of a spring clean so I'm going to say thank you to @NobodyXu and close this. If this isn't resolved for some reason feel free to re-open/comment.

@Skepfyr Skepfyr closed this as completed May 7, 2024
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

7 participants