Skip to content

Add --toolchain-version argument #21

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

Merged
merged 3 commits into from
Apr 26, 2021
Merged

Add --toolchain-version argument #21

merged 3 commits into from
Apr 26, 2021

Conversation

PatchMixolydic
Copy link
Contributor

@PatchMixolydic PatchMixolydic commented Apr 26, 2021

This allows the user to specify which toolchain to use to build their script. This allows for the use of nightly features, features only stabilized in beta (without resorting to nightly), and even the use of custom-built toolchains if the need ever arises.

This allows the user to specify which toolchain to use to build their
script. This allows for the use of nightly features, features only
stabilized in beta, and even the use of custom-built toolchains if
the need ever arises.
@PatchMixolydic
Copy link
Contributor Author

PatchMixolydic commented Apr 26, 2021

I'm a bit concerned about these tests. One works by checking a compiler diagnostic, which may cause it to start failing if the diagnostic is reworded, while the other requires a nightly toolchain to be installed. Is this okay?

@fornwall
Copy link
Owner

@PatchMixolydic Thanks! It's a nice feature to support, so I think it's worth maintaining the new tests.

@fornwall fornwall merged commit d594f7e into fornwall:master Apr 26, 2021
@fornwall
Copy link
Owner

@PatchMixolydic Could you help with a CI build failure?

The CI setup now installs both rust stable (1.47 or 1.51) and nightly toolchains (https://github.com/fornwall/rust-script/blob/master/.github/workflows/ci.yml#L16-L23):

    - name: Setup rust (${{ matrix.rust }})
      uses: hecrj/setup-rust-action@v1
      with:
        rust-version: ${{ matrix.rust }}
    - name: Setup rust (nightly)
      uses: hecrj/setup-rust-action@v1
      with:
        rust-version: nightly

This works on Linux and Mac, but on Windows it fails with (https://github.com/fornwall/rust-script/runs/2436947155#step:5:192):

---- tests::script::test_stable_toolchain stdout ----
rust-script cmd: "target/debug/rust-script" "--toolchain-version" "stable" "tests/data/script-unstable-feature.rs"
rust-script stdout
-----

-----
rust-script stderr:
-----
error: toolchain 'stable-x86_64-pc-windows-msvc' is not installed
error: test failed, to rerun pass '--test integration'

So it seems that +stable doesn't work on Windows here? Earlier the output from the stable installation was 1.47.0-x86_64-pc-windows-msvc installed.

Any ideas? Unfortunately I haven't developed in a Windows environment for a long time.

@fornwall
Copy link
Owner

Ah, it seems that it might be due to stable being preinstalled on Mac and Linux runners, but not on Windows. Installing stable explicitly fixed the tests on Windows.

@fornwall
Copy link
Owner

Thanks! This has now been released in version 0.14.0.

@PatchMixolydic
Copy link
Contributor Author

PatchMixolydic commented Apr 26, 2021

Sorry about not being around to give you a hand; I was still asleep 😅 Glad to see it's working fine now!

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