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: update to 1.66.0 #14592

Merged
merged 3 commits into from
Dec 22, 2022
Merged

rust: update to 1.66.0 #14592

merged 3 commits into from
Dec 22, 2022

Conversation

filnet
Copy link
Contributor

@filnet filnet commented Dec 16, 2022

No description provided.

@mati865
Copy link
Collaborator

mati865 commented Dec 16, 2022

Upstream bug: rust-lang/rust#105696

@filnet
Copy link
Contributor Author

filnet commented Dec 16, 2022

After removing git we now have:
thread 'main' panicked at 'missing miri', install.rs:205:14

@filnet
Copy link
Contributor Author

filnet commented Dec 17, 2022

Somewhat related: rust-lang/rust@6cfa7ef ?

@mati865
Copy link
Collaborator

mati865 commented Dec 17, 2022

Sorry, forgot to cross-link miri issue: rust-lang/rust#105816
Your patch should solve the problem for us.

@filnet
Copy link
Contributor Author

filnet commented Dec 17, 2022

Looks like my hack did the trick but hacks are pilling up...

Dumb question: rust supports mingw, but is this this mingw or another one ? I never fully grasped the history of cygwin/msys/mingw.

@mati865
Copy link
Collaborator

mati865 commented Dec 17, 2022

If we translate our subsystems to Rust's support then:

  • MINGW32 and MINGW64 are tier 1 (distibuted and tested for each commit),
  • UCRT64 is unsupported but happens to work so far,
  • CLANG* is Tier 3 so it's not distributed or tested.

Git issue is related to the fact we have Cygwin git but Rust only tests using native Git for Windows. Miri issue I think affects all or most of the platforms.

@mati865
Copy link
Collaborator

mati865 commented Dec 17, 2022

@jeremyd2019 do you think we want to keep bootstrapping hacks (AArch64 would require updating to even work)?
I think we could set _bootstrapping=no for all targets (or at least all CLANG* subsystems) and drop the hacks eventually in separate PR.

@Biswa96
Copy link
Member

Biswa96 commented Dec 17, 2022

rust supports mingw, but is this this mingw or another one ?

I was just wondering, should there be a page for rust to document the differences and issues like python ?

@jeremyd2019
Copy link
Member

I haven't been paying very close attention to msys2 for a bit...

@jeremyd2019 do you think we want to keep bootstrapping hacks (AArch64 would require updating to even work)? I think we could set _bootstrapping=no for all targets (or at least all CLANG* subsystems) and drop the hacks eventually in separate PR.

My only concern would be that the 'institutional knowledge' of how to bootstrap might get lost. It would be in the git history, but would whoever might need to try in the future think to look there? Hopefully, upstream will eventually get their bootstraps in order and the necessary hacks will be fewer in future

@mati865
Copy link
Collaborator

mati865 commented Dec 18, 2022

Hopefully, upstream will eventually get their bootstraps in order and the necessary hacks will be fewer in future

They would "only" need to provide prebuilt binaries which was so far blocked on dependencies that didn't build on with gnullvm targets and on free builders count. I hope to find some time in January to look into 32-bit target to see why some tests are failing and ask them if they have capacity to build more targets.

@lazka
Copy link
Member

lazka commented Dec 22, 2022

merge?

@mati865
Copy link
Collaborator

mati865 commented Dec 22, 2022

It builds so why not?

@lazka lazka merged commit 2d3bb24 into msys2:master Dec 22, 2022
@lazka
Copy link
Member

lazka commented Dec 22, 2022

I'm never sure with aarch64 :) let's see

thanks!

@jeremyd2019
Copy link
Member

jeremyd2019 commented Dec 22, 2022

    = note: clang: warning: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]
            clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
            lld: error: unable to find library -lwindows
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
            
  
  error: could not compile `bootstrap` due to previous error

Was the patch force-updating the vendored crates lost somehow? Or does it need to be updated?

@mati865
Copy link
Collaborator

mati865 commented Dec 22, 2022

Do you have full log? I can look into it tomorrow.
BTW vendoring patch will be unnecessary with Rust 1.67 in another 6 weeks.

@jeremyd2019
Copy link
Member

@lazka
Copy link
Member

lazka commented Dec 23, 2022

ucrt64 failed in autobuild (two times):

2022-12-23T16:15:12.0013038Z    Compiling bootstrap v0.0.0 (C:\M\mingw-w64-rust\src\rustc-1.66.0-src\src\bootstrap)
2022-12-23T16:15:12.0123392Z    Compiling itoa v1.0.2
2022-12-23T16:15:12.5104614Z    Compiling sha2 v0.10.2
2022-12-23T16:15:13.1097246Z    Compiling getopts v0.2.21
2022-12-23T16:15:13.8870914Z    Compiling tar v0.4.38
2022-12-23T16:15:14.2742849Z    Compiling fd-lock v3.0.6
2022-12-23T16:15:14.4147607Z    Compiling ignore v0.4.18
2022-12-23T16:15:15.6225766Z    Compiling xz2 v0.1.6
2022-12-23T16:15:15.9885470Z    Compiling toml v0.5.9
2022-12-23T16:15:16.7363179Z    Compiling cmake v0.1.48
2022-12-23T16:15:17.3358695Z    Compiling opener v0.5.0
2022-12-23T16:15:17.6133228Z    Compiling hex v0.4.3
2022-12-23T16:15:42.5721253Z     Finished dev [unoptimized] target(s) in 1m 08s
2022-12-23T16:15:42.6521632Z thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }', config.rs:863:74
2022-12-23T16:15:42.6522421Z stack backtrace:
2022-12-23T16:15:42.7482619Z    0: rust_begin_unwind
2022-12-23T16:15:42.7488160Z              at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src/panicking.rs:584:5
2022-12-23T16:15:42.7490004Z    1: core::panicking::panic_fmt
2022-12-23T16:15:42.7490798Z              at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\core\src/panicking.rs:142:14
2022-12-23T16:15:42.7491879Z    2: core::result::unwrap_failed
2022-12-23T16:15:42.7497480Z              at /rustc/897e37553bba8b42751c67658967889d11ecd120/library\core\src/result.rs:1785:5
2022-12-23T16:15:42.7498823Z    3: core::result::Result<T,E>::unwrap
2022-12-23T16:15:42.7499476Z              at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src/result.rs:1107:23
2022-12-23T16:15:42.7500015Z    4: bootstrap::config::Config::parse
2022-12-23T16:15:42.7500972Z              at C:\M\mingw-w64-rust\src\rustc-1.66.0-src\src\bootstrap\config.rs:863:28
2022-12-23T16:15:42.7501490Z    5: bootstrap::main
2022-12-23T16:15:42.7502117Z              at C:\M\mingw-w64-rust\src\rustc-1.66.0-src\src\bootstrap\bin\main.rs:14:18
2022-12-23T16:15:42.7503073Z    6: core::ops::function::FnOnce::call_once
2022-12-23T16:15:42.7503643Z              at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\ops/function.rs:248:5
2022-12-23T16:15:42.7504253Z note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2022-12-23T16:15:42.7537375Z Build completed unsuccessfully in 0:01:31

