Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CI "build wheels" step for rustup no longer installing default toolchain (Cherry-pick of #22037) #22039

Merged
merged 2 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ jobs:

echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

'
- name: Install Rust toolchain
run: '# Set the default toolchain. Installs the toolchain if it is not already
installed.

rustup default 1.82.0

cargo version

'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -116,6 +125,15 @@ jobs:

echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

'
- name: Install Rust toolchain
run: '# Set the default toolchain. Installs the toolchain if it is not already
installed.

rustup default 1.82.0

cargo version

'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,14 @@ jobs:

echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

'
- name: Install Rust toolchain
run: '# Set the default toolchain. Installs the toolchain if it is not already installed.

rustup default 1.82.0

cargo version

'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -418,6 +426,14 @@ jobs:

echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

'
- name: Install Rust toolchain
run: '# Set the default toolchain. Installs the toolchain if it is not already installed.

rustup default 1.82.0

cargo version

'
- name: Expose Pythons
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
Expand Down
28 changes: 20 additions & 8 deletions src/python/pants_release/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,28 @@ def rust_channel() -> str:
return cast(str, rust_toolchain["toolchain"]["channel"])


def install_rustup() -> Step:
return {
"name": "Install rustup",
"run": dedent(
"""\
def install_rustup() -> list[Step]:
return [
{
"name": "Install rustup",
"run": dedent(
"""\
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y --default-toolchain none
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
"""
),
}
),
},
{
"name": "Install Rust toolchain",
"run": dedent(
f"""\
# Set the default toolchain. Installs the toolchain if it is not already installed.
rustup default {rust_channel()}
cargo version
"""
),
},
]


def install_pythons(versions: list[str]) -> Step:
Expand Down Expand Up @@ -832,7 +844,7 @@ def build_wheels_job(
if container:
initial_steps = [
*checkout(containerized=True, ref=for_deploy_ref),
install_rustup(),
*install_rustup(),
{
"name": "Expose Pythons",
"run": dedent(
Expand Down
Loading