Closed protolambda closed 3 years ago
It's because https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97714, which is triggered by Nim incorrectly generating #line 0
preprocessor directives. The two general workarounds right now are using a slightly older gcc
version (in Debian, gcc 10.2.0-15 works, but gcc 10.2.0-16 triggers this ICE), and compiling Nimbus without line-level debugging information.
I see https://github.com/protolambda/nimbus-docker/blob/master/Dockerfile bases itself on
FROM debian:bullseye-slim AS build
Which is where I first encountered this issue a few days ago: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973708
I suggest not targeting Debian bullseye at the moment, as the most expedient approach, or any other Debian-based distro which is on https://packages.debian.org/bullseye/gcc-10 at 10.2.0-16. https://metadata.ftp-master.debian.org/changelogs//main/g/gcc-10/gcc-10_10.2.0-16_changelog states that this regression was introduced on Thu, 29 Oct 2020 16:36:48 +0100, so anything before then is fine in the Debian lineage. For example, Ubuntu 20.04LTS or 20.10 should work fine.
Ideally, gcc upstream fixes this quickly enough so it's largely a non-issue. Otherwise, we'll have to adapt our build process.
https://github.com/nim-lang/Nim/issues/15942 fixes this, so the next Nim update will pick this up.
Fixed at some point in Debian sid, despite no visible progress upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97714. Tested 10.2.0-19 from https://packages.debian.org/sid/gcc-10 and it seems to work. Debian testing (bullseye) might or might not work yet, but at this point will within a couple of weeks, as unstable (sid) migrates to testing (bullseye).
Will still be good to also have the fix from Nim's side, but this resolves the issue as initially opened.
https://metadata.ftp-master.debian.org/changelogs//main/g/gcc-10/gcc-10_10.2.0-19_changelog explains this:
gcc-10 (10.2.0-19) unstable; urgency=medium
* Update to git 20201125 from the gcc-10 branch.
- Fix PR target/97730 (AArch64), PR target/97887 (x86), PR d/97889,
PR d/97843, PR d/97842, PR libstdc++/92546, PR libstdc++/97876,
PR libstdc++/95989, PR libstdc++/97869, PR c++/97918, PR debug/97060,
PR target/97534 (ARM), PR c++/96805, PR c++/96199.
* Configure again with --enable-checking=release.
* Enable again pgo and lto builds for 64bit architectures.
-- Matthias Klose <doko@debian.org> Wed, 25 Nov 2020 09:53:22 +0100
The important part is "Configure again with --enable-checking=release", as from the gcc issue, "it doesn't fail with --enable-checking=release".
https://gcc.gnu.org/install/configure.html :
--enable-checking=list
...
The categories of checks available in list are ‘yes’ (most common checks ‘assert,misc,gc,gimple,rtlflag,runtime,tree,types’), ‘no’ (no checks at all), ‘all’ (all but ‘valgrind’), ‘release’ (cheapest checks ‘assert,runtime’) or ‘none’ (same as ‘no’). ‘release’ checks are always on and to disable them ‘--disable-checking’ or ‘--enable-checking=no[,
That package maintainer was playing with fire.
Sure, there's some gcc bug hidden --enable-checking=yes,extra,rtl
is revealing. At least the maintainer could have minimized the difference by finding which of the check categories misc,gc,gimple,rtlflag,tree,types,extra,rtl
trigger this, and only disabling them.
It'd also narrow things down for the gcc people and anyone else looking at that bug.
Describe the bug
Trying to build nimbus, in preparation of Toledo testnet.
To Reproduce Steps to reproduce the behavior:
Host machine:
But running gcc from docker
commit: 11ab3a2f4fc381092a2f7a54b4d1c400b6a2cd14 branch: devel
From docker hack here: https://github.com/protolambda/nimbus-docker
Additional context
Let me know if I should be targetting another branch for Toledo testnet