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.18.0 #2448

Closed
wants to merge 5 commits into from
Closed

rust: Update to 1.18.0 #2448

wants to merge 5 commits into from

Conversation

martell
Copy link
Member

@martell martell commented May 9, 2017

wip: this is broken atm.

It try's to use u128 and i128 which are nightly features

  Compiling libc v0.2.21
   Compiling getopts v0.2.14
   Compiling gcc v0.3.43
   Compiling rustc-serialize v0.3.22
   Compiling num_cpus v0.2.13
   Compiling filetime v0.1.10
   Compiling build_helper v0.1.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/build_helper)
   Compiling cmake v0.1.21
   Compiling toml v0.1.30
   Compiling bootstrap v0.0.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap)
    Finished debug [unoptimized] target(s) in 13.3 secs
Building stage0 std artifacts (x86_64-pc-windows-gnu -> x86_64-pc-windows-gnu)
   Compiling unwind v0.0.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/libunwind)
   Compiling libc v0.2.21
   Compiling core v0.0.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/libcore)
   Compiling gcc v0.3.43
   Compiling libc v0.0.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/rustc/libc_shim)
   Compiling filetime v0.1.10
   Compiling build_helper v0.1.0 (file:///C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/build_helper)
error[E0412]: type name `i128` is undefined or not in scope
  --> C:\msys64\home\Martell\rust-stuff\MINGW-packages\mingw-w64-rust\src\rustc-1.17.0-src\src\libcore\num/i128.rs:17:19

@mati865 I know you have done a lot of work here so might be best to CC you on this.

@martell
Copy link
Member Author

martell commented May 9, 2017

Adding some notes.
It is defined as a nightly feature here
https://doc.rust-lang.org/std/primitive.u128.html

alexcrichton seems to think the previous patch is no longer needed so that is why I removed that
rust-lang/rust#39357

download.py doesn't exist in cargo anymore so I removed that patch also.
I have yet to check but I think they use rust itself now to download files.

I also updated the powershell work around into something that would not break other targets.
We can probably upstream that patch.

Also the merge of llvm 4.0 has been done here so we should be able to use the prebuilt llvm package now when that is updated to 4.0
rust-lang/rust#37609

@mati865
Copy link
Collaborator

mati865 commented May 9, 2017

It try's to use u128 and i128 which are nightly features

Maybe our rust was miscompiled, search for strings like overriding settings for in configure step and try disabling --enable-local-rust.

rust-lang/rust#39357 was fixed on master by rust-lang/rust@ad3f6e0 but Rust is using Firefox like release model.
When 0.17 got released beta became stable and master became beta.
Simplifier: commit I mentioned is present for Rust 1.18 and we should backport it (should apply cleanly as-is).

rust-lang/rust#37609 also didn't make it for 1.17 and porting all LLVM changes would be very intrusive.

@mati865
Copy link
Collaborator

mati865 commented May 9, 2017

Ok I'm an idiot since we have CI logs...
Anyway try without --enable-local-rust.

@martell
Copy link
Member Author

martell commented May 10, 2017

updated to fix a bad patch and remove --enable-local-rust

downloading https://static.rust-lang.org/dist/2017-03-11/rust-std-1.16.0-x86_64-pc-windows-gnu.tar.gz
######################################################################## 100.0%
Traceback (most recent call last):
  File "../rustc-1.17.0-src/x.py", line 20, in <module>
    bootstrap.main()
  File "C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap/bootstrap.py", line 594, in main
    bootstrap()
  File "C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap/bootstrap.py", line 577, in bootstrap
    rb.download_stage0()
  File "C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap/bootstrap.py", line 171, in download_stage0
    get("{}/{}".format(url, filename), tarball, verbose=self.verbose)
  File "C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap/bootstrap.py", line 45, in get
    if not verify(temp_path, sha_path, verbose):
  File "C:/msys64/home/Martell/rust-stuff/MINGW-packages/mingw-w64-rust/src/rustc-1.17.0-src/src/bootstrap/bootstrap.py", line 90, in verify
    expected = f.readline().split()[0]
IndexError: list index out of range

The sha256 verify step fails in python with using the prebuilt version

@mati865
Copy link
Collaborator

mati865 commented May 10, 2017

I have no clue what's going on.
You should ask on Rust IRC or create issue on github.

@mati865
Copy link
Collaborator

mati865 commented Jun 9, 2017

You can try with new 1.18 version.

@martell
Copy link
Member Author

martell commented Jun 9, 2017

Thanks, I saw the release yesterday. :)
Unfortunately I have a million things to do :(
Will get to it at some point though

@martell
Copy link
Member Author

martell commented Jun 14, 2017

Upstream rust now uses mingw-builds for all it's mingw-w64 toolchains.
As a result of this and switching i686 builds to mingw-w64 in general there were many teething issues between 1.15 and 1.17.0+ for this transition.

I managed to get 1.18.0 bootstrapped in the last hour while waiting for work related stuff to build.

Couple of notes.

  • I modified stage0 to use 1.18.0 as the host and not 1.17.0, apart from the issues I mentioned above 1.18.0 includes libpthread.a from mingw-w64 ( i.e libwinpthread.a).

  • Since the 1.19 branch the cargo version has been normalised as a submodule so in future we will not need to specifically git clone it. (Just leaving this note)

  • It is very easy to run into 256 MAX PATH issues when bootstrapping (example from older build)

IOError: [Errno 2] No such file or directory: 'C:/msys64/home/Martell/MINGW-packages/mingw-w64-rust/src/build-x86_64-w64-mingw32/build/x86_64-pc-windows-gnu/stage0/rust-std-1.17.0-x86_64-pc-windows-gnu/rust-std-x86_64-pc-windows-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc_jemalloc-e9752b373ef3204c.rlib'
==> ERROR: A failure occurred in build().

I renamed MINGW-packages to MP to get around this

  • One test fails with gcc exiting non zero for some cross create compile.
run-pass\specialization\specialization-cross-crate-defaults.rs
test result: FAILED. 2650 passed; 1 failed; 17 ignored; 0 measure 

Doubt it will be an issue but just noting it.

  • we can now technically switch to using our LLVM package but the rust version is not exactly vanilla LLVM 4.0, there are a bunch of backports to fix rust specific bugs from time to time.

I will at some point split the llvm and clang packages into different PKGBUILD files to make this kind of thing much easier, I noticed alpine linux ships llvm-config as part of the package to achieve this.

Anyway this should be good to merge and ship. :)

