Skip to content

Commit

Permalink
adding sccache to greatly increase cargo build runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Voiculescu committed Jun 4, 2024
1 parent a4736fe commit 31cf20b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Dockerfile.remotebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ RUN rustup component add rustfmt && cargo install rustfmt || true
RUN rustup default stable

# Install build essentials and curl
RUN apk update && apk add curl build-base
RUN apk update && apk add curl build-base sccache

# Set the Shared Compilation Cache for Cargo to use sccache
# This greatly improves build times when running concurrent builds
ENV RUSTC_WRAPPER=/usr/bin/sccache

# Install buf
RUN GO111MODULE=on GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/[email protected]
Expand Down
1 change: 1 addition & 0 deletions cmd/substreams/remote-build.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func remoteBuildE(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to read file: %w", err)
}

fmt.Println("Sending build request ...")
client := pbbuild.NewBuildServiceClient(conn)
buildResponse, err := client.Build(context.Background(), &pbbuild.BuildRequest{
SourceCode: b,
Expand Down
2 changes: 1 addition & 1 deletion remotebuild/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *Server) Build(
} else {
s.logger.Info("keeping temp dir", "dir", tempDir)
}

s.logger.Debug("temp dir", "dir", tempDir)
s.logger.Debug("source code size", "size", len(req.Msg.SourceCode))
err = unzip(req.Msg.SourceCode, tempDir)
if err != nil {
Expand Down

0 comments on commit 31cf20b

Please sign in to comment.