Package Details: mingw-w64-rust 1.43.1-2

Git Clone URL: https://aur.archlinux.org/mingw-w64-rust.git (read-only, click to copy)
Package Base: mingw-w64-rust
Description: Systems programming language focused on safety, speed and concurrency (mingw-w64)
Upstream URL: https://www.rust-lang.org
Keywords: mingw-w64 rust
Licenses: custom, MIT, Apache
Submitter: pingplug
Maintainer: pingplug
Last Packager: pingplug
Votes: 3
Popularity: 0.000002
First Submitted: 2018-02-13 16:00
Last Updated: 2020-05-19 18:06

Pinned Comments

pingplug commented on 2018-02-14 05:35

  1. Rust can not build upon sjlj version of MinGW (i686-w64-mingw32 toolchain in mingw-w64-gcc<10.1.0).
  2. building mingw-w64-rust will take about 50GiB, make sure that your $BUILDDIR have enough free space.
  3. Rust will check $prefix when packaging, please make an empty $prefix dir (for example /opt/rust) if you don't have one, and don't forget to remove this dir before install this package.
  4. THERE IS NO GUARANTEE RUST CAN HOST ITSELF WITH THE SAME VERSION OF RUST! They only test building rust from the last stable version of rust. This package will use the last version of rust for bootstrap, not depend on system rust.
  5. to use this, you should add /opt/rust/bin to PATH, and set CARGO_HOME to /opt/rust/cargo.

Latest Comments

1 2 Next › Last »

pingplug commented on 2020-05-20 02:09

@Martchus, now I removed PKGEXT=".pkg.tar.gz" as zstd is fast enough.

Add --keep-stage in package() to reuse binary in build()

use codegen-units=0 to enable multithread codegen(I disabled this at the first time just because my laptop didn't have enough memory)

Martchus commented on 2020-05-19 15:57

I haven't tested this, but using xz will take a long time

Ok, so it is just about the time. I guess I'll just add yet another hack to my build system to append PKGEXT=".pkg.tar.zst" to PKGBUILDs so I don't have to care anymore about that.

It's a bug with python3(build stage0 to stage2 twice), switching to python2 may help(python2 didn't support xz, you need to change the source to .tar.gz).

Although I observed the build via htop I can't remember which Python version was primarily used during the build. It might even have used Python 3 most of the time. However, it still needs Python 2 at least in src/bootstrap/sanity.rs:59:13 (whatever that code does - likely nothing with archive extraction; see the error I've pasted in the first comment). So it could be that while already using mostly Python 3 the build still needs Python 2 for some tiny bits.

This check was added in rust half year ago, maybe it has been removed now. I'll try it.

No need to try it. I've ran into this issue and can confirm that the check is still in place.

pingplug commented on 2020-05-19 15:00

@Martchus

Or is the default (now zstd) really that bad for this particular package?

I haven't tested this, but using xz will take a long time

By the way, with python2 it builds now so that was the only missing dependency. I've also noticed that the package() phase takes unusually long

It's a bug with python3(build stage0 to stage2 twice), switching to python2 may help(python2 didn't support xz, you need to change the source to .tar.gz).

The requirement to have /opt/rust is a bit annoying

This check was added in rust half year ago, maybe it has been removed now. I'll try it.

I've also noticed that the package does not use all CPU cores.

I'll try 'codegen-units=0'

Martchus commented on 2020-05-19 09:59

I would avoid adding configuration variables of makepkg.conf in the PKGBUILD like PKGEXT=".pkg.tar.gz". Or is the default (now zstd) really that bad for this particular package?

By the way, with python2 it builds now so that was the only missing dependency. The requirement to have /opt/rust is a bit annoying when using makechrootpkg but I guess if there was a better solution you would already use it. Yet I'm wondering whether this directory could not simply be adjusted to some path within $srcdir by setting an environment variable. Maybe it is worth pointing out in the pinned comment that this directory must exist but is not populated with files after all (and therefore must not be preserved).

I've also noticed that the package does not use all CPU cores. It seems to spawn "enough processes" but when looking at htop often only one core is used. Not sure whether that can be improved.

I've also noticed that the package() phase takes unusually long and I'm under the impression that the build system actually compiles components again which have already been compiled in the actual build() phase. I'm wondering whether that is right and could be improved.

But thanks for provided the package. This build system must really been annoying to deal with and I appreciate the effort.

Martchus commented on 2020-05-18 09:26

Now, since DW2 is enabled by mingw-w64-gcc I'm trying to rebuild. Apparently the dependency python2 is missing:

   Compiling toml v0.5.3
   Compiling bootstrap v0.0.0 (/build/mingw-w64-rust/src/rustc-1.43.1-src/src/bootstrap)
    Finished dev [unoptimized] target(s) in 3m 00s
thread 'main' panicked at '

couldn't find required command: "python2.7"

