From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 6D5B7385840E for ; Mon, 25 Mar 2024 14:19:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D5B7385840E 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 6D5B7385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711376375; cv=none; b=phLmdkZ0nFE3xSHfdc4m+1HBonhZajIEYTLuv+S1VhRophiknNIyVFNMH7a8rIJw1MHzokuNdC5/Fp+Sc4No+36Xg9nVo3yLYt8NLJK65/JrRB+EDu0SFi+usfkw97L3S10xMsEypdzIsOUQPI+PTYQJV8ARi5TH4+PvZZCbpeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711376375; c=relaxed/simple; bh=qf+p2Dv/e1l3WSO69evL77tkwxRiX/9gH3CCYOXHggI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=VpyILyjg/N51iNmS4liraOJIW32Q2Tq3e2Bt/39BJ0fMOdMJcer3r/tBo+IpoeS1FtdEKdy8CQ8YTOKQD4GKoa1ef7pCSw4ptm2kmnW/G9qWoSvCdT8orlafyQTg6h++oQkhlCP+EcYKcINty1FnSZG2+XjDB7vi3j7gDZ0t+nI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a468004667aso601800666b.2 for ; Mon, 25 Mar 2024 07:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711376370; x=1711981170; darn=sourceware.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=jMzHq1Aq+Wr57gzwC9pDIAtORT6UNAaXeiB7L5iy4TE=; b=EszKHHdns0ztLgjMWveBgOhyhnFzhgmBg1Tdf+AHv3F5L9VG1hhPY9HHP0YgCvxeGz 9SEkvB95jKyFW1mBdTNqe/4CQul4azm4rfoxxKBwcFetxeiaQLyJablr9HgY59rKmT31 MayXUYmKEWob0G38XG/W+WC9jFw4KOKaGrsvi/dBAkADDOCd8jYAZ1P7sn8amyhfKLTw ZdPFKEcYA+1etMXAYoszk17A5dHx3GrTWTpshsQlom6KQmGlzf4ZnD34tap/8atfkfi7 BHbppSewCGuujhTOWhXyZZXm/Zl84xG98oB7xbr/uPnpAo4ikBbaIbfQRvFOzY/SDUxV 6sng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711376370; x=1711981170; 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=jMzHq1Aq+Wr57gzwC9pDIAtORT6UNAaXeiB7L5iy4TE=; b=h3lc+vM/sYr+fyvMAErf7gCVkIXPmTy2uZRJqB5nTiG9aN+mWkhfafNzkoVPwDpbHV gTEhiIw+DHKvGjMalWKhsOa0JY7ocCNdlS64Lg5M9TwqAtVium0xk2P6nXiwniw3Xwb3 1xsm7a7WfV6Vpxf6Q93iUSoEf06CNZxiywC6RRITC7tRJFaCIsyJkVpiAe+siTwG3Aft l5T4vFuBtMhl+pN0FzHJxFFNHAjPLSbkKHloA3f2KOr9uLypNmGkbCteO/4C9Qq3KG2m PNzl2VCrM0vUAKWgxpe6hrMaK9TDGW7GQrCfsSS9OhHr/kIawPls5qkS4SjwGqBjxXO1 H2mg== X-Forwarded-Encrypted: i=1; AJvYcCUs+ziYzgqUig3T7IxDvt0Bd2USg41MptBONqpq3QPzcTaeZWX7E9UFzXW7nBColox+h3VTcNbxBGvgTqq8Odnwuo8= X-Gm-Message-State: AOJu0Yy5qBEO8XZxkgTZouEO9k8qFHicpfnppm5foaHOtJG4iOJKF1Ms 4lmGOajw0LzQpmuZa3H3XkH85IBImXgZgFgQpWM7yvyC/zHh/BfbANcfFPXY9NzeQ6dQnzfr7vS NGBDwaNHojK0KCosS20/Lr0XEIyT76gWTmht9OMhUMoMyRXHmssGBfg== X-Google-Smtp-Source: AGHT+IGH36RQnd7BFMvl1q68+nYN/kqRTZAsYXXstsNFGtSZw62KP5LO/AirBbQ7SW/9G6zZR2wm/aE+HKAzK8zhhNM= X-Received: by 2002:a17:906:af06:b0:a47:36e5:5514 with SMTP id lx6-20020a170906af0600b00a4736e55514mr5077887ejb.14.1711376370078; Mon, 25 Mar 2024 07:19:30 -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: Mon, 25 Mar 2024 15:19:21 +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.1 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: 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. 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