From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 97DE5247E; Tue, 09 Sep 2025 14:51:43 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 508652467; Tue, 09 Sep 2025 14:51:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) by atuin.qyliss.net (Postfix) with ESMTPS id 0100023E5 for ; Tue, 09 Sep 2025 14:51:39 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id EA5067A0093; Tue, 9 Sep 2025 10:51:38 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 09 Sep 2025 10:51:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1757429498; x=1757515898; bh=ic8FohS7da 6gTXG64gjaWrR9WYmzZg8yEwp0VHe4JzM=; b=JUm9aa3p2M9L2Ne18eCY7wsb/G OHCQDhR3J+BmGDuCEED4ujd3UCay2MZzyMF+SUP1VmQdO9j1JloeXU7SVvL2A7nd k2Da1sRGNfFENHDLmqMFffgJTdkoyF5EDBpvsZchjyZtq9hK302pp0PRfJaVA707 CBlKrCSo8hYb2/9K8CQFsiGANAkfR3doZKPi4toMEaU6DS2xZvQeFMwVsP3Tn4QI XpnZ7tyGdONGMo9AQNu2GnQT7fLCVhWhymW+7GAqTc0GwtFmIUkv6n6zfHtM3mJc xCqDYwf/opmdYzY/e8SuOI6zU/E7t1MV9nF4ljTEoEV0KmvkCaos7Cgkfvog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1757429498; x=1757515898; bh=ic8FohS7da6gTXG64gjaWrR9WYmzZg8yEwp 0VHe4JzM=; b=lVxA7DOlufH78zosiwDXm2PC4AWWnjGxoDKvA5oj3Nz2A0veTiI 7xjWYPlFfal05Ih6jqzkeM7HgQcm16ol0rkAi2/JIBNnVB+tArkL4bIuMpSk/8vr ZLvXyAF6/TW1WpxMg0jGAwsIY8lgBRykEGnLOJzx0RgtEofmbF1Ze0RLmAkNHSGf kGFHHSfHqRFZqp1DgDCvMe5kY/0PQDcL/zmdJD4ndXIzhcKnwCQwPGfNrZ/Rn3uh a+FZI3EQaR2JxUre2fbSt+Ou8XI3Ki6jeR3//NUK8nuwNpHNP5AAX3N3CH9Z9Kb4 uHusqPcPEOV+c5Yu+YFmKEjRubJOM1ZOGIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdejtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddtjeenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepteehvedugf ejgfehhfeijeduleekleejgedvkeeuuefhhfegvdevfeetveegteeinecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Sep 2025 10:51:38 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 362D416C45F7; Tue, 09 Sep 2025 16:51:27 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 2/4] Generate makefile file lists from a script In-Reply-To: <7f53e052-a686-4745-aecb-5f98e38f0142@gmail.com> References: <20250903-genfiles-v1-0-cc993fcb1e4c@gmail.com> <20250903-genfiles-v1-2-cc993fcb1e4c@gmail.com> <87zfb5i7s5.fsf@alyssa.is> <7f53e052-a686-4745-aecb-5f98e38f0142@gmail.com> Date: Tue, 09 Sep 2025 16:51:26 +0200 Message-ID: <87plbz8ys1.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: M5CCQVGMW4HTF2LTB6UXY6SPRF5Q4T5R X-Message-ID-Hash: M5CCQVGMW4HTF2LTB6UXY6SPRF5Q4T5R X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: >>> -$(dest): ../../scripts/make-erofs.sh $(PACKAGES_FILE) $(addprefix imag= e/,$(FILES)) $(BUILD_FILES) build/empty build/fifo >>> +$(dest): ../../scripts/make-erofs.sh $(PACKAGES_FILE) $(addprefix imag= e/,$(FILES)) $(BUILD_FILES) build/empty build/fifo file-list.mk >>=20 >> Given that we don't include Makefile as a dependency, it probably >> doesn't make sense to depend on other included Makefile fragments >> either? > > If the user regenerates the file lists, it is more convenient for > them to not need to call 'make clean', and having the dependency is > harmless. I just feel a bit weird about it. It would of course be nice if changing the make rules didn't require a make clean, but to actually get that behaviour we'd need to add a dependency on Makefile to every single rule (or this functionality would have to be built in to make, which would make more sense=E2=80=A6). I worry that having it so that /sometimes= / you don't have to run make clean after changing the make rules makes things more confusing, because then you have to understand when=E2=80=A6 Open to being told I'm putting theory ahead of practicality here, though. >>> diff --git a/scripts/genfiles.awk b/scripts/genfiles.awk >>> new file mode 100755 >>> index 0000000000000000000000000000000000000000..62863e78f157f1d9a0f6dbd= b0f4380db9c9d48cb >>> --- /dev/null >>> +++ b/scripts/genfiles.awk >>> @@ -0,0 +1,115 @@ >>> +#!/usr/bin/env -S LC_ALL=3DC LANGUAGE=3DC awk -E >>> +# SPDX-License-Identifier: EUPL-1.2+ >>> +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour >>> +function check_status(status) { >>> + if (status < 0) { >>> + printf "FATAL: getline: %s\n", status > "/dev/stderr"; >>> + exit 1; >>> + } >>> + return status; >>> +} >>> + >>> +function check_close(value, status) { >>> + status =3D check_status(close(value)); >>> + if (status !=3D 0) { >>> + printf "FATAL: command exited with status %d\n", status > "/dev/stde= rr"; >>> + exit status; >>> + } >>> +} >>> + >>> +function shell_quote(command) { >>> + gsub(/'/, "'\\\\&'", command); >>> + return ("'" command "'"); >>> +} >>> + >>> +function get(command, line, path, array_index, inode_type, mo= de, modes, symlink_count, symlinks, file_count, files, rc_count, rc_files, = is_license, is_rc) { >>> + file_count =3D 0; >>> + symlink_count =3D 0; >>> + rc_count =3D 0; >>> + modes["120000"] =3D "symlink"; >>> + modes["040644"] =3D "directory"; >>> + modes["040755"] =3D "directory"; >>> + modes["100644"] =3D "regular"; >>> + modes["100755"] =3D "regular"; >>> + print "# SPDX-License-Identifier: CC0-1.0"; >>> + print "# SPDX-FileCopyRightText: Not Copyrightable (machine-written)"; >>> + print "# Generated by scripts/genfile.awk, DO NOT EDIT!"; >>> + while (check_status(command | getline line)) { >>> + if (line !~ /^[0-7]{6}\t/) { >>> + # this is a git bug >>> + print "FATAL: git ls-files output didn't start with a valid mode" >= "/dev/stderr"; >>> + exit 1; >>> + } >>> + path =3D substr(line, 8); >>> + if (path !~ /^[ -~]+$/) { >>> + # also a git bug >>> + print "FATAL: git ls-files didn't quote properly" > "/dev/stderr"; >>> + exit 1; >>> + } >>> + if (path ~ /^\/|((^|\/)\.{0,2}($|\/))/) { >>> + # also a git bug >>> + printf "FATAL: git ls-files output non-canonical path '%s'\n", path= > "/dev/stderr"; >>> + exit 1; >>> + } >>> + if (path !~ /^[[:alnum:]_.+@/-]+$/) { >>> + printf "FATAL: filename '%s' has forbidden characters\n", path > "/= dev/stderr"; >>> + exit 1; >>> + } >>=20 >> I feel like this could be a lot nicer if we ran git ls-files outside >> awk, and could then use its nice top-level matching syntax? > > That would work, but would need a wrapper script. That's fine. Make a scripts/genfiles.sh that runs scripts/genfiles.awk. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaMA+7gAKCRBbRZGEIw/w oiILAP9zy9UfI7Og6T/4H9uzYTOxPQQQFG4kz8yfFJR/+6Z+sQEA0xpzVr23eIZW eKXzPHfaM6/7IitEYtjTcfcCaYWCmA4= =RcHN -----END PGP SIGNATURE----- --=-=-=--