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

rust: rebuild 1.69.0 to work around clang issue with 1.70.0 #17433

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

filnet
Copy link
Contributor

@filnet filnet commented Jun 3, 2023

see #17406

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

Looks like the MINGW32 build timed out or something.

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

CI is having a hard time building for CLANG32MINGW32... looks like it is stuck.

@filnet filnet mentioned this pull request Jun 4, 2023
@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

Timed out again ? I think it got stuck in the same spot last time too.

   Building stage1 library artifacts (i686-pc-windows-gnu) 
     Compiling cc v1.0.77
     Compiling core v0.0.0 (C:\_\B\src\rustc-1.69.0-src\library\core)
     Compiling compiler_builtins v0.1.87
     Compiling libc v0.2.139
     Compiling unwind v0.0.0 (C:\_\B\src\rustc-1.69.0-src\library\unwind)
     Compiling memchr v2.5.0
     Compiling std v0.0.0 (C:\_\B\src\rustc-1.69.0-src\library\std)
  Terminate batch job (Y/N)? 
  ^C

@jeremyd2019 @mati865 @lazka any clue what's going on ?

@jeremyd2019
Copy link
Member

jeremyd2019 commented Jun 4, 2023

Might have to try it locally, see if there's, ie, an error message box or something. Or try to get a backtrace of where it's hung. But it's very strange, MINGW32 shouldn't have changed at all, still even using the official bootstrap compiler.

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

It's currently stuck compiling std v0.0.0.

Edit: I think this happened in past with other versions of Rust.

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

Local build fails (see below). How come CI does not show the cause ?

Edit:: My local build failed fast. Why does it timeout on CI ?

Edit 2: My local build does not fail at the same stage as CI (CI fails later).
Local : Building compiler artifacts (stage0 -> stage1)
CI : Building stage1 library artifacts (i686-pc-windows-gnu)

Building compiler artifacts (stage0 -> stage1)
[...]
   Compiling std v0.0.0 (C:\M\mingw-w64-rust\src\rustc-1.69.0-src\library\std)
error: could not compile `core`

Caused by:
  process didn't exit successfully: `C:\M\mingw-w64-rust\src\MINGW32\build\bootstrap\debug\rustc --crate-name core --edit
ion=2021 'library\core\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagno
stic-width=120 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -Zunstabl
e-options --check-cfg 'names()' --check-cfg 'values()' -C metadata=76d63240a4356319 -C extra-filename=-76d63240a4356319 -
-out-dir 'C:\M\mingw-w64-rust\src\MINGW32\build\i686-pc-windows-gnu\stage1-std\i686-pc-windows-gnu\release\deps' --target
 i686-pc-windows-gnu -C linker=gcc -L 'dependency=C:\M\mingw-w64-rust\src\MINGW32\build\i686-pc-windows-gnu\stage1-std\i6
86-pc-windows-gnu\release\deps' -L 'dependency=C:\M\mingw-w64-rust\src\MINGW32\build\i686-pc-windows-gnu\stage1-std\relea
se\deps' -Csymbol-mangling-version=legacy -Zunstable-options -Zunstable-options '--check-cfg=values(bootstrap)' '--check-
cfg=values(stdarch_intel_sde)' '--check-cfg=values(no_fp_fmt_parse)' '--check-cfg=values(no_global_oom_handling)' '--chec
k-cfg=values(no_rc)' '--check-cfg=values(no_sync)' '--check-cfg=values(freebsd12)' '--check-cfg=values(backtrace_in_libst
d)' '--check-cfg=values(target_env,"libnx")' '--check-cfg=values(target_arch,"asmjs","spirv","nvptx","xtensa")' -Zmacro-b
acktrace -Zunstable-options -Csplit-debuginfo=packed -Cprefer-dynamic -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url
="https://doc.rust-lang.org/1.69.0/")' -Z binary-dep-depinfo` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:08:46
==> ERROR: A failure occurred in build().

@jeremyd2019
Copy link
Member

---------------------------
rustc.exe - Entry Point Not Found
---------------------------
The procedure entry point __divmoddi4 could not be located in the dynamic link library C:\msys64\mingw32\bin\libstdc++-6.dll. 
---------------------------
OK   
---------------------------

@jeremyd2019
Copy link
Member

Edit:: it failed fast. Why does it timeout on CI ?

MSYS: "winjitdebug"

