Skip to content

ci: restrict number of jobs during build stage#1443

Open
timsaucer wants to merge 3 commits intoapache:mainfrom
timsaucer:ci/native-linux-arm
Open

ci: restrict number of jobs during build stage#1443
timsaucer wants to merge 3 commits intoapache:mainfrom
timsaucer:ci/native-linux-arm

Conversation

@timsaucer
Copy link
Member

Which issue does this PR close?

Related to #1429 but we need to verify if it resolves the issue.

Rationale for this change

We are getting OOM and this restricts the number of rustc invocations.

What changes are included in this PR?

CI parameter change.

Are there any user-facing changes?

No

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking into fixing this and testing on my fork,

adding swap helped
https://github.com/kevinjqliu/datafusion-python/pull/4/files#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721R244-R255

we can add it to give us more buffer

# temporarily comment out to verify it works in the PR
# if: inputs.build_mode == 'release'
env:
CARGO_BUILD_JOBS: 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should help, we can even do CARGO_BUILD_JOBS=1 and also add it to the "debug" mode below on L241

Comment on lines +70 to +73
[profile.release.package.substrait]
opt-level = 1
codegen-units = 16

Copy link
Contributor

@kevinjqliu kevinjqliu Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets see if scoping it to substrait will help here.

I think we might need to bite the bullet and do this:

[profile.release]
lto = "thin"
codegen-units = 4

or override the options using env var just for that one job.

but note that this affects the final artifact

@kevinjqliu
Copy link
Contributor

kevinjqliu commented Mar 25, 2026

Claude on why profile.release.package.substrait might not work:
"""
That's a reasonable idea but it won't help with your specific OOM. The problem is that with lto = true (fat LTO), all crates get merged into a single IR blob inside rustc for the final optimization pass — the per-package opt-level and codegen-units overrides apply during the initial compilation of each crate, but by the time the LTO link step runs, rustc is holding everything together regardless.
"""

The priority order that minimizes artifact impact:

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

Successfully merging this pull request may close these issues.

2 participants