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 does not work with docker build #891

Closed
BenD0G opened this issue Nov 28, 2020 · 2 comments
Closed

sccache does not work with docker build #891

BenD0G opened this issue Nov 28, 2020 · 2 comments

Comments

@BenD0G
Copy link

BenD0G commented Nov 28, 2020

Edit: this appears to be a symptom of #887 - changing the first line of the dockerfile to FROM rust:1.47 fixes the issue. Leaving open as I imagine the recent change to latest tag on rust images will catch others out too.

sccache does not appear to work at all in build instructions of dockerfiles - depending on what I try I get errors about sending data to the server, connecting to the server or timeouts waiting for the sccache server to start.

I could have sworn this used to work, but I've tried many variations, and building on both WSL (Docker version 19.03.12, build 48a66213fe) and on Docker Desktop for Windows (Docker version 19.03.13, build 4484c46d9d), all with the same output as below.

sccache --version: sccache 0.2.13

Any help would be greatly appreciated!

Sample Dockerfile and Output

Dockerfile:

FROM rust
RUN cargo install sccache
ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache
RUN USER=root cargo init hello_world
WORKDIR /hello_world
RUN cargo build

Output:

<snip>
#8 [5/5] RUN cargo build
#8 0.365 error: failed to run `rustc` to learn about target-specific information
#8 0.365
#8 0.365 Caused by:
#8 0.365   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)
#8 0.365   --- stderr
#8 0.365   error: failed to execute compile
#8 0.365   caused by: Failed to send data to or receive data from server
#8 0.365   caused by: Failed to read response header
#8 0.365   caused by: failed to fill whole buffer
#8 ERROR: executor failed running [/bin/sh -c cargo build]: runc did not terminate sucessfully
@martin-foerster-rhebo
Copy link

We face exactly the same problem and in our case this was also a symptom of #887.

@glandium
Copy link
Collaborator

Duplicate of #875

@glandium glandium marked this as a duplicate of #875 Dec 11, 2020
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

3 participants