diff --git a/.github/workflows/neon_extra_builds.yml b/.github/workflows/neon_extra_builds.yml index 7d2187e59c..ce66aac549 100644 --- a/.github/workflows/neon_extra_builds.yml +++ b/.github/workflows/neon_extra_builds.yml @@ -357,7 +357,7 @@ jobs: env: BUILD_TYPE: release - # remove the cachepot wrapper and build without crate caches + # remove the sccache wrapper and build without crate caches RUSTC_WRAPPER: "" # build with incremental compilation produce partial results # so do not attempt to cache this build, also disable the incremental compilation diff --git a/Dockerfile b/Dockerfile index b4900d4a94..97cc6df03a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,13 +29,13 @@ WORKDIR /home/nonroot ARG GIT_VERSION=local ARG BUILD_TAG -# Enable https://github.com/paritytech/cachepot to cache Rust crates' compilation results in Docker builds. -# Set up cachepot to use an AWS S3 bucket for cache results, to reuse it between `docker build` invocations. -# cachepot falls back to local filesystem if S3 is misconfigured, not failing the build -ARG RUSTC_WRAPPER=cachepot -ENV AWS_REGION=eu-central-1 -ENV CACHEPOT_S3_KEY_PREFIX=cachepot -ARG CACHEPOT_BUCKET=neon-github-dev +# Enable https://github.com/mozilla/sccache to cache Rust crates' compilation results in Docker builds. +# Set up sccache to use an AWS S3 bucket for cache results, to reuse it between `docker build` invocations. +# sccache falls back to local filesystem if S3 is misconfigured, not failing the build +ARG RUSTC_WRAPPER=sccache +ARG SCCACHE_REGION=eu-central-1 +ARG SCCACHE_S3_KEY_PREFIX=sccache +ARG SCCACHE_BUCKET=neon-github-dev #ARG AWS_ACCESS_KEY_ID #ARG AWS_SECRET_ACCESS_KEY @@ -45,7 +45,7 @@ COPY --from=pg-build /home/nonroot/pg_install/v16/include/postgresql/server pg_i COPY --chown=nonroot . . # Show build caching stats to check if it was used in the end. -# Has to be the part of the same RUN since cachepot daemon is killed in the end of this RUN, losing the compilation stats. +# Has to be the part of the same RUN since sccache daemon is killed in the end of this RUN, losing the compilation stats. RUN set -e \ && RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,--no-rosegment" cargo build \ --bin pg_sni_router \ @@ -57,7 +57,7 @@ RUN set -e \ --bin proxy \ --bin neon_local \ --locked --release \ - && cachepot -s + && sccache -s # Build final image # diff --git a/Dockerfile.build-tools b/Dockerfile.build-tools index f85706ef6a..d17832ce25 100644 --- a/Dockerfile.build-tools +++ b/Dockerfile.build-tools @@ -184,7 +184,7 @@ RUN curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux . "$HOME/.cargo/env" && \ cargo --version && rustup --version && \ rustup component add llvm-tools-preview rustfmt clippy && \ - cargo install --git https://github.com/paritytech/cachepot && \ + cargo install sccache && \ cargo install rustfilt && \ cargo install cargo-hakari && \ cargo install cargo-deny --locked && \ @@ -192,7 +192,7 @@ RUN curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux cargo install cargo-nextest && \ rm -rf /home/nonroot/.cargo/registry && \ rm -rf /home/nonroot/.cargo/git -ENV RUSTC_WRAPPER=cachepot +ENV RUSTC_WRAPPER=sccache # Show versions RUN whoami \ diff --git a/libs/utils/src/lib.rs b/libs/utils/src/lib.rs index 2953f0aad4..0874e811ce 100644 --- a/libs/utils/src/lib.rs +++ b/libs/utils/src/lib.rs @@ -124,9 +124,9 @@ pub mod poison; /// /// ############################################################################################# /// TODO this macro is not the way the library is intended to be used, see for details. -/// We use `cachepot` to reduce our current CI build times: +/// We use `sccache` to reduce our current CI build times: /// Yet, it seems to ignore the GIT_VERSION env variable, passed to Docker build, even with build.rs that contains -/// `println!("cargo:rerun-if-env-changed=GIT_VERSION");` code for cachepot cache invalidation. +/// `println!("cargo:rerun-if-env-changed=GIT_VERSION");` code for sccache cache invalidation. /// The problem needs further investigation and regular `const` declaration instead of a macro. #[macro_export] macro_rules! project_git_version { diff --git a/storage_broker/build.rs b/storage_broker/build.rs index 08dadeacd5..93ca4136ab 100644 --- a/storage_broker/build.rs +++ b/storage_broker/build.rs @@ -2,7 +2,7 @@ fn main() -> Result<(), Box> { // Generate rust code from .proto protobuf. // // Note: we previously tried to use deterministic location at proto/ for - // easy location, but apparently interference with cachepot sometimes fails + // easy location, but apparently interference with sccache sometimes fails // the build then. Anyway, per cargo docs build script shouldn't output to // anywhere but $OUT_DIR. tonic_build::compile_protos("proto/broker.proto")