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

sccache v0.2.13 does not work when built with rustc 1.48 #887

Closed
SomeoneToIgnore opened this issue Nov 20, 2020 · 5 comments
Closed

sccache v0.2.13 does not work when built with rustc 1.48 #887

SomeoneToIgnore opened this issue Nov 20, 2020 · 5 comments

Comments

@SomeoneToIgnore
Copy link

SomeoneToIgnore commented Nov 20, 2020

The same dummy "hello world" project + sccache does not work for rustc 1.48 but works for 1.47.

Here's a minimal example:

Create the script locally:

#! /usr/bin/env bash

set -e
set -x

env USER=test-user cargo new test-project --bin
cd test-project
echo "Running without sccache"
cargo run
cargo clean
cargo install sccache
echo "Running with sccache"
RUSTC_WRAPPER="/usr/local/cargo/bin/sccache" cargo run
sccache -s

and then run it in Docker:

docker run --rm -v $(pwd)/test-sccache.sh:/test-sccache.sh rust:1.47 /test-sccache.sh

docker run --rm -v $(pwd)/test-sccache.sh:/test-sccache.sh rust:1.48 /test-sccache.sh

Expected: both runs work identically and finish successfully

Actual: 1.47 version works as expected, 1.48 version fails on the RUSTC_WRAPPER="/usr/local/cargo/bin/sccache" cargo run step:

Running with sccache
+ echo 'Running with sccache'
+ RUSTC_WRAPPER=/usr/local/cargo/bin/sccache
+ cargo run
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/usr/local/cargo/bin/sccache rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 2)
  --- stderr
  error: failed to execute compile
  caused by: Failed to send data to or receive data from server
  caused by: Failed to read response header
  caused by: failed to fill whole buffer
rockstar added a commit to rockstar/flux that referenced this issue Nov 24, 2020
Rust 1.48 was released a few days ago. This patch adds the fixes that
will get flux passing in CI again. The following things needed
addressed:

  - There is a new lint introduced that checks for `push_str` on a
single char `str`, and recommends using `push` instead.
  - There is an open issue with `sccache` and rust 1.48. As a result,
`sccache` is desabled for now. See mozilla/sccache#887
@drahnr
Copy link
Collaborator

drahnr commented Nov 24, 2020

@SomeoneToIgnore going to look into that later tonight/early tomorrow.

Could you check if the latest master works though? And see which unit tests fail?

Looking into the release notes, there are some potential cli flag changes that could cause the failure https://github.com/rust-lang/rust/releases/tag/1.48.0

@SomeoneToIgnore
Copy link
Author

It does work actually, thanks for the tip.

So it's the release that we need.

@drahnr
Copy link
Collaborator

drahnr commented Nov 24, 2020

Unfortunately, yes - but I'd recommend to read #876

rockstar added a commit to influxdata/flux that referenced this issue Nov 24, 2020
Rust 1.48 was released a few days ago. This patch adds the fixes that
will get flux passing in CI again. The following things needed
addressed:

  - There is a new lint introduced that checks for `push_str` on a
single char `str`, and recommends using `push` instead.
  - There is an open issue with `sccache` and rust 1.48. As a result,
`sccache` is desabled for now. See mozilla/sccache#887
@bossmc
Copy link

bossmc commented Dec 3, 2020

In case people are interested this looks like a breaking (actually the old behaviour was UB so this isn't breaking) change in rust 1.48 (rust-lang/rust#71274) where mem::uninitialized now panics if the type can't hold the zero value:

$ SCCACHE_LOG=debug SCCACHE_START_SERVER=1 SCCACHE_NO_DAEMON=1 target/debug/sccache
thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<std::ffi::OsString, u64>` uninitialized, which is invalid', /home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(I assume OsString is a NonNull<u8> or similar).

Until (unless?) Mozilla cut a new release there is a pre-built binary alongside each release (e.g. at https://github.com/mozilla/sccache/releases/tag/0.2.13) that works, or you can use master or @drahnr's fork at https://github.com/paritytech/sccache.

EdenEast added a commit to EdenEast/nyx that referenced this issue Dec 10, 2020
@glandium
Copy link
Collaborator

Duplicate of #875

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

4 participants