From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 7D4783858415 for ; Mon, 25 Mar 2024 14:19:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D4783858415 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 7D4783858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711376375; cv=none; b=JDhnRSEaUQtvgCWqX/dUy8HZS6UzItFcK6sq/WiDexHpHyLBCMouuEt9yLzMxChRL1YVaKhvONUEPT9aJ7o4JsgaHh6T3nt44UMQb9oFWSc3tQf0csFU2to4gCvxuXjB4FP/+HNjaXoyWgcaI9vJn3DPqQb1iRxA6IFJNiW2Rvc= 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=GHssdwoFpM5Qzh0zDKkwstGJLGn/zwRXXtbqJUL0vgmraka2s2kZje5NlvceUoiE5hDgo2QyISIyw0lEDSPOl2pNFGITKNp6kK7bCkbuh5/kkXbuqtDhMK//hFxlR6LJHfJeAirO0vJF4c0tBqbdR4umXMpHXKM7f9rxHwHF8uc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-56bb22ff7baso5168731a12.3 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=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=jMzHq1Aq+Wr57gzwC9pDIAtORT6UNAaXeiB7L5iy4TE=; b=D4TojndY2A6Z84DqCo7ZlT/B3fa9k/FTHGjVlXSlVv2YuQEhApm95EEidg7YIbvvwU dw3MBmXvLGrw2AJqh2fYKtu/ziIEeyebQeWMA8/V0quqkDngnBR+fRLT7Do0bhQWvELH BHyYyVQts4KmGew939/TiP2VRAs3gr47diTJmP9HQQNUiCImKQzyB7boCmawfRZpuUN9 SJhYfCG4v091FjYXFmD3KiF+g54BYzA+/w2zB2SSiWue+mOkFfkBMwUQxcyAIn/jL1jb /HhQOeYX4P+h+Ujom9UMBH72AVPi2Obzd8PfyQ+B9iYaYPu5BHoUTdxA+VCNtkFs9ZL1 vKEA== 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=I5r53ljkeXsRIO7Tfc4H6VaZvg3blguuqCTZfyqfq/ti+Yo4zqruVqy4qQCva0+Z4C 4wMPm2wH6rIS4an2O4KRtJyC4cBk+EEGHRObxRcPqr7WruC4/SymLkLFkPnuXwgb6+oh EV9/ek5dkfa97qsTVBLRQA9c7oT2xRK2iTz8dVPJo1O8LFmXWgofd+XOXffmRCgZN3HP i7mYkscwvMUMFu6TzVwzWLNLfMRslWsbkwDumOtmr8x4NxlScOOaK1Qrzbwev2Hh8r1e /s4KjZHve9p0zaa5eKXA6r7BiKuFpOZ3TcNRM3+szwfdrG2grUWnrUjNFqADxseUeqqo 3/yg== X-Forwarded-Encrypted: i=1; AJvYcCXYPk9nAPEBkLVLugpT1KJCax5xIeeAHiya5d38T1Q2f679wHd2VzA6yjb57Tq3N5BcMXw1J+pUg1DbRyhV2GQ= X-Gm-Message-State: AOJu0Yy0kTftlsS/HSZvuEl47FLIBvSVV/RTAv0ZF/egx9OD77Wlc09r OlTRdoklP8h+yuotwSzm2D1nETp0DeYhHbvsZXjF14U2o//EYcv4Jt+ZaRuc5w6i5ICwSFRa/X1 VEUbco+1muPy+ancsKiRGkkh7y62zfOV/DlyKWg== 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