causes Windows to show error message boxes for things like missing exports. So CI is sitting waiting for somebody to answer the message box.

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

---------------------------
rustc.exe - Entry Point Not Found
---------------------------
The procedure entry point __divmoddi4 could not be located in the dynamic link library C:\msys64\mingw32\bin\libstdc++-6.dll. 
---------------------------
OK   
---------------------------

How did you get that ?

@jeremyd2019
Copy link
Member

How did you get that ?

I tried to build the package locally for MINGW32, with MSYS=winjitdebug environment variable set (on my local machine, I have this set globally and gdb registered as Windows JIT debugger). This caused the error mode to be reset to default in new processes, which means Windows will produce message boxes for errors such as this. I then pressed Ctrl-C on the message box to copy. (not sure which part you were asking about, so I provided info on both getting the message box and copying it in that format).

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

Do you know which rustc is asking for the missing entry point ?
Is it the official bootstrap compiler ? Because if it is then it depends on C:\msys64\mingw32\bin\libstdc++-6.dll which is not good.

@filnet
Copy link
Contributor Author

filnet commented Jun 4, 2023

I was able to build MINGW32 with _bootstrapping=no ! Got lucky...

@jeremyd2019
Copy link
Member

jeremyd2019 commented Jun 5, 2023

Do you know which rustc is asking for the missing entry point ? Is it the official bootstrap compiler ? Because if it is then it depends on C:\msys64\mingw32\bin\libstdc++-6.dll which is not good.

Two rustc.exe's are running while the message box is open: $srcdir\MINGW32\build\bootstrap\debug and $srcdir\MINGW32\build\i686-pc-windows-gnu\stage1\bin

@mati865
Copy link
Collaborator

mati865 commented Jun 5, 2023

This is concerning, __divmoddi4 must have been found in libstdc++ previously since this is just a rebuild and now it's gone?

Two rustc.exe's are running while the message box is open: $srcdir\MINGW32\build\bootstrap\debug and $srcdir\MINGW32\build\i686-pc-windows-gnu\stage1\bin

Yeah that is expected, build/bootstrap is build tool made for Rustc. It and stage1 compiler are built with stage0 compiler downloaded from Rust (_bootstrapping=yes) or system one (_bootstrapping=no).
Linking libstdc++ statically should help as well but I have no idea what happened there. maybe ld.bfd has linked libstdc++ DLL provided in Rust tarball and the one from MINGW32 has broke ABI?

@filnet
Copy link
Contributor Author

filnet commented Jun 5, 2023

@mati865 should we investigate more or proceed with the current 1.69.0-2 rebuild (which is successful after disabling bootstrap for mingw32) ?

This would allow us to move on with 1.70.0 which is waiting on this rebuild.

@filnet
Copy link
Contributor Author

filnet commented Jun 5, 2023

Googling __divmoddi4 does not yield much (nothing recent) but shows that others have had issues with it on 32 bit systems.

@mati865
Copy link
Collaborator

mati865 commented Jun 5, 2023

I wouldn't block on that, since it appears to be some GCC bug.

@jeremyd2019
Copy link
Member

I think __divmoddi4 is supposed to come from libgcc. I don't know why it would have been exported from libstdc++, other than some gcc bug (or something like --export-all-symbols re-exporting it if libstdc++ statically linked libgcc and pulled it in).

@filnet
Copy link
Contributor Author

filnet commented Jun 5, 2023

I wouldn't block on that, since it appears to be some GCC bug.

Good to hear.

Note that if we proceed with the actual plan we will end up having all systems, but MINGW64, with boostrap=no.
This will open up a new can of worms :) Future will tell...

@filnet
Copy link
Contributor Author

filnet commented Jun 5, 2023

May the powers in place please kindly merge this PR.

@lazka lazka merged commit f1306e1 into msys2:master Jun 5, 2023
@jeremyd2019
Copy link
Member

jeremyd2019 commented Jun 5, 2023

Note that if we proceed with the actual plan we will end up having all systems, but MINGW64, with boostrap=no. This will open up a new can of worms :) Future will tell...

You know what just occurred to me, MINGW32 was fine in the 1.70.0 PR with _bootstrapping=yes, so maybe this was just an issue with 1.69.0 (or perhaps the 1.68.x used for bootstrapping) vs an updated gcc here, and 1.70.0 will be fine with _bootstrapping=yes on MINGW32 again

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.

4 participants