Skip to content

Commit 2a20b0e

Browse files
committed
workflows: build-polars-runtime: change Cargo optimizations
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent b2d8931 commit 2a20b0e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build-polars-runtime.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ env:
3030
CARGO_INCREMENTAL: 0
3131
CARGO_NET_RETRY: 10
3232
RUSTUP_MAX_RETRIES: 10
33+
# `--profile dist-release` (see "Build wheel" below) inherits fat LTO +
34+
# codegen-units=1 from py-polars' Cargo.toml. Fat LTO is a whole-program
35+
# optimization pass whose memory use scales with program size, not
36+
# parallelism - it's the likely cause of exhausting a resource-constrained
37+
# riscv64 runner regardless of job count. Overriding it here keeps the
38+
# dist-release profile name/other settings intact without patching
39+
# Cargo.toml.
40+
CARGO_PROFILE_DIST_RELEASE_LTO: thin
41+
CARGO_PROFILE_DIST_RELEASE_CODEGEN_UNITS: '16'
42+
# Caps concurrent rustc invocations so multiple large crates (polars-plan,
43+
# polars-expr, polars-python, ...) don't get monomorphized/codegen'd at
44+
# once. This needs to be adjusted if the runners change.
45+
CARGO_BUILD_JOBS: '4'
3346

3447
defaults:
3548
run:

0 commit comments

Comments
 (0)