Skip to content

Commit 1cac766

Browse files
Merge upstream develop
2 parents 023cf0c + 7855fc6 commit 1cac766

8 files changed

Lines changed: 92 additions & 106 deletions

File tree

.gitlab-ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ stages:
2525
variables:
2626
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
2727
CARGO_TARGET_DIR: ${CI_PROJECT_DIR}/target
28+
SCCACHE_DIR: ${CI_PROJECT_DIR}/.sccache
29+
# CI builds are throwaway: incremental compilation only adds overhead and
30+
# bloats target dirs, and debuginfo is most of a dev target's size and a
31+
# large share of its compile time (test backtraces lose file/line info).
32+
CARGO_INCREMENTAL: '0'
33+
CARGO_PROFILE_DEV_DEBUG: '0'
34+
# Parallel archiver + cheapest compression: cache/artifact save time is
35+
# dominated by CPU-bound compression of multi-GB target dirs, not upload.
36+
FF_USE_FASTZIP: 'true'
37+
CACHE_COMPRESSION_LEVEL: 'fastest'
38+
ARTIFACT_COMPRESSION_LEVEL: 'fast'
2839
default:
2940
tags:
3041
- dind_fast

.gitlab/ci/build_js_sdks.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,12 @@
1616
- packages/js-*/**/*
1717
- .gitlab/ci/build_js_sdks.yml
1818

19+
# No pnpm store cache: extracting the multi-GB store (~100k small files)
20+
# takes longer than pnpm re-downloading the same packages.
1921
.js-sdks-base:
2022
extends: .js-sdk-workflow
21-
variables:
22-
PNPM_STORE_DIR: ${CI_PROJECT_DIR}/.pnpm-store
23-
cache:
24-
key: js-sdks-pnpm-${CI_COMMIT_REF_SLUG}
25-
fallback_keys:
26-
- js-sdks-pnpm-${CI_DEFAULT_BRANCH}
27-
paths:
28-
- .pnpm-store
2923
before_script:
3024
- npm install -g pnpm@10
31-
- pnpm config set store-dir ${PNPM_STORE_DIR}
3225
- pnpm config set @polycentric:registry https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
3326
- pnpm install
3427

.gitlab/ci/build_rn_sdk.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ rn-android-build:
2424
- !reference [.rs-core-workflow, rules]
2525
- !reference [.app-workflow, rules]
2626
- !reference [.release-workflow, rules]
27+
# Self-populating per job: the first run downloads and compiles
28+
# everything and uploads the result; every run after starts with warm
29+
# crate sources and sccache hits for unchanged crates.
2730
cache:
28-
- key: rs-core-cargo-deps-${CI_COMMIT_REF_SLUG}
29-
fallback_keys:
30-
- rs-core-cargo-deps-${CI_DEFAULT_BRANCH}
31-
paths:
32-
- .cargo/registry/index
33-
- .cargo/registry/cache
34-
- .cargo/git/db
35-
- key: rs-core-target-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
36-
fallback_keys:
37-
- rs-core-target-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
38-
paths:
39-
- target
31+
key:
32+
files:
33+
- Cargo.lock
34+
prefix: cargo-${CI_JOB_NAME}
35+
paths:
36+
- .cargo/registry/index
37+
- .cargo/registry/cache
38+
- .cargo/git/db
39+
- .sccache
40+
policy: pull-push
41+
before_script:
42+
- command -v sccache >/dev/null && export RUSTC_WRAPPER=sccache || true
4043
script:
4144
- cd packages/react-native
4245
- |