', src/bootstrap/sanity.rs:59:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /build/mingw-w64-rust/src/rustc-1.43.1-src/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:03:25
==> ERROR: A failure occurred in build().

https://martchus.no-ip.biz/build-data/rebuild-dw2/mingw-w64-rust/pkg/build.log

xantares commented on 2020-05-14 14:17

mingw-w64-gcc does not use sjlj anymore :)

pingplug commented on 2019-07-18 13:22

@marmistrz this is only for bootstrap, see my pinned comment

marmistrz commented on 2019-07-18 12:43

You forgot to change _rustc=1.35.0 to _rustc=1.36.0

luigoalma commented on 2018-12-12 01:09

I've noticed something was not right on the PKGBUILD, I got the mingw-w64-gcc with --disable-sjlj-exceptions instead of --disable-dw2-exceptions so i was able to build it, but as on this version (as of this writing, 1.31.0-1 @ commit [8570d05](https://aur.archlinux.org/cgit/aur.git/commit/?h=mingw-w64-rust&id=8570d05)) caused file conflicts with host's rust itself, then I looked into the PKGBUILD and saw it was set to prefix being usr. I had to patch it to fix installing it. Was this path really intended? https://gist.githubusercontent.com/luigoalma/20e8aae578c33e53ac7477a2a318b50a/raw/d893d072daf3af81d30e11a211e6e9a4cab1d203/PKGBUILD.patch the changes I performed in the PKGBUILD to get it to install like before, as last version i had installed was 1.29.0-1

Forty-Bot commented on 2018-04-04 03:29

The build fails with

==> Making package: mingw-w64-rust 1.25.0-1 (Tue Apr  3 23:21:51 EDT 2018)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading rustc-1.25.0-src.tar.xz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 53.5M  100 53.5M    0     0  2037k      0  0:00:26  0:00:26 --:--:-- 1793k
  -> Downloading rustc-1.25.0-src.tar.xz.asc...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   819  100   819    0     0   2073      0 --:--:-- --:--:-- --:--:--  2068
  -> Found mingw-config.toml
==> Validating source files with sha256sums...
    rustc-1.25.0-src.tar.xz ... Passed
    rustc-1.25.0-src.tar.xz.asc ... Skipped
    mingw-config.toml ... Passed
==> Verifying source file signatures with gpg...
    rustc-1.25.0-src.tar.xz ... Passed
==> Extracting sources...
  -> Extracting rustc-1.25.0-src.tar.xz with bsdtar
==> Starting prepare()...
==> Starting build()...
   Compiling cfg-if v0.1.2
   Compiling serde v1.0.27
   Compiling num-traits v0.1.41
   Compiling itoa v0.3.4
   Compiling dtoa v0.4.2
   Compiling getopts v0.2.15
   Compiling libc v0.2.39
   Compiling lazy_static v0.2.11
   Compiling cc v1.0.4
   Compiling unicode-xid v0.0.4
   Compiling quote v0.3.15
   Compiling time v0.1.39
   Compiling num_cpus v1.8.0
   Compiling filetime v0.1.15
   Compiling synom v0.11.3
   Compiling cmake v0.1.29
   Compiling syn v0.11.11
   Compiling build_helper v0.1.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/build_helper)
   Compiling serde_derive_internals v0.19.0
   Compiling serde_json v1.0.9
   Compiling toml v0.4.5
   Compiling serde_derive v1.0.27
   Compiling bootstrap v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/bootstrap)
    Finished dev [unoptimized] target(s) in 52.72 secs
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cc v1.0.4
   Compiling libc v0.2.39
   Compiling cfg-if v0.1.2
   Compiling unwind v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/libunwind)
   Compiling core v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/libcore)
   Compiling filetime v0.1.15
   Compiling build_helper v0.1.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/build_helper)
   Compiling std v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/libstd)
   Compiling compiler_builtins v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/rustc/compiler_builtins_shim)
   Compiling cmake v0.1.29
   Compiling alloc_jemalloc v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/liballoc_jemalloc)
   Compiling rustc_msan v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/librustc_msan)
   Compiling rustc_tsan v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/librustc_tsan)
   Compiling rustc_lsan v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/librustc_lsan)
   Compiling rustc_asan v0.0.0 (file:///home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/librustc_asan)
error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors
   --> libcore/any.rs:399:25
    |
399 |             t: unsafe { intrinsics::type_id::<T>() },
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `/home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/build/bootstrap/debug/rustc --crate-name core libcore/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=ff3f82c71e6fa661 -C extra-filename=-ff3f82c71e6fa661 --out-dir /home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/build/x86_64-unknown-linux-gnu/stage0-std/release/deps` (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed
thread 'main' panicked at 'command did not execute successfully: "/usr/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--frozen" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap/compile.rs:1060:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /home/user/.cache/pacaur/mingw-w64-rust/src/rustc-1.25.0-src/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:01:52
==> ERROR: A failure occurred in build().
    Aborting...