From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 2E7BF3858C31 for ; Wed, 27 Mar 2024 18:23:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E7BF3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2E7BF3858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711563790; cv=none; b=XlozW07OkBl6FU4gAtVU0M2Nkyo4Yf+Ki0vBIyhGEfyX8KMIyYvLP8NWjAwOmMPm04WuqiySea2fO2lr7lr3KqLDzwUWJJc498Rt4FQT5rzwpn07nMZZASO/Gd7c6ioaD/YaN1hSHVykMpobwNAos7vvp443kk2LCEq9hdz5oP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711563790; c=relaxed/simple; bh=/2je2jgqoggenpkIJvidhEiCAfkFjkR099ZHsqyL3KA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ZHHkTBDsYnN/OA5RBoInoX3JBpQcg6svjLNiDI9OqsSSv3jpGr0gRjvfHanIf6hkw1xZmVan2ICbHW5f24aOyNBoV0331cAKRlztY6GomXQMMXroabWNQFjnd6EwW+S4/PR7FyDU/cw9KjeARx2dRrGOhm4ddDkT6viMDbOn1Lg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a4dfe6564b6so15073766b.3 for ; Wed, 27 Mar 2024 11:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711563787; x=1712168587; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8imOb8kBbkV5v8I/WBRCTQFaVropbB2W4KSh8FOlZjo=; b=Xh9vQLSdERYumOQFBfbLhGzSSsWRrgQPgbF43ndIg9yc9Z3r87CdxH4/8z9oX4dzQs Qi0hVPdkFByBfcXnnfFkDebwJ/slUYwg05wfK7K0F/zqsAL76PoTWA1SBLI70Oidnkur gEYnDzasBjN7s50YmIDJk3wu9b3A7N+P2aNZWpJjo5VSPhC/6BcmyzHad1fXAX16clO4 k+QkHZFAQ6eZg5OB0zkJpp4sl2zRdkqSD2VjlHxsEc0TRrRW2kD2q1NXpfljn4SJLCY1 v8CEmBxWMrCGSstzYfKlRDvZ+cMy7zDImO5CQ29m+KISapl0A5DmrpFOuglU9wrj1pFq yCIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711563787; x=1712168587; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8imOb8kBbkV5v8I/WBRCTQFaVropbB2W4KSh8FOlZjo=; b=rTz4Jq+ValNRbZs94PPtpL0fW7eFOjJu0VI9otah9i/8rr2yvDV5Ixwl9p8zL287Jb 0VFBeEe72GG7EXdTg8Igd3DEZiDij0BFmVlKYIVFRPCVw3r5n0bcwUNqfsQ+CN/gmUO2 XHrHkjmPj3m8+acy7i6YxhcrEDv/1X1k8bSjzSx0WZLxhQkI98OcZFDQX5naiokHmGpu aORG9vqvs989AvARBevsSEdlecfxSYxQXYYbLIbDZFqHWII7IlBvv327/dHLs5aXnsah AOLU2GbqS2UP9vEwW8hyvhb+i/jmYzOvSLikF43vCqda49YHeh/aMzF1JARkpYEq0E1R bqqw== X-Forwarded-Encrypted: i=1; AJvYcCVVvcccVZlHo4+arMwq0rqSmxk1ItDasPJF6xFYM2N54r2ADVzfVgiQSLD7qCWDr4GYYcj5mgFSK7DqGXVrD8M= X-Gm-Message-State: AOJu0Yw34AWHosKY1qC/McE2nRoLdK7Fewb9FL6xjDaYnLAJt4zrWmQQ rd13w+MtYwNRFJu2K+t2GIBg4KGe1ax6g1Ota2t+1MXZy0pyMjgALM1hcqEPKd7dtDgdLsILAT9 vlOAmsPtt+umsFL56HbsAtg2x+fvpih+qa18IdZtOAuNEO1gynmejCA== X-Google-Smtp-Source: AGHT+IGhpHaZd4tza3YZsx9CNboBpG0Sy0xEXuWT0fJwReRsWLO0CEyhbgPCnsk+BhhSR51K6yTpWdket467HZPK3Z0= X-Received: by 2002:a17:906:80c7:b0:a47:4162:766e with SMTP id a7-20020a17090680c700b00a474162766emr237141ejx.22.1711563786739; Wed, 27 Mar 2024 11:23:06 -0700 (PDT) MIME-Version: 1.0 References: <20240313080237.1143034-1-christophe.lyon@linaro.org> <1eb529f2-3842-4090-a8e2-f713a28f2394@simark.ca> <33f72ef7-f990-437d-8fc4-dba08d7db24b@simark.ca> In-Reply-To: From: Christophe Lyon Date: Wed, 27 Mar 2024 19:22:57 +0100 Message-ID: Subject: Re: [RFC] add regenerate Makefile target To: Simon Marchi Cc: binutils@sourceware.org, gdb@sourceware.org, gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: Hi! On Mon, 25 Mar 2024 at 15:19, Christophe Lyon wrote: > > On Thu, 21 Mar 2024 at 15:32, Christophe Lyon > wrote: > > > > On Wed, 20 Mar 2024 at 16:34, Simon Marchi wrote: > > > > > > On 3/18/24 13:25, Christophe Lyon wrote: > > > > Well the rule to regenerate Makefile.in (eg in in opcodes/) is a bit > > > > more complex > > > > than just calling automake. IIUC it calls automake --foreign it any of > > > > *.m4 file from $(am__configure_deps) that is newer than Makefile.in > > > > (with an early exit in the loop), does nothing if Makefile.am or > > > > doc/local.mk are newer than Makefile.in, and then calls 'automake > > > > --foreign Makefile' > > > > > > The rules looks complex because they've been generated by automake, this > > > Makefile.in is not written by hand. And I guess automake has put > > > `--foreign` there because foreign is used in Makefile.am: > > Yes, I know :-) > > > > > > > > AUTOMAKE_OPTIONS = foreign no-dist > > > > > > But a simple call so `automake -f` (or `autoreconf -f`) just works, as > > > automake picks up the foreign option from AUTOMAKE_OPTIONS, so a human > > > or an external script who wants to regenerate things would probably just > > > use that. > > > > Indeed. I guess my concern is: if some change happens to > > Makefile.am/Makefile.in which would imply that 'autoreconf -f' would > > not work, how do we make sure autoregen.py (or whatever script) is > > updated accordingly? Or maybe whatever change is made to > > Makefile.am/Makefile.in, 'autoreconf -f' is supposed to handle it > > without additional flag? > > > I think I've just noticed a variant of this: if you look at > opcodes/Makefile.in, you can see that aclocal.m4 depends on > configure.ac (among others). So if configure.ac is updated, a > maintainer-mode rule in Makefile.in will call aclocal and regenerate > aclocal.m4. > > However, autoregen.py calls aclocal only if configure.ac contains > AC_CONFIG_MACRO_DIRS, which is not the case here. > > That's probably a bug in opcode/configure.ac, but still the current > Makefile.in machinery would update aclocal.m4 as needed when > autoregen.py will not. > > I haven't audited all configure.ac but there are probably other > occurrences of this. > As another follow-up on this topic, while working on a tentative GCC patch to implement this, I realized an obvious issue: all target libraries configure steps depend on 'all-gcc' (of course, we need a compiler to build the libs...) So they idea of doing roughly: - configure --enable-maintainer-mode - make regenerate -j1 (to avoid current race conditions in maintainer-mode) - make all -jXXX means that the regenerate step will trigger the configure step for all host and target subdirs as needed, and configuring target-libs requires building 'all-gcc', which would happen at -j1 ! sigh :-) Looks like we should handle binutils, gdb, and gcc differently for the sake of precommit CI. Thanks, Christophe > Christophe > > > > > > > > The bot I want to put in place would regenerate things as they are > > > > supposed to be, then build and run the testsuite to make sure that > > > > what is supposed to be committed would work (if the committer > > > > regenerates everything correctly) > > > > > > For your job, would it be fine to just force-regenerate everything and > > > ignore timestamps (just like the buildbot's autoregen job wants to do)? > > > It would waste a few cycles, but it would be much simpler. > > > > > Yes, that would achieve the purpose: be able to handle as many patches > > as possible in precommit-CI. > > And as described earlier, for binutils this currently means: > > autoregen > > confgure --enable-maintainer-mode > > make all (with a low -j value otherwise we have random build failures) > > and my proposal to workaround the problem with -j is to do > > make all-bfd all-libiberty regenerate -j1 > > make all -j XXX > > > > Another possibility would be a policy change in how patches are > > submitted, to require that they contain all the autogenerated files. > > > > > > > Simon