cargo-auditable icon indicating copy to clipboard operation
cargo-auditable copied to clipboard

Fails on msys2 with --target x86_64-pc-windows-gnu on Github Actions

Open niklasf opened this issue 1 year ago • 3 comments

Hi, nice to see all the progress on the "injection" approach. On msys2 i see that

cargo build --release --target x86_64-pc-windows-gnu

works fine, but

cargo auditable build --release --target x86_64-pc-windows-gnu

fails with

error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-windows-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-pc-windows-gnu`

error: cannot find macro `println` in this scope
 --> src\main.rs:2:5
  |
2 |     println!("Hello, world!");
  |     ^^^^^^^

error: requires `sized` lang_item

For more information about this error, try `rustc --explain E0463`.

I tried to create a minimal reproducible example here: https://github.com/niklasf/cargo-auditable-issue/runs/7665968148?check_suite_focus=true

niklasf avatar Aug 04 '22 05:08 niklasf

Thank you for the report!

That's not the kind of error I expected :sweat_smile: Maybe we mess up some paths somewhere?

I'll try to spin up a Windows VM and take a closer look today or tomorrow.

Shnatsel avatar Aug 04 '22 10:08 Shnatsel

Okay, so plain rustup installation without msys2 works with cargo auditable just fine.

And cargo auditable doesn't have any C dependencies, so it doesn't need cygwin/msys2. cargo geiger with its C dependency on OpenSSL fails to build because it can't find gcc.exe.

So I guess I'll have to dig into how exactly msys2 is set up, and how to wire it up to Rust. I caught a cold, so I probably won't make much progress on this in the next few days.

Shnatsel avatar Aug 04 '22 21:08 Shnatsel

Running cargo auditable install cargo-geiger in msys2 mingw x64 console worked for me. So it must be some issue with the Github action specifically, not a general msys2 issue.

Shnatsel avatar Aug 04 '22 21:08 Shnatsel

Something in the Github Actions or msys2 environment must have changed. The issue is no longer reproducible, even on previously broken versions of cargo-auditable :shrug:

niklasf avatar Dec 08 '22 15:12 niklasf