Skip to content
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

Compiling on Windows is currently broken #13

Closed
clauswilke opened this issue Dec 1, 2020 · 11 comments
Closed

Compiling on Windows is currently broken #13

clauswilke opened this issue Dec 1, 2020 · 11 comments

Comments

@clauswilke
Copy link
Owner

clauswilke commented Dec 1, 2020

Compiling with Windows currently errors out:

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
...
  = note: C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_eh
          collect2.exe: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `getrandom`

This may be related to the release of rustc 1.48.0, see here: https://users.rust-lang.org/t/announcing-rust-1-48-0/51677/6

@clauswilke
Copy link
Owner Author

Here is an old issue that is possibly related: rust-lang/rust#41607

@clauswilke
Copy link
Owner Author

@yutannihilation Do you happen to have any idea how to approach/fix this build problem on Windows? I suspect it'll eventually hit the extendr project as well.

@yutannihilation
Copy link
Contributor

No idea. Curious... Do you think this is an issue specific to getrandom crate?

error: could not compile `getrandom`

@clauswilke
Copy link
Owner Author

No, I don't think so:
rust-lang/rust#41607 (comment)

@yutannihilation
Copy link
Contributor

Okay, it seems time to boot my old Windows again...

@clauswilke
Copy link
Owner Author

If you could look into it, that would be great! I saw a post somewhere saying it was something about a path issue (it uses x86_64-w64-mingw32/bin/ld.exe instead of the linker shipped with Rust), but I can't find that post anymore and I don't have Windows to test.

@yutannihilation
Copy link
Contributor

Before I jump into the hell of Windows Updates, I tried Windows runner on GitHub Actions CI, and it seems there's no compilation error happens. Curious...

https://github.com/yutannihilation/sinab/runs/1480737543

diff: master...yutannihilation:master

@clauswilke
Copy link
Owner Author

That's good to know. Maybe it is a path issue after all. Could you turn this into a PR? And what does override: true do?

@yutannihilation
Copy link
Contributor

Sure, I'll create a PR.

The document says override is to

Set installed toolchain as an override for the current directory
https://github.com/actions-rs/toolchain#inputs

But, I didn't know about the details, I just copied this from the instruction on hellorust, which was recently added. I guess this is for ensuring the runner uses the intended toolchain even when there's already another Rust toolchain installed, so this probably doesn't matter in usual cases.

@yutannihilation
Copy link
Contributor

Confirmed it works without override.

https://github.com/yutannihilation/sinab/runs/1483598627

@clauswilke
Copy link
Owner Author

Closing this as it does work on GH Actions. Probably something is not quite right in the Appveyor setup, but there's nothing fundamental that is broken with the code.

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

No branches or pull requests

2 participants