@mati865
Copy link
Collaborator

mati865 commented Dec 23, 2022

ucrt64 failed in autobuild (two times):

Was git package installed there?

@lazka
Copy link
Member

lazka commented Dec 23, 2022

Yes, the ucrt64 builder installs the VCS group for building source packages. I could look into trying to avoid that. -> msys2/msys2-autobuild#69

@mati865
Copy link
Collaborator

mati865 commented Dec 23, 2022

Alternatively we could disable git detection in Rust's build, it doesn't like UNIX style paths served by emulated Git.

    = note: clang: warning: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]
            clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
            lld: error: unable to find library -lwindows
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
            
  
  error: could not compile `bootstrap` due to previous error

Was the patch force-updating the vendored crates lost somehow? Or does it need to be updated?

Looks like it haven't used vendored dependencies.
Maybe due to some changes unsupported out-of-tree builds don't work with vendoring now?

@lazka
Copy link
Member

lazka commented Dec 23, 2022

Alternatively we could disable git detection in Rust's build, it doesn't like UNIX style paths served by emulated Git.

I wonder if export GIT_DIR=/dev/null would work

@mati865
Copy link
Collaborator

mati865 commented Dec 23, 2022

Build process calls git rev-parse --show-toplevel so yeah, should do the trick.

@jeremyd2019
Copy link
Member

ucrt64 failed in autobuild (two times):

Was git package installed there?

Might be a problem on arm too, my runner has some more packages installed than the clean-from-scratch runners, and I think git is there...

@lazka
Copy link
Member

lazka commented Dec 23, 2022

I wonder if export GIT_DIR=/dev/null would work

It did.

@jeremyd2019
Copy link
Member

@mati865 let me know if you need me to test any patches on arm64. I think the issue would happen to any -gnullvm target though, so it'd probably be faster (both in terms of compute power and turn-around) for you to test against x86_64

@mati865
Copy link
Collaborator

mati865 commented Dec 25, 2022

On the initial test it seems to work but I need to do some digging. Do you have CARGO_HOME defined by any chance?

@jeremyd2019
Copy link
Member

jeremyd2019 commented Dec 25, 2022

No special env vars like that defined. But there is a .cargo directory in the Windows user profile, it's likely to have cruft from prior runs in it. I can try deleting that and seeing if that helps. (done and cleared failure for rust, so it will try to build it again when it gets a chance, it's building other packages now)

@lazka
Copy link
Member

lazka commented Dec 25, 2022

@mati865
Copy link
Collaborator

mati865 commented Dec 25, 2022

Couldn't reproduce but noticed that .cargo dir inside Rust source dir disapperars. I'll have ony a phone until tomorrow.
Maybe you could do build with something like stat <path>/.cargo || echo absent put all over the place inside build() to discover when it goes missing and verify if it's copied to build directory?

@lazka
Copy link
Member

lazka commented Dec 26, 2022

Reverted for now, to unblock the build queue.

@jeremyd2019
Copy link
Member

Couldn't reproduce but noticed that .cargo dir inside Rust source dir disapperars. I'll have ony a phone until tomorrow. Maybe you could do build with something like stat <path>/.cargo || echo absent put all over the place inside build() to discover when it goes missing and verify if it's copied to build directory?

There is only one command after copying .cargo, running x.py install.

@jeremyd2019
Copy link
Member

.cargo exists both before and after x.py install fails.

@jeremyd2019
Copy link
Member

--enable-vendor is missing from config.toml. Maybe ${_rust_conf} needs to be "${_rust_conf[@]}" to configure? Trying that now

jeremyd2019 added a commit to jeremyd2019/MINGW-packages that referenced this pull request Dec 27, 2022
The bash array _rust_conf was being used as a 'scalar' (for lack of a
better term), resulting in only the first item being interpolated,
losing the `--enable-vendor` option necessary for a -gnullvm target to
build due to necessary patches to the vendored sources.  Currently, only
clangarm64 uses a gnullvm target, so it was the only one affected.

Addresses msys2#14592 (comment)
@jeremyd2019
Copy link
Member

that seems to have been it. I put in #14777 that reverts the revert and fixes the usage of _rust_conf array

@mati865
Copy link
Collaborator

mati865 commented Dec 27, 2022

Oh, nice catch.

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.

5 participants