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

The windows-gnu package misses zlib1__.dll that is needed by rust-lld.exe #85422

Closed
mwu-tow opened this issue May 17, 2021 · 4 comments · Fixed by #85762
Closed

The windows-gnu package misses zlib1__.dll that is needed by rust-lld.exe #85422

mwu-tow opened this issue May 17, 2021 · 4 comments · Fixed by #85762
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mwu-tow
Copy link

mwu-tow commented May 17, 2021

Code

I tried this:

  1. Checkout https://github.com/enso-org/rust-lib/ (at https://github.com/enso-org/rust-lib/commit/966be60f29c3df60c5d5d5c0c9851628121d371e)
  2. Force windows-gnu nightly: rustup override set nightly-2021-05-12-x86_64-pc-windows-gnu
  3. Add wasm target: rustup target add wasm32-unknown-unknown
  4. Build the package for wasm32-unknown-unknown: cargo build --package enso-macro-utils --target wasm32-unknown-unknown --verbose

Result:

       Fresh unicode-xid v0.2.2
       Fresh proc-macro2 v1.0.26
       Fresh quote v1.0.9
       Fresh syn v1.0.72
   Compiling enso-macro-utils v0.2.0 (H:\NBO\rust-lib2\src\macro-utils)
     Running `rustc --crate-name enso_macro_utils --edition=2018 src\macro-utils\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type rlib --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8150a0817e2653a8 --out-dir H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps --target wasm32-unknown-unknown -C incremental=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\incremental -L dependency=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps -L dependency=H:\NBO\rust-lib2\target\debug\deps --extern proc_macro2=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libproc_macro2-9b3887378601e3cb.rlib --extern quote=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libquote-ce5e91957001eaaa.rlib --extern syn=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libsyn-47b4e10419655eff.rlib`
error: linking with `rust-lld` failed: exit code: 0xc0000135
  |
  = note: "rust-lld" "-flavor" "wasm" "--rsp-quoting=posix" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--fatal-warnings" "--no-demangle" "--no-entry" "--export-dynamic" "-L" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib" "-L" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\self-contained" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.10n6kg93vpj2l821.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.12hrjnpyr5sievjk.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1ed8z83xmyaqx1h0.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1h6pa51rsurgn1hb.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1hq2kmdfi5dyr74e.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1i4kz6pwg0l0q349.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1i6dzwhqk8iekwk0.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1o55ju5wt71tq4cu.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.1vc83zir8m96ls72.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.20nov3j6bdjf6aky.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.20vimqn381uyn1hs.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.215ihrjpafw7qha3.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.26fldi9i7057r26c.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2an49mjv32fdk9pe.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2ibehvhbtcrm76dr.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2pm5pbycenpn9v3v.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2q7uh6kapwwv19kr.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2rs1swk1saku5dch.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.2ybiuurziosz8eej.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.30myusctnk8fq8ll.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3bcj1lwlfpbmx1r1.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3ce0p1d6rhcwj6zc.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3cplh722suz198hi.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3drcpz6cj9qql6y6.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3eivblrgqu8so2sf.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3h91ld229ocld6bw.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3iapmjd65yneyvg3.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3meutbf5aclzh9cn.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3nhfq6ugensvbswx.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3nwq5oc1yjfixg6i.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3qhnnlwikiydygz7.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3qpqe6e6fugjt8yc.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3va4iv2o7zu6nxkd.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.3wetnklslyuvcb0e.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.420zdizk92gzv3uu.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.4297aze779opsc3h.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.45bf8dq0ic3uu3jy.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.4ffgenw2ck3sy2iv.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.4r0kpi5d8a2akrq5.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.4v52k1743nfkohw2.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.4vudl5bczgnodyo0.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.59alu44j574b3y1q.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.5biggvlpdi7ipp88.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.nh3rg5qtnimdi2d.rcgu.o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.ygqcf0j29vkdz6y.rcgu.o" "-o" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.wasm" "--export=__heap_base" "--export=__data_end" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\enso_macro_utils.31nkxfllcwbt3xy1.rcgu.o" "--gc-sections" "--no-entry" "-O0" "-L" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps" "-L" "H:\\NBO\\rust-lib2\\target\\debug\\deps" "-L" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\libsyn-47b4e10419655eff.rlib" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\libquote-ce5e91957001eaaa.rlib" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\libproc_macro2-9b3887378601e3cb.rlib" "H:\\NBO\\rust-lib2\\target\\wasm32-unknown-unknown\\debug\\deps\\libunicode_xid-adfd3b98ea1219fa.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libstd-6acf924d1673def9.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libpanic_abort-e22bb9b3323df5b7.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libdlmalloc-39d54d75f1798665.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libstd_detect-56f05b40b26c0c82.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\librustc_demangle-9264e3fa5e17c6f7.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libhashbrown-475ba1881f8007a7.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\librustc_std_workspace_alloc-cc49bb91487ac31c.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libunwind-b7a277cb4feb8e31.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libcfg_if-9e2b3f635e466f9e.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\liblibc-9624bc770b580987.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\liballoc-7215173d6e39d2c5.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\librustc_std_workspace_core-fa5a20c6923501f2.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libcore-b041b32de3685579.rlib" "C:\\Users\\mwurb\\.rustup\\toolchains\\nightly-2021-05-12-x86_64-pc-windows-gnu\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\libcompiler_builtins-81f86f20ae14fc90.rlib"
  = note:

