Skip to content

Add work around for bug in cross compilation #621

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
Mar 19, 2021
Merged

Conversation

rylev
Copy link
Contributor

@rylev rylev commented Mar 19, 2021

This should fix #614. I can now successfully document windows-rs on Linux against the x86_64-pc-windows-msvc target.

@jyn514
Copy link

jyn514 commented Mar 19, 2021

So, I looked at this some more this morning, and something very strange is going on:

  • On NixOS, with rustc 1.52.0-nightly (1705a7d64 2021-03-18), cargo doc --no-deps panics while compiling windows_gen
  • On Debian 10, with the same version of nightly, cargo doc --no-deps works fine.
  • On NixOS, with rustc 1.51.0-beta.8 (73f48e5f6 2021-03-18), cargo doc --no-deps works fine.
  • On NixOS with this change and nightly, I get an error:
error: /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6: version `GLIBC_2.32' not found (required by /home/joshua/windows-rs/target/debug/deps/libwindows_gen_macros-c30ffbab983c7445.so)
 --> crates/gen/src/lib.rs:2:1
  |
2 | extern crate windows_gen_macros as macros;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@rylev
Copy link
Contributor Author

rylev commented Mar 19, 2021

@jyn514 The libc error is strange. Does a "hello, world" app compile file?

@jyn514
Copy link

jyn514 commented Mar 19, 2021

@jyn514 The libc error is strange. Does a "hello, world" app compile file?

Hello world works but installing cargo bisect-rustc does not, so this is probably an environment problem. Weird that it only shows up on nightly.

What OS are you using to compile? It seems weird that this works on Debian 10 but ICEs on NixOS.

@rylev
Copy link
Contributor Author

rylev commented Mar 19, 2021

I'm compiling on Windows 10 and WSL with an Ubuntu environment. I'm assuming you get this when you cargodoc is running and not while building. Can you try breaking up the build and run step into two?

@jyn514
Copy link

jyn514 commented Mar 19, 2021

No, I get this error while building, not documenting.

[joshua@uhura:~/windows-rs]$ git checkout FETCH_HEAD
HEAD is now at 59557f0 Merge branch 'master' into fix-cross-compilation

[joshua@uhura:~/windows-rs]$ cargo check
   Compiling windows_gen v0.5.0 (/home/joshua/windows-rs/crates/gen)
error: /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6: version `GLIBC_2.32' not found (required by /home/joshua/windows-rs/target/debug/deps/libwindows_gen_macros-c30ffbab983c7445.so)
 --> crates/gen/src/lib.rs:2:1
  |
2 | extern crate windows_gen_macros as macros;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[joshua@uhura:~/windows-rs]$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
[joshua@uhura:~/windows-rs]$ cargo check
   Compiling windows_gen v0.5.0 (/home/joshua/windows-rs/crates/gen)
thread 'rustc' panicked at 'Failed to get crate data for crate19', compiler/rustc_metadata/src/creader.rs:136:32

@kennykerr
Copy link
Collaborator

Hopefully the actual bug will get fixed but this does unblock x86 builds in my experience as well.

@kennykerr kennykerr merged commit 1e1e481 into master Mar 19, 2021
@kennykerr kennykerr deleted the fix-cross-compilation branch March 19, 2021 15:43
@kennykerr
Copy link
Collaborator

And just to be clear, this workaround is for the rustc cross compilation bug but does not address the cargo hang bug mentioned in #614.

@kennykerr kennykerr mentioned this pull request Mar 19, 2021
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.

Rust docs broken
3 participants