I got a Rust is ready to roll.

@martell martell changed the title rust: Update to 1.17.0 rust: Update to 1.18.0 Jun 14, 2017
@mati865
Copy link
Collaborator

mati865 commented Jun 14, 2017

They don't use MSYS2 toolchains, it's still mingw-builds but updated to 6.3.0 and with pthread.

Llvm-config should be fine, I've patched it.

I'll check this PR when I return home.

@martell
Copy link
Member Author

martell commented Jun 14, 2017

Hmm an actual look at the gcc shipped with it I think you are right.

/c/Users/Martell/Downloads/rust-mingw-1.18.0-x86_64-pc-windows-gnu.tar/rust-mingw-1.18.0-x86_64-pc-windows-gnu/rust-mingw/lib/rustlib/x86_64-pc-windows-gnu/bin/gcc.exe --version
gcc.exe (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Will update comments to reflect.
I have no idea what nonsense I have been reading about using msys2s' mingw-w64.
Maybe they meant the environment + mingw-builds

There are a few other things to ship for llvm like FileCheck, not and the lit suite for testing.

@mati865
Copy link
Collaborator

mati865 commented Jun 14, 2017

Damn, looks like 1.18 comes with GCC 6.2.0 with Windows threads and libpthread from MSYS2.
Current beta (future 1.19) will be using good toolchain rust-lang/rust@d1db74b

@martell
Copy link
Member Author

martell commented Jun 14, 2017

libwinpthreads from mingw-w64 you mean?
My biggest take away for the next release was the cargo submodule sync.
rust-lang/rust@5daf557

Now we just need to see the last of the clang patches land and we can shipit without gcc :)
Should get some more time this weekend to update them for rui

@mati865
Copy link
Collaborator

mati865 commented Jun 14, 2017

I thought x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z doesn't contain libpthread (it's targetting Windows threads anyway) but I was wrong.

@mati865
Copy link
Collaborator

mati865 commented Jun 14, 2017

Run updpkgsums: ERROR: Integrity checks (sha256) differ in size from the source array.

@martell
Copy link
Member Author

martell commented Jun 14, 2017

Yeah that happened because I never ran it after stashing some changes :)
I fixed that about 10 mins before your comment :D

Also note that cargo seems to be broken with private git repos.
This was true for previous versions also, so it is not from this change.
I am assuming it is due to the libgit2 depend previously missing but don't have time to dig further right now. I will at some point split cargo into it's own PKGBUILD with a check stage for this.

@mati865
Copy link
Collaborator

mati865 commented Jun 14, 2017

@martell our Rust was very error-prone and Rust is supposed to be build by previous stable or newer toolchain (here we have 1.15.1 -> 1.18).
It most likely won't build with --enable-local-rust.

Another thing to consider is rustup, official and recommend way to install Rust on every supported OS.

@martell
Copy link
Member Author

martell commented Jun 14, 2017

@mati865 We will not use 1.15.1 to build this.
When alexey is releasing a package he will build it without --enable-local-rust and then install that package with pacman -U and rebuild with --enable-local-rust which is a bootstrap.
This is the exact same way we would bootstrap gcc.
I just undone my removal of --enable-local-rust from the PKGBUILD because alexey will have to commit it again after doing the bootstrap.

I don't think we should use rustup for anything in msys2 packages, it will create a bunch of more bug reports for us because of mixing toolchains etc

@lazka
Copy link
Member

lazka commented May 10, 2019

rust is at 1.29.2 now (https://packages.msys2.org/base/mingw-w64-rust), so this can be closed I guess?

@lazka lazka added the needinfo label May 10, 2019
@lazka lazka closed this May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants