mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Make sure we have a recent enough rustc
to build packages
This commit is contained in:
parent
605947d4a1
commit
bd99bb0b7b
2 changed files with 28 additions and 0 deletions
13
.github/workflows/build-packages.yml
vendored
13
.github/workflows/build-packages.yml
vendored
|
@ -183,6 +183,19 @@ jobs:
|
|||
# Checkout here so we can easily use custom actions
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# We need a more recent rustc
|
||||
- name: Install a more recent `rustc`
|
||||
if: ${{ inputs.source == 'src' }}
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
|
||||
- name: Set rust environment variables
|
||||
if: ${{ inputs.source == 'src' }}
|
||||
run: |
|
||||
CARGO_HOME=${CARGO_HOME:-${HOME}/.cargo}
|
||||
export CARGO_HOME
|
||||
echo "CARGO_HOME=${CARGO_HOME}" | tee -a "${GITHUB_ENV}"
|
||||
echo "${CARGO_HOME}/bin" | tee -a "${GITHUB_PATH}"
|
||||
|
||||
# Checkout here for the build process
|
||||
- name: Checkout in build directory
|
||||
uses: actions/checkout@v4
|
||||
|
|
|
@ -8,6 +8,7 @@ from __future__ import annotations
|
|||
import json
|
||||
import logging
|
||||
import os
|
||||
import os.path
|
||||
import pathlib
|
||||
import shutil
|
||||
import tarfile
|
||||
|
@ -90,6 +91,20 @@ def debian(
|
|||
os.environ[key] = value
|
||||
env_args.extend(["-e", key])
|
||||
|
||||
cargo_home = os.environ.get("CARGO_HOME")
|
||||
user_cargo_bin = os.path.expanduser("~/.cargo/bin")
|
||||
if os.path.exists(user_cargo_bin):
|
||||
ctx.info(
|
||||
f"The path '{user_cargo_bin}' exists so adding --prepend-path={user_cargo_bin}"
|
||||
)
|
||||
env_args.append(f"--prepend-path={user_cargo_bin}")
|
||||
elif cargo_home is not None:
|
||||
cargo_home_bin = os.path.join(cargo_home, "bin")
|
||||
ctx.info(
|
||||
f"The 'CARGO_HOME' environment variable is set, so adding --prepend-path={cargo_home_bin}"
|
||||
)
|
||||
env_args.append(f"--prepend-path={cargo_home_bin}")
|
||||
|
||||
env = os.environ.copy()
|
||||
env["PIP_CONSTRAINT"] = str(
|
||||
tools.utils.REPO_ROOT / "requirements" / "constraints.txt"
|
||||
|
|
Loading…
Add table
Reference in a new issue