sccache: Bug when Compiling rust-mozjs

I seem to be getting a weird error when running cargo build --release -vv on rust-mozjs and I’m not sure why.

sccache: encountered fatal error
sccache: error: Not an archive file (invalid global header)
sccache: caused by: Not an archive file (invalid global header)

Here’s a gist with the full output: https://gist.github.com/Redfire75369/679cbd87bae84cd8eb509647ab1ab1f3 Here’s a gist when running without -vv: https://gist.github.com/Redfire75369/840a10759351b1bb8970c820da6f7a5f

The build works fine without sccache but this happens when sccache is added as build.rustc-wrapper and set CCACHE=sccache.

UPDATE: I tested with only CCACHE=sccache and removing `build.rustc-wrapper=“sccache” and the build succeeds.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

Ok, I’ve got a minimal reproducer:

Cargo.toml:

[package]
name = "openssl-universal"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
openssl-sys = "0.9.87"

src/main.rs:

fn main() {
    println!("Hello, world!");
}

Build steps:

~/p/h/openssl-universal ❯❯❯ RUSTC_WRAPPER=sccache OPENSSL_DIR=(pwd)/ossl/ cargo check
    Checking openssl-sys v0.9.87
sccache: encountered fatal error
sccache: error: Not an archive file (invalid global header)
sccache: caused by: Not an archive file (invalid global header)
error: could not compile `openssl-sys`

Caused by:
  process didn't exit successfully: `sccache rustc --crate-name openssl_sys --edition=2018 /Users/alex_gaynor/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.87/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=135 --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=12560415109ccd92 -C extra-filename=-12560415109ccd92 --out-dir /Users/alex_gaynor/projects/hack/openssl-universal/target/debug/deps -L dependency=/Users/alex_gaynor/projects/hack/openssl-universal/target/debug/deps --extern libc=/Users/alex_gaynor/projects/hack/openssl-universal/target/debug/deps/liblibc-f23871325ead10a5.rmeta --cap-lints allow -L native=/Users/alex_gaynor/projects/hack/openssl-universal/ossl/lib -l static=ssl -l static=crypto --cfg openssl --cfg 'osslconf="OPENSSL_NO_COMP"' --cfg 'osslconf="OPENSSL_NO_SSL3_METHOD"' --cfg ossl300 --cfg ossl101 --cfg ossl102 --cfg ossl102f --cfg ossl102h --cfg ossl110 --cfg ossl110f --cfg ossl110g --cfg ossl110h --cfg ossl111 --cfg ossl111b --cfg ossl111c` (exit status: 254)

ossl/ dir contains an unzipped copy of the universal2 OpenSSL from the latest build on https://github.com/pyca/infra/actions/workflows/build-macos-openssl.yml

same. maybe @glandium knows