error: aborting due to previous error

error: could not compile `enso-macro-utils`

Caused by:
  process didn't exit successfully: `rustc --crate-name enso_macro_utils --edition=2018 src\macro-utils\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --crate-type rlib --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8150a0817e2653a8 --out-dir H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps --target wasm32-unknown-unknown -C incremental=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\incremental -L dependency=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps -L dependency=H:\NBO\rust-lib2\target\debug\deps --extern proc_macro2=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libproc_macro2-9b3887378601e3cb.rlib --extern quote=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libquote-ce5e91957001eaaa.rlib --extern syn=H:\NBO\rust-lib2\target\wasm32-unknown-unknown\debug\deps\libsyn-47b4e10419655eff.rlib` (exit code: 1)

The rustc invokes rust-lld. rust-lld depends on zlib1__.dll that is not present in the distribution. If I add it manually, the issue goes away.
The windows-msvc flavor ships with rust-lld that does not have this dependency.

Version it worked on

rustc 1.52.0-nightly (476acbf1e 2021-03-03)
binary: rustc
commit-hash: 476acbf1e9965b5e95c90f0d7d658709812b7003
commit-date: 2021-03-03
host: x86_64-pc-windows-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Version with regression

rustc 1.52.0-nightly (45b3c2851 2021-03-04)
binary: rustc
commit-hash: 45b3c28518e4c45dfd12bc2c4400c0d0e9639927
commit-date: 2021-03-04
host: x86_64-pc-windows-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

and

rustc 1.54.0-nightly (5c0292654 2021-05-11)
binary: rustc
commit-hash: 5c029265465301fe9cb3960ce2a5da6c99b8dcf2
commit-date: 2021-05-11
host: x86_64-pc-windows-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

(and likely everything between)

@mwu-tow mwu-tow added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels May 17, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label May 17, 2021
@apiraino
Copy link
Contributor

apiraino commented May 19, 2021

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-low +T-compiler +O-windows

Edit: my assessment was wrong, this requires more prompt attention

@rustbot label -P-low +P-high

@rustbot rustbot added O-windows Operating system: Windows P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 19, 2021
@apiraino apiraino added the O-windows-gnu Toolchain: GNU, Operating system: Windows label May 19, 2021
@rustbot rustbot added P-high High priority and removed P-low Low priority labels May 20, 2021
@jhunnius
Copy link

jhunnius commented May 26, 2021

I have the same issue with "stable" rust 1.52.1 (9bc8c42 2021-05-09) on Windows 10 with a wasm32-unknown-unknown target.

Can you elaborate on how to quick-fix this by adding zlib1__.dll manually?

Where can I get, and where do I put zlib1__.dll?
I only have zlib1.dll from Mingw64, Mingw32, and many other SW packages.
Is it the same?

Btw. what hit me instantly is the move from LLVM 11 to 12. Might that be the issue?

@mwu-tow
Copy link
Author

mwu-tow commented May 26, 2021

@jhunnius

Can you elaborate on how to quick-fix this by adding zlib1__.dll manually?

Where can I get, and where do I put zlib1__.dll?
I only have zlib1.dll from Mingw64, Mingw32, and many other SW packages.
Is it the same?

Yes, at least enough so it works for me. Just rename any zlib binary, the library interface has been stable for a very long time, so it should just work. Or, if you are ok with using binaries received from strangers, take this: zlib1__.zip.

When you have zlib1__.dll, you need to make it visible. Either place it in any location visible in PATH environment variable, or place it next to the rust-lld.exe. For me it is located in ~\.rustup\toolchains\nightly-2021-05-12-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\bin. See this if you want in-depth explanation where the Windows looks for the DLLs.

@jhunnius
Copy link

It works, thanks a lot. It was a bit confusing that I don't have rust-lld in the wasm target folder.
Now I can work on my fullstack project again without worrying about OS specific issues :-)

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 30, 2021
…Mark-Simulacrum

Do not try to build LLVM with Zlib on Windows

Fixes rust-lang#85422
Fixes rust-lang#85624

We do not install Zlib on the CI but recent builds somehow started picking it's shared version.
To avoid relying on CI binaries so let's explicitly disable it.
@bors bors closed this as completed in 957badb May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants