Skip to content

Commit

Permalink
No default toolchain version for host build
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Oct 7, 2023
1 parent f5d765e commit 1a05483
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11907,7 +11907,7 @@ async function installRustTarget(target, toolchain) {
else if ((0, fs_1.existsSync)(res.stdout.trim())) {
return;
}
if (toolchain.length > 0) {
if (toolchain && toolchain.length > 0) {
await exec.exec('rustup', [
'target',
'add',
Expand Down Expand Up @@ -11940,13 +11940,13 @@ function setupSccacheEnv() {
async function hostBuild(maturinRelease, args) {
const command = core.getInput('command');
const target = getRustTarget(args);
const rustToolchain = (await getRustToolchain(args)) || 'stable';
const rustToolchain = await getRustToolchain(args);
const rustupComponents = core.getInput('rustup-components');
const workdir = getWorkingDirectory();
const sccache = core.getBooleanInput('sccache');
const isUniversal2 = args.includes('--universal2') || target === 'universal2-apple-darwin';
core.startGroup('Install Rust target');
if (rustToolchain.length > 0) {
if (rustToolchain && rustToolchain.length > 0) {
core.info(`Installing Rust toolchain ${rustToolchain}`);
await exec.exec('rustup', ['override', 'set', rustToolchain]);
await exec.exec('rustup', ['component', 'add', 'llvm-tools-preview'], {
Expand Down
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ async function installRustTarget(
// Target already installed
return
}
if (toolchain.length > 0) {
if (toolchain && toolchain.length > 0) {
await exec.exec('rustup', [
'target',
'add',
Expand Down Expand Up @@ -759,15 +759,17 @@ async function hostBuild(
): Promise<number> {
const command = core.getInput('command')
const target = getRustTarget(args)
const rustToolchain = (await getRustToolchain(args)) || 'stable'
// rust toolchain doesn't have a default version so we can use the one
// that's already installed
const rustToolchain = await getRustToolchain(args)
const rustupComponents = core.getInput('rustup-components')
const workdir = getWorkingDirectory()
const sccache = core.getBooleanInput('sccache')
const isUniversal2 =
args.includes('--universal2') || target === 'universal2-apple-darwin'

core.startGroup('Install Rust target')
if (rustToolchain.length > 0) {
if (rustToolchain && rustToolchain.length > 0) {
core.info(`Installing Rust toolchain ${rustToolchain}`)
await exec.exec('rustup', ['override', 'set', rustToolchain])
await exec.exec('rustup', ['component', 'add', 'llvm-tools-preview'], {
Expand Down

0 comments on commit 1a05483

Please sign in to comment.