moonrepo / setup-rust

A maintained GitHub action for setting up Rust and Cargo.
84 stars 6 forks source link

Windows: `Can't find crate for core` #7

Closed JonnyBurger closed 7 months ago

JonnyBurger commented 1 year ago

Hi!

We are looking to adopt this package and migrate from actions-rs. On Windows, the compilation fails due to:

error[E0463]: can't find crate for `core`

CI run: https://github.com/remotion-dev/remotion/actions/runs/4890840629/jobs/8730672600?pr=2189

Configuration: channel: "1.67.1", profile: minimal

Since this package wants to be a migration path from actions-rs, I thought I raise an issue.

milesj commented 1 year ago

@JonnyBurger Seems like the error says you need x86_64-pc-windows-gnu? Have you tried adding that to the targets list?

JonnyBurger commented 1 year ago

Thanks a lot for answering!

How would one specify that?

The following does not work:

      - uses: moonrepo/setup-rust@v0
        with:
          channel: "1.67.1"
          profile: minimal
          targets:
            - x86_64-pc-windows-gnu

and there seems to be no documentation about targets.

I was running the command on Windows, so it would be nice if this were the default target - this worked automatically in actions-rs/setup.

milesj commented 1 year ago

@JonnyBurger The value is a string, so probably this:

      - uses: moonrepo/setup-rust@v0
        with:
          channel: "1.67.1"
          profile: minimal
          targets: x86_64-pc-windows-gnu

I'll update the docs.

milesj commented 1 year ago

I've been looking through the actions-rs code to try and figure out how they determine the gnu profile, but don't see it. Currently I'm just letting rustup figure it out, which it defaults to mvsc.

C:\Users\runneradmin\.cargo\bin\rustup.exe toolchain install 1.67.1 --profile minimal --no-self-update
info: syncing channel updates for '1.67.1-x86_64-pc-windows-msvc'