Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Fix rustup download & installation on Windows #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lionel-faber
Copy link

@lionel-faber lionel-faber commented Jan 3, 2022

When downloading the rustup-init binary for installation on Windows it should be named rustup-init.exe in order to be executable on the runner. If not it fails with the following error:

Error: Unable to locate executable file: D:\a\_temp\27bbd22a-fb15-4983-b256-c980efbc05b8. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.

The issue is locally reproducible on master through this test (run on Windows):

import { RustUp } from '../src/commands/rustup';

test('RustupGetOrInstall', async () => {
    process.env.RUNNER_TEMP = '_temp';
    await jest.setTimeout(10000);
    await expect(RustUp.getOrInstall()).resolves.toBeDefined();
});

I believe the issue hasn't turned up so far since the GitHub-hosted Windows runners already have rustup installed so RustUp.getOrInstall() has never hit the install phase. I came across this while using a self-hosted runner. See this failed build that first uninstalls rustup before running actions-rs/toolchain

The test is long-running (depending on internet speed - for the download) so a shaky network causes it to fail. So I didn't add it to the suite.

Credits to @TingluoHuang for pointing me in the right direction.

when downloading the rustup-init binary for
installation on Windows it should
be named rustup-init.exe in order
to be executable on the runner
@lionel-faber
Copy link
Author

I updated actions-rs/toolchain with this branch and you can see the passing step

@jedbrown
Copy link

jedbrown commented Feb 8, 2022

I also encountered this error when the previous step wrote the PATH to $GITHUB_ENV.

echo PATH="/c/Program Files/Microsoft MPI/Bin${PATH:+:${PATH}}" | tee -a $GITHUB_ENV

@mihirsamdarshi
Copy link

also waiting on this PR to be merged

@pinkforest
Copy link

pinkforest commented Mar 27, 2023

Hey I've forked actions-rs/core to rinse-repeat/actions-rs-core - which we're now using at rustsec/audit-check

pls feel free to send the PR there thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants