Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-25 Thread John Paul Adrian Glaubitz
Hello!

With the attached patch, I can almost fully build rustc 1.29 natively on mips,
but it fails again with an out-of-memory error while generating the Rustbook:

Rustbook (mips-unknown-linux-gnu) - unstable-book
running: 
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/stage0-tools-bin/rustbook"
 "build"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/md-doc/unstable-book"
 "-d"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/doc/unstable-book"
memory allocation of 1342177280 bytes failed

command did not execute successfully: 
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/stage0-tools-bin/rustbook"
 "build"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/md-doc/unstable-book"
 "-d"
"/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/mips-unknown-linux-gnu/doc/unstable-book"
expected success, got: signal: 6


Traceback (most recent call last):
  File "./x.py", line 20, in 
bootstrap.main()
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", 
line 842, in main
bootstrap(help_triggered)
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", 
line 833, in bootstrap
run(args, env=env, verbose=build.verbose)
  File "/home/glaubitz/rustc/rustc-1.29.0+dfsg1/src/bootstrap/bootstrap.py", 
line 149, in run
raise RuntimeError(err)
RuntimeError: failed to run: 
/home/glaubitz/rustc/rustc-1.29.0+dfsg1/build/bootstrap/debug/bootstrap install 
--config debian/config.toml -vv --on-fail env
make[1]: *** [debian/rules:271: override_dh_auto_install] Error 1
make[1]: Leaving directory '/home/glaubitz/rustc/rustc-1.29.0+dfsg1'
make: *** [debian/rules:132: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned 
exit status 2

I also disabled the debug symbols for stdlib on mips/mipsel (same as for 32-bit 
ARM):

[ $(DEB_BUILD_ARCH) != mips -a \
  $(DEB_BUILD_ARCH) != mipsel ] || sed -i -e '/^debuginfo-only-std = 
/d' "$@"

So, if we move the generation of the Rustbook into the binary-indep target 
(which
we should do anyway, shouldn't we), then rustc should build fine on 32-bit MIPS.

Note: We still need this one patch for LLVM backported to fix the atomics issue
  otherwise the testsuite will hang.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: 
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 rustc (1.29.0+dfsg1-1) unstable; urgency=medium
 .
   * Upload to unstable.
   * Drop d-armel-disable-kernel-helpers.patch as a necessary part of the
 fix to #906520, so it is actually fixed.
   * Backport a patch to fix the rand crate on powerpc. (Closes: #909400)
   * Lower the s390x allowed failures back to 25.
Author: Ximin Luo 
Bug-Debian: https://bugs.debian.org/909400

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: , 
Bug: 
Bug-Debian: https://bugs.debian.org/
Bug-Ubuntu: https://launchpad.net/bugs/
Forwarded: 
Reviewed-By: 
Last-Update: 2018-10-24

--- rustc-1.29.0+dfsg1.orig/src/librustc_codegen_llvm/llvm_util.rs
+++ rustc-1.29.0+dfsg1/src/librustc_codegen_llvm/llvm_util.rs
@@ -66,6 +66,8 @@ unsafe fn configure_llvm(sess: )
 add("-disable-preinline");
 }
 
+	if sess.target.target.arch == "mips" || sess.target.target.arch == "mips64" { add("-fast-isel=0"); }
+
 for arg in _args {
 add(&(*arg));
 }
--- rustc-1.29.0+dfsg1.orig/src/test/run-pass/invalid_const_promotion.rs
+++ rustc-1.29.0+dfsg1/src/test/run-pass/invalid_const_promotion.rs
@@ -33,7 +33,8 @@ fn check_status(status: std::process::Ex
 use std::os::unix::process::ExitStatusExt;
 
 assert!(status.signal() == Some(libc::SIGILL)
-|| status.signal() == Some(libc::SIGABRT));
+|| status.signal() == Some(libc::SIGABRT)
+	|| status.signal() == Some(libc::SIGTRAP));
 }
 
 #[cfg(not(unix))]
--- rustc-1.29.0+dfsg1.orig/src/test/ui/asm-out-assign-imm.rs
+++ rustc-1.29.0+dfsg1/src/test/ui/asm-out-assign-imm.rs
@@ -10,6 +10,8 @@
 
 // ignore-s390x
 // ignore-emscripten
+// ignore-mips
+// ignore-mips64
 // ignore-powerpc
 // ignore-powerpc64
 // ignore-powerpc64le
--- rustc-1.29.0+dfsg1.orig/src/test/ui/target-feature-gate.rs
+++ rustc-1.29.0+dfsg1/src/test/ui/target-feature-gate.rs
@@ -12,6 +12,8 @@
 // ignore-aarch64
 // ignore-wasm
 // 

Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-24 Thread John Paul Adrian Glaubitz
Hi!

On 10/19/18 10:56 AM, Dragan Mladjenovic wrote:
> @YunQiang Su  Are you referring to failures shown 
> in [1] ?
> 
> 
> If so, here is the overview : 
> 
>>test [ui] ui/asm-out-assign-imm.rs
>>test [ui] ui/target-feature-gate.rs
>>test [ui] ui/target-feature-wrong.rs
> 
> Fix:[2]. Should be ignored. 
> 
> 
>>test [run-pass] run-pass/invalid_const_promotion.rs
> 
> Needs SIGTRAP added to the list at [3]. 
> 
> 
>>test [run-make] run-make-fulldeps/relocation-model
> 
> Bug:[4]. Should be ignored on both mips64 and mips [5]. 

I'll create Debian patches for those.

> Quick comment on the mips. Except of the OOM problems other problems 
> (including the atomics one) on mips are usually 
> 
> caused by its usage of llvm's FastISel in unoptimized builds. You could try 
> disabling it or even try optimized build.
> 
> I believe that for 1.28 we could finish the native bootstrapping in optimized 
> build while unoptimized one would OOM.   
Upstream does that for arm64 as well, see: 
https://github.com/rust-lang/rust/commit/ea50bf8850304e8afefa9089792fc077fb54aef4

I can try whether the combination of above all gets me a working rustc
on mips*.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-19 Thread John Paul Adrian Glaubitz
On 10/19/18 11:53 AM, John Paul Adrian Glaubitz wrote:
>> Needs SIGTRAP added to the list at [3]. 
>> 
>> (...)
>> [3] 
>> https://github.com/rust-lang/rust/blob/master/src/test/run-pass/invalid_const_promotion.rs#L42
> 
> I think we're missing something here. You linked the test but I think you
> meant to link the part of the Rust source which has the list where mips*
> needs to be added.

Ok, never mind. I misunderstood what you were saying. You meant adding
"SIGTRAP" to this assert(). I thought you were talking about some arch-
specific list.

But this test passes on sparc64 anyway.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-19 Thread John Paul Adrian Glaubitz
Hi Dragan!

Thanks for the help!

On 10/19/18 10:56 AM, Dragan Mladjenovic wrote:
>>test [run-pass] run-pass/invalid_const_promotion.rs
> 
> Needs SIGTRAP added to the list at [3]. 
> 
> (...)
> [3] 
> https://github.com/rust-lang/rust/blob/master/src/test/run-pass/invalid_const_promotion.rs#L42

I think we're missing something here. You linked the test but I think you
meant to link the part of the Rust source which has the list where mips*
needs to be added.

I would like to check whether sparc* need to be added there, too.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-19 Thread Dragan Mladjenovic
Hi all,


@YunQiang Su<mailto:wzss...@gmail.com> Are you referring to failures shown in 
[1] ?


If so, here is the overview :

>test [ui] ui/asm-out-assign-imm.rs
>test [ui] ui/target-feature-gate.rs
>test [ui] ui/target-feature-wrong.rs

Fix:[2]. Should be 
ignored.<https://github.com/rust-lang/rust/commit/f985e6cfd42ee5ef8e7613d11a002253ab87c52f>

>test [run-pass] run-pass/invalid_const_promotion.rs

Needs SIGTRAP added to the list at 
[3].<https://github.com/rust-lang/rust/blob/master/src/test/run-pass/invalid_const_promotion.rs#L42>

>test [run-make] run-make-fulldeps/relocation-model

Bug:[4]. Should be ignored on both mips64 and mips [5].


Quick comment on the mips. Except of the OOM problems other problems (including 
the atomics one) on mips are usually

caused by its usage of llvm's FastISel in unoptimized builds. You could try 
disabling it or even try optimized build.

I believe that for 1.28 we could finish the native bootstrapping in optimized 
build while unoptimized one would OOM.

Hope this helps in any way.


[1] 
https://buildd.debian.org/status/fetch.php?pkg=rustc=mips64el=1.29.0%2Bdfsg1-1=1538287611=0

[2] 
https://github.com/rust-lang/rust/commit/f985e6cfd42ee5ef8e7613d11a002253ab87c52f

[3] 
https://github.com/rust-lang/rust/blob/master/src/test/run-pass/invalid_const_promotion.rs#L42

<https://github.com/rust-lang/rust/issues/49905>

[4] https://github.com/rust-lang/rust/issues/49421

[5] https://github.com/rust-lang/rust/issues/49905


Best regards,

Dragan


From: YunQiang Su 
Sent: Friday, October 19, 2018 3:08 AM
To: Aron Xu
Cc: John Paul Adrian Glaubitz; PozueloEmilio Monfort; Sylvestre Ledru; 
881...@bugs.debian.org; infini...@debian.org; debian-m...@lists.debian.org; 
James Cowgill; Dragan Mladjenovic
Subject: Re: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: 
Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on 
mips*: test failures

add Dragan Mladjenovic, who is maintaining rust for mips.

@Dragan can you help to debug rustc on mips64el, we have some test failures.

I noticed that we allow more test failures on some arch.
Can we also do it for mips64el for temporary?
Aron Xu  于2018年10月3日周三 下午8:40写道:
>
> On Wed, Oct 3, 2018 at 5:54 PM John Paul Adrian Glaubitz
>  wrote:
> >
> > On 10/3/18 10:35 AM, Emilio Pozuelo Monfort wrote:
> > >> Can you backport the llvm fix to llvm 7?
> > >
> > > Actually given 7 is not in testing and rust is not using it atm, what 
> > > would be
> > > good is to have this backported to llvm 6 asap, so that we can 
> > > (hopefully) get
> > > rust bootstrapped in mips*, which is blocking quite some stuff.
> >
> > Even if you fix this particular bug, you are still running into the 
> > unfortunate
> > situation on the 32-bit MIPS architectures that there is not enough virtual
> > address space per process for Rust to work so you will always end up in
> > out-of-memory situations when building rustc natively on 32-bit MIPS.
> >
> > I have done extensive testing and tried lots of different approaches to
> > reduce the memory footprint of the Rust compiler, but so far I have
> > never succeeded in building rustc natively on 32-bit MIPS.
> >
>
> I haven't tried this yet. Wonders if it's doable to build 32bit rustc
> natively without debugging symbols (where Debian builds full debug
> symbols which consumes a lot of the address space), if that's doable
> we can consider adding something like -gsplit-dwarf to rustc to relax
> the situation.
>
> Regards,
> Aron



--
YunQiang Su


Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-18 Thread YunQiang Su
add Dragan Mladjenovic, who is maintaining rust for mips.

@Dragan can you help to debug rustc on mips64el, we have some test failures.

I noticed that we allow more test failures on some arch.
Can we also do it for mips64el for temporary?
Aron Xu  于2018年10月3日周三 下午8:40写道:
>
> On Wed, Oct 3, 2018 at 5:54 PM John Paul Adrian Glaubitz
>  wrote:
> >
> > On 10/3/18 10:35 AM, Emilio Pozuelo Monfort wrote:
> > >> Can you backport the llvm fix to llvm 7?
> > >
> > > Actually given 7 is not in testing and rust is not using it atm, what 
> > > would be
> > > good is to have this backported to llvm 6 asap, so that we can 
> > > (hopefully) get
> > > rust bootstrapped in mips*, which is blocking quite some stuff.
> >
> > Even if you fix this particular bug, you are still running into the 
> > unfortunate
> > situation on the 32-bit MIPS architectures that there is not enough virtual
> > address space per process for Rust to work so you will always end up in
> > out-of-memory situations when building rustc natively on 32-bit MIPS.
> >
> > I have done extensive testing and tried lots of different approaches to
> > reduce the memory footprint of the Rust compiler, but so far I have
> > never succeeded in building rustc natively on 32-bit MIPS.
> >
>
> I haven't tried this yet. Wonders if it's doable to build 32bit rustc
> natively without debugging symbols (where Debian builds full debug
> symbols which consumes a lot of the address space), if that's doable
> we can consider adding something like -gsplit-dwarf to rustc to relax
> the situation.
>
> Regards,
> Aron



-- 
YunQiang Su



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-03 Thread Aron Xu
On Wed, Oct 3, 2018 at 5:54 PM John Paul Adrian Glaubitz
 wrote:
>
> On 10/3/18 10:35 AM, Emilio Pozuelo Monfort wrote:
> >> Can you backport the llvm fix to llvm 7?
> >
> > Actually given 7 is not in testing and rust is not using it atm, what would 
> > be
> > good is to have this backported to llvm 6 asap, so that we can (hopefully) 
> > get
> > rust bootstrapped in mips*, which is blocking quite some stuff.
>
> Even if you fix this particular bug, you are still running into the 
> unfortunate
> situation on the 32-bit MIPS architectures that there is not enough virtual
> address space per process for Rust to work so you will always end up in
> out-of-memory situations when building rustc natively on 32-bit MIPS.
>
> I have done extensive testing and tried lots of different approaches to
> reduce the memory footprint of the Rust compiler, but so far I have
> never succeeded in building rustc natively on 32-bit MIPS.
>

I haven't tried this yet. Wonders if it's doable to build 32bit rustc
natively without debugging symbols (where Debian builds full debug
symbols which consumes a lot of the address space), if that's doable
we can consider adding something like -gsplit-dwarf to rustc to relax
the situation.

Regards,
Aron



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-03 Thread John Paul Adrian Glaubitz
On 10/3/18 10:35 AM, Emilio Pozuelo Monfort wrote:
>> Can you backport the llvm fix to llvm 7?
> 
> Actually given 7 is not in testing and rust is not using it atm, what would be
> good is to have this backported to llvm 6 asap, so that we can (hopefully) get
> rust bootstrapped in mips*, which is blocking quite some stuff.

Even if you fix this particular bug, you are still running into the unfortunate
situation on the 32-bit MIPS architectures that there is not enough virtual
address space per process for Rust to work so you will always end up in
out-of-memory situations when building rustc natively on 32-bit MIPS.

I have done extensive testing and tried lots of different approaches to
reduce the memory footprint of the Rust compiler, but so far I have
never succeeded in building rustc natively on 32-bit MIPS.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-03 Thread Emilio Pozuelo Monfort
On 02/10/2018 17:33, Emilio Pozuelo Monfort wrote:
> On 02/10/2018 17:26, Sylvestre Ledru wrote:
>> Le 02/10/2018 à 16:55, John Paul Adrian Glaubitz a écrit :
>>> On 10/2/18 4:53 PM, Sylvestre Ledru wrote:
> Can you open bug reports against llvm-toolchain-6.0 and llvm-toolchain-7 
> to
> make sure, the fix gets backported?
 I would prefer that rustc uses llvm 7 instead of 6.
>>>
>>> What is the current progress with this upstream? I have not followed
>>> up on this part? Sure, I prefer LLVM 7 as well. But as long as Rust
>>> upstream is not ready yet, we have to stick with what we have.
>>
>> Looks like it is what we are using in experimental
>> https://tracker.debian.org/news/990088/accepted-rustc-1300beta7dfsg1-1exp2-source-into-experimental/
> 
> Can you backport the llvm fix to llvm 7?

Actually given 7 is not in testing and rust is not using it atm, what would be
good is to have this backported to llvm 6 asap, so that we can (hopefully) get
rust bootstrapped in mips*, which is blocking quite some stuff.

Thanks,
Emilio



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-02 Thread Emilio Pozuelo Monfort
On 02/10/2018 17:26, Sylvestre Ledru wrote:
> Le 02/10/2018 à 16:55, John Paul Adrian Glaubitz a écrit :
>> On 10/2/18 4:53 PM, Sylvestre Ledru wrote:
 Can you open bug reports against llvm-toolchain-6.0 and llvm-toolchain-7 to
 make sure, the fix gets backported?
>>> I would prefer that rustc uses llvm 7 instead of 6.
>>
>> What is the current progress with this upstream? I have not followed
>> up on this part? Sure, I prefer LLVM 7 as well. But as long as Rust
>> upstream is not ready yet, we have to stick with what we have.
> 
> Looks like it is what we are using in experimental
> https://tracker.debian.org/news/990088/accepted-rustc-1300beta7dfsg1-1exp2-source-into-experimental/

Can you backport the llvm fix to llvm 7?

Thanks,
Emilio



Bug#881845: [Pkg-rust-maintainers] Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: Bug#881845: rustc: FTBFS on mips*: test failures

2018-10-02 Thread Sylvestre Ledru
Le 02/10/2018 à 16:55, John Paul Adrian Glaubitz a écrit :
> On 10/2/18 4:53 PM, Sylvestre Ledru wrote:
>>> Can you open bug reports against llvm-toolchain-6.0 and llvm-toolchain-7 to
>>> make sure, the fix gets backported?
>> I would prefer that rustc uses llvm 7 instead of 6.
> 
> What is the current progress with this upstream? I have not followed
> up on this part? Sure, I prefer LLVM 7 as well. But as long as Rust
> upstream is not ready yet, we have to stick with what we have.

Looks like it is what we are using in experimental
https://tracker.debian.org/news/990088/accepted-rustc-1300beta7dfsg1-1exp2-source-into-experimental/
Cheers,
S