From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by sourceware.org (Postfix) with ESMTPS id 93AED3858D1E for ; Tue, 5 Dec 2023 05:26:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93AED3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=protonmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 93AED3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.70.43.22 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701753990; cv=none; b=sMSn6Wo84xemVj/4aPhN+MhimBeBYEMijGI7uzyrVQBlzd7ItOSIsLA1GEDYgztBoRNUsY14HRktGVojvt07Coa/PaXumsP31f7APiJ85yPTYh8s2TF9hU/ME1j1cWTOcUHqLzn+mGj248MryC8CJNrPv6ngBRRzfI/6BN0XDcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701753990; c=relaxed/simple; bh=JKRp4cbOMNMV856vTPYz65AOYCZm8+ovq0+nz0fzlzk=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=ZuDwxU/cRKJhYszS5pohLt0GJNF7ERimTbM9iG4u7dXtn/H0Zz8vz6UkSX8+6te4m2e80znVbtU1Ml15Jpo8HZW8criDUd7xEkFKUZ+evrTb8YvYf+cuORCuN36KA3pCK8x9WxjUz4Xn6IOCyrLyazKL5nMIl9oDfXWayGUZgw4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701753977; x=1702013177; bh=JKRp4cbOMNMV856vTPYz65AOYCZm8+ovq0+nz0fzlzk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OkvIBIgR39YRxCtFhytR2Zu4zxDBamNtn5l7EkHcbs5OCN0/zMGTmDu4chn+XhmVd IvAm6uLIw7bmdW9dlb3SC6s5xhZjV6W7U1IVOb6lIBLpbvp7T5/360laXMWvZhjGhf hKFFP7uPSHHNb8bEeC72vLFwRtdPFaI5LCovm6QRuey9GV3ckRZyJaVMbRYXI8FqTi hASOiVoaXojh36iNENPbHDW3w2gWiOsHakM5PpyebXj23c8lezPO6jqjZcsapqkHq/ 43siRmVAPUQSo0WhMadtquyzDhcV9Rm9awS8PxY4tMoO8ago7ObTr2U8c6AyhmJ/79 pwDBrdBe27qeA== Date: Tue, 05 Dec 2023 05:26:06 +0000 To: Jonathan Wakely From: waffl3x Cc: Bruno Haible , gcc@gcc.gnu.org Subject: Re: contributor guidelines Message-ID: In-Reply-To: References: <427492706.66Ch7QCkOD@nimes> Feedback-ID: 14591686:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Monday, December 4th, 2023 at 5:37 AM, Jonathan Wakely via Gcc wrote: >=20 >=20 > On Mon, 4 Dec 2023 at 12:19, Bruno Haible wrote: >=20 > > Hi, > >=20 > > I was asked to post a patch for a bugzilla PR to gcc-patches@. Two ques= tions > > regarding https://gcc.gnu.org/contribute.html#testing : > >=20 > > 1) This web page says: > > "For a normal native configuration, running > >=20 > > make bootstrap > > make -k check > >=20 > > from the top level of the GCC tree (not the gcc subdirectory) will > > accomplish this." > >=20 > > But what I get, from a git checkout of the GCC tree: > >=20 > > $ make bootstrap > > make: *** No rule to make target 'bootstrap'. Stop. > >=20 > > I think the instructions should be amended to read: > >=20 > > ./configure [options] > > make bootstrap > > make -k check > >=20 > > Right? >=20 >=20 > No, don't configure in the source directory: > https://gcc.gnu.org/wiki/FAQ#configure >=20 > But otherwise yes, the fact you need to configure before running make > is so obvious that apparently we took it for granted :-) >=20 > And it hasn't been necessary to run 'make bootstrap' for years, just > running 'make' does exactly the same thing now. It falls under the weird paradox region imo, the one where it's such common knowledge that it doesn't get written down anywhere, so it makes it really hard for a newbie to figure out. As long as you have a mentor or are brave enough to ask questions it's rarely an issue but I love this little paradox. So easy that it's arcane to the uninitiated. I've been writing `make bootstrap` myself, I'm surprised to hear it's unnecessary. Perhaps we should update some of these documents a bit?=20 > > 2) That's what I did: > >=20 > > $ ./configure --build=3Dx86_64-pc-linux-gnu --host=3Dx86_64-pc-linux-gn= u --target=3Dx86_64-pc-linux-gnu --prefix=3D/arch/x86_64-linux-gnu/gnu-inst= -gcc/testing --enable-shared --enable-nls --enable-threads=3Dposix --enable= -__cxa_atexit --disable-multilib --with-as=3D/arch/x86_64-linux-gnu/gnu-ins= t-binutils/2.38/bin/as --with-ld=3D/arch/x86_64-linux-gnu/gnu-inst-binutils= /2.38/bin/ld --with-gmp=3D/arch/x86_64-linux-gnu/gnu-inst-gcc/testing --wit= h-mpfr=3D/arch/x86_64-linux-gnu/gnu-inst-gcc/testing --with-mpc=3D/arch/x86= _64-linux-gnu/gnu-inst-gcc/testing --with-isl=3D/arch/x86_64-linux-gnu/gnu-= inst-gcc/testing --enable-languages=3Dc,c++,objc,obj-c++,lto,jit,fortran,go= ,d,m2 --enable-host-shared 2>&1 | tee log0 >=20 >=20 > This seems unnecessarily overcomplicated. Most of those options are > just restating the defaults. >=20 > > $ make bootstrap 2>&1 | tee log1 > >=20 > > and it fails like this: > >=20 > > *snip* >=20 >=20 > I don't see this error when building master on x86_64-pc-linux-gnu. > This might be a local problem, caused by your host compiler, or the > versions of GMP, MPFR, or MPC, or something else. >=20 I would suggest just trying again with a out of tree build, in tree builds are not supported. I can definitely imagine an in tree build causing some wild errors like you described. So for example, if you had your git repo in a folder named workspace, like so. workspace/gcc You want another folder where you build in, this is frequently referred to as the object directory. workspace/obj When in the object directory, workspace/obj you configure in there. [obj]$ ../gcc/configure THEN you do the rest. (NOTE: -j16 sets the amount of threads to use in case you don't know) [obj]$ make -j16 bootstrap As jwakely said, bootstrap isn't required anymore, but this is how I've done it and I don't wanna change it for my example, just in case. After it's done, while still in the obj directory you do [obj]$ make -j16 -k check You'll notice that there's a surprising amount of test failures, the only real way I know of to check for regressions is to have a pristine version without your patch applied that you compare against. My layout looks something like this right now. workspace/bootstrap/obj/pristine-gcc14 workspace/bootstrap/obj/my-patch-gcc14 workspace/bootstrap/src/pristine-gcc14 workspace/bootstrap/src/my-patch-gcc14 Once you've ran the testsuite on both your pristine bootstrapped build and your patched bootstrapped build, you can compare them like so. [workspace]$ gcc/contrib/compare_tests /bootstrap/obj/pristine-gcc14/ /bootstrap/obj/my-patch-gcc14/ > results This is just how I do it, there might be a better way, I'm still pretty green so don't take it as gospel, but on the off chance it's helpful I wanted to share my process that has worked for me. Besides, this is a great excuse for me to get criticism of my workflow. :^) Oh and one other thing to note, when using this workflow, you'll get some bizarre results where some tests will be listed as both new and having disappeared. This is because some of the tests either incorrectly include the full patch, or include the line number. Here's examples of each of these from my latest comparison. ``` New tests that FAIL (4 tests): g++.dg/modules/xtreme-header-4_b.C -std=3Dc++2b (internal compiler error: tree check: expected class 'type', have 'declaration' (template_decl) in get_originating_module_decl, at cp/module.cc:18661) libitm.c++/dropref.C -B /home/waffl3x/projects/gcc-dev/bootstrap/obj/xobj-next-2/ x86_64-pc-linux-gnu/./libitm/../libstdc++-v3/src/.libs execution test Old tests that failed, that have disappeared (4 tests): (Eeek!) g++.dg/modules/xtreme-header-4_b.C -std=3Dc++2b (internal compiler error: tree check: expected class 'type', have 'declaration' (template_decl) in get_originating_module_decl, at cp/module.cc:18659) libitm.c++/dropref.C -B /home/waffl3x/projects/gcc-dev/bootstrap/obj/pristine-gcc14-2/ x86_64-pc-linux-gnu/./libitm/../libstdc++-v3/src/.libs execution test ``` Note the line number in the xtreme-header-4_b.C test, this is due to me adding 2 whole lines in modules.cc. In the libitm test you'll notice it includes the full path in the test log, that's what causes that one. ``` New tests that PASS (18 tests): libitm.c++/dropref.C -B /home/waffl3x/projects/gcc-dev/bootstrap/obj/ xobj-next-2/x86_64-pc-linux-gnu/./libitm/../libstdc++-v3/src/.libs (test for excess errors) Old tests that passed, that have disappeared (18 tests): (Eeek!) libitm.c++/dropref.C -B /home/waffl3x/projects/gcc-dev/bootstrap/obj/ pristine-gcc14-2/x86_64-pc-linux-gnu/./libitm/../libstdc++-v3/src/.libs (test for excess errors) ``` As you can see, this also happens for tests that pass too. So if you encounter something like this, it's nothing to be concerned about. This cost me some time when I encountered it so hopefully you can avoid it with this warning. Additionally, here is a list of options to reduce build times for when you need to build frequently. It was passed down to me and now I'll pass it down to you. However, do take note that you STILL NEED TO DO A FULL BOOTSTRAP before submitting your patch, this is just to expedite the initial "make change, test, repeat" phase. --disable-analyzer --disable-bootstrap --disable-cet --disable-default-pie --disable-default-ssp --disable-fixincludes --disable-gcov --disable-libada --disable-libatomic --disable-libgomp --disable-libitm --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libstdcxx-pch --disable-libvtv --disable-lto --disable-multilib --disable-nls --disable-objc-gc --disable-systemtap --disable-werror --enable-languages=3Dc,c++ --prefix=3D *REPLACE WITH YOUR INSTALL DIRECTORY* --with-checking=3Dyes,extra,rtl --without-isl --without-zstd --with-system-zlib In case it wasn't obvious, these are the settings I use for development of the C++ front end. If you're doing work on a different part of GCC you'll need different flags, I can't tell you exactly which ones you need unfortunately but hopefully this is useful information for you. I'm sorry if any of this came off as condescending, you seem like you're more proficient with a terminal than I but I didn't want to make any assumptions on what could be left out and what couldn't be. Hopefully this answers all your questions! If it doesn't I doubt I'll be able to answer them as this is about the limit of my experience so far, but I'll be happy to try if you do have more. Alex