From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: bug#30756: GCC >= 6 '-isystem' and C_INCLUDE_PATH behavior changed, breaking Date: Thu, 06 Feb 2020 22:39:06 -0500 Message-ID: <87ftfnm5gl.fsf@gmail.com> References: <87y2u3qh8b.fsf@gnu.org> <87r1zulsgc.fsf@gmail.com> <87sgkaik08.fsf@gnu.org> <878sm0kx8b.fsf@gmail.com> <87wo9hnbp9.fsf@gnu.org> <87blqg2gg5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izuUt-0001uZ-4y for bug-guix@gnu.org; Thu, 06 Feb 2020 22:40:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izuUr-00059d-Vi for bug-guix@gnu.org; Thu, 06 Feb 2020 22:40:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42814) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izuUr-000599-Sc for bug-guix@gnu.org; Thu, 06 Feb 2020 22:40:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1izuUr-0000xV-NC for bug-guix@gnu.org; Thu, 06 Feb 2020 22:40:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87blqg2gg5.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 03 Feb 2020 10:00:42 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: reza.housseini@gmx.ch, 30756@debbugs.gnu.org, Reza Housseini Hello Ludovic, Ludovic Court=C3=A8s writes: > Hello comrades! > > (+Cc: Marius.) > > Ludovic Court=C3=A8s skribis: > >> =E2=80=98%final-inputs=E2=80=99 order actually looks good: >> >> scheme@(gnu packages commencement)> (map car %final-inputs) >> $2 =3D ("tar" "gzip" "bzip2" "xz" "file" "diffutils" "patch" "findutils"= "gawk" "sed" "grep" "coreutils" "make" "bash" "ld-wrapper" "binutils" "gcc= " "libc" "libc:static" "locales") >> >> >> But then it breaks when we add everything: >> >> scheme@(guile-user)> (map car (bag-transitive-inputs (package->bag coreu= tils))) >> $5 =3D ("source" "perl" "tar" "gzip" "bzip2" "xz" "file" "diffutils" "pa= tch" "findutils" "gawk" "sed" "grep" "coreutils" "make" "bash" "ld-wrapper"= "binutils" "gcc" "libc" "libc:static" "locales" "acl" "gmp" "libcap" "kern= el-headers") >> >> Here acl, gmp, and libcap should be before libc and all >> (=E2=80=98bag-transitive-inputs=E2=80=99 is used by =E2=80=98bag->deriva= tion=E2=80=99.) >> >> So I think we should arrange to have the right order in >> =E2=80=98bag->derivation=E2=80=99. > > The attached patch does three things: > > 1. Fix the order of inputs computed by (@@ (guix build-system gnu) > lower) so that implicit inputs come last. In particular, this > ensures that libc headers and kernel headers come last. All user > libraries passed as =E2=80=98inputs=E2=80=99 appear before libc, so = they can > #include_next a libc header. > > 2. Add =E2=80=9Cinclude/c++=E2=80=9D to the list of directories of > =E2=80=98CPLUS_INCLUDE_PATH=E2=80=99. This is a not-so-elegant hack= ; the main > purpose here is to make sure the gcc/libstdc++ include directory > appears twice in the search path, so that this chain of include > works as expected: > > (GCC): #include_next > =E2=86=92 (GCC): #include_next > =E2=86=92 (libc) > > 3. Switch back to =E2=80=98C_INCLUDE_PATH=E2=80=99 & co. instead of =E2= =80=98CPATH=E2=80=99 (yay!). > > I=E2=80=99ve tested it with =E2=80=9Cguix build coreutils=E2=80=9D, which= involved building GMP > with its C++ bindings, making it a rather good test. However, more > testing is needed. > > There=E2=80=99s potential for breakage in all the places where we=E2=80= =99ve manually > fiddled with C{,PLUS}_INCLUDE_PATH. I guess we=E2=80=99ll have to review= all of > them. > > Since it fixes a rather serious issue for C/C++ developers (they=E2=80=99d > rather not see warnings about system headers) but also for packaging > (=E2=80=98-Werror=E2=80=99 breaks for warnings that shouldn=E2=80=99t be = there in the first > place), I=E2=80=99d like to propose merging it in this =E2=80=98core-upda= tes=E2=80=99 cycle. > But let=E2=80=99s face it: it=E2=80=99ll keep us busy for a bit. :-) > > Thoughts? > > Ludo=E2=80=99. Thank you for working on a fix, and properly understanding the root cause of the problem. I've reviewed it and it seems great! I see that it is already in core-updates. I will go ahead and proceed with rebuilding the world and see what ensues! :-) Cheers, Maxim