.gitlab/ci/build_rs_core.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,24 @@
1919
- .gitlab/ci/build_rs_core.yml
2020
variables:
2121
RUST_CORE_PATH: packages/rs-core
22+
before_script:
23+
# Enable the compile cache only when the image provides sccache, so
24+
# pipelines still on an older rust image keep working.
25+
- command -v sccache >/dev/null && export RUSTC_WRAPPER=sccache || true
26+
# Self-populating per job: the first run downloads and compiles
27+
# everything and uploads the result; every run after starts with warm
28+
# crate sources and sccache hits for unchanged crates.
2229
cache:
23-
- key: rs-core-cargo-deps-${CI_COMMIT_REF_SLUG}
24-
fallback_keys:
25-
- rs-core-cargo-deps-${CI_DEFAULT_BRANCH}
26-
paths:
27-
- .cargo/registry/index
28-
- .cargo/registry/cache
29-
- .cargo/git/db
30-
- key: rs-core-target-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
31-
fallback_keys:
32-
- rs-core-target-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
33-
paths:
34-
- target
30+
key:
31+
files:
32+
- Cargo.lock
33+
prefix: cargo-${CI_JOB_NAME}
34+
paths:
35+
- .cargo/registry/index
36+
- .cargo/registry/cache
37+
- .cargo/git/db
38+
- .sccache
39+
policy: pull-push
3540

3641
.rust-check:
3742
extends: .rs-core-workflow
@@ -90,6 +95,20 @@ rs-core-uniffi-web-build:
9095
- !reference [.rn-sdk-workflow, rules]
9196
- !reference [.app-workflow, rules]
9297
- !reference [.release-workflow, rules]
98+
# Self-populating per job: the first run downloads and compiles
99+
# everything and uploads the result; every run after starts with warm
100+
# crate sources and sccache hits for unchanged crates.
101+
cache:
102+
key:
103+
files:
104+
- Cargo.lock
105+
prefix: cargo-${CI_JOB_NAME}
106+
paths:
107+
- .cargo/registry/index
108+
- .cargo/registry/cache
109+
- .cargo/git/db
110+
- .sccache
111+
policy: pull-push
93112
script:
94113
- cd packages/rs-core-uniffi-web
95114
- |

.gitlab/ci/build_services.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
.service-rust-base:
22
image: ${RUST_IMAGE}
33
stage: check
4+
variables:
5+
SCCACHE_DIR: ${CI_PROJECT_DIR}/.sccache
6+
before_script:
7+
- command -v sccache >/dev/null && export RUSTC_WRAPPER=sccache || true
8+
# Self-populating per job: the first run downloads and compiles
9+
# everything and uploads the result; every run after starts with warm
10+
# crate sources and sccache hits for unchanged crates.
411
cache:
5-
key: ${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
6-
fallback_keys:
7-
- ${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
8-
- ${CI_JOB_NAME}
12+
key:
13+
files:
14+
- Cargo.lock
15+
prefix: cargo-${CI_JOB_NAME}
916
paths:
10-
- .cargo/registry/index/
11-
- .cargo/registry/cache/
12-
- .cargo/git/db/
13-
- target/
17+
- .cargo/registry/index
18+
- .cargo/registry/cache
19+
- .cargo/git/db
20+
- .sccache
21+
policy: pull-push
1422

1523
.service-format-check:
1624
extends: .service-rust-base

.gitlab/images/rust/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y \
1616
RUN rustup set profile default && rustup component add clippy rustfmt
1717
RUN cargo install just cargo-ndk && rm -rf /usr/local/cargo/registry
1818

19+
# sccache
20+
RUN curl -L "https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz" \
21+
| tar xz --strip-components=1 -C /usr/local/bin --wildcards "*/sccache" \
22+
&& chmod +x /usr/local/bin/sccache
23+
1924
# Android NDK
2025
RUN curl -L -o /tmp/ndk.zip "https://dl.google.com/android/repository/android-ndk-r27c-linux.zip" \
2126
&& unzip -q /tmp/ndk.zip -d /opt \

packages/rs-core-uniffi-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"files": ["dist", "ubrn.config.yaml", "ubrn-wasm-patch.toml"],
1919
"scripts": {
20-
"prebuild": "cargo install wasm-bindgen-cli --version 0.2.122 --locked",
20+
"prebuild": "wasm-bindgen --version 2>/dev/null | grep -qF 0.2.122 || cargo install wasm-bindgen-cli --version 0.2.122 --locked --force",
2121
"build": "ubrn build web",
2222
"clean": "rm -rfv dist/ rust_modules/"
2323
},

pnpm-lock.yaml

Lines changed: 11 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)