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 90835258F; Tue, 09 Sep 2025 14:56:22 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 9C839255B; Tue, 09 Sep 2025 14:56:20 +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 375652559 for ; Tue, 09 Sep 2025 14:56:19 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 247D67A0169; Tue, 9 Sep 2025 10:56:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Tue, 09 Sep 2025 10:56:18 -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=1757429777; x=1757516177; bh=eca8j9RKJc A0Q9HWLSEfk3QGrsBqfFdvwlf2kzsYi0g=; b=bFRb1pzV4oVkhL4Oyz/U2CWz+4 KG9HooADp79Rs5xq5DR+clWUKSMN00Kv8FBcGcB6zPTt0+Ot5WoSBZDs2N+J27K7 kqcYP0nMFJXjhHqmEmgUQ0WLkJyTbbbB9eFxtggpFDUbLt+EDu4rT48fKHJlXswO tgpJaqHkeQ8vf3Zpm3bL229NXtXH5I8d1+7prVJy7EpUQPS3kEAEX40lsndS7PNB 6+P6r/NDZa+wBQiythmi3qNpdKPWt5HbZFq8QLns2egkP7pPdm704/RtWNbiST14 pYAnLUTca7EAk/pNiKVdFXHTfsKPyI5R35Xosv8EUUWnwaxW+N1GhOpFxwOw== 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= 1757429777; x=1757516177; bh=eca8j9RKJcA0Q9HWLSEfk3QGrsBqfFdvwlf 2kzsYi0g=; b=ZZKzNgWa0DnPdXPkkUmN9bqi1+6JG09Q6dji14glxfrJGyKUNHr xV8/w8q1fMxgbSpPN9VHlq8km2+xYc7J2KGDtU3ksTaTT5Wi7UAr1DeWYKZsbcaq wQsDMBTSwkCAYm6CykGpDPjZovDydShxgeXHBR1+kQoOFGMFLos7rHy+LCyueNkF lf5z9GWBdU2mNvWSHaV2CZ4mD9jSQY0v8XSsp+7cAHvUihQrXeuM6TTeGhYAIJnl uwwONsOc/z88YvyjPCOpiI0bHQ/7dRMqH+5xYLAltx06v3nJ5WmIBaXNcbTaa8xS V8ZVGibXVWL+tWug/x+0AWpCoSktLvCpAdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdejudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Sep 2025 10:56:17 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 9803316C4874; Tue, 09 Sep 2025 16:56:06 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 3/4] Common make rules for building erofs images In-Reply-To: References: <20250903-genfiles-v1-0-cc993fcb1e4c@gmail.com> <20250903-genfiles-v1-3-cc993fcb1e4c@gmail.com> <87wm69i7p9.fsf@alyssa.is> Date: Tue, 09 Sep 2025 16:56:05 +0200 Message-ID: <87ms738yka.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: MEALINQFWWS4LYO5RHLKEDJM2KFCIBN6 X-Message-ID-Hash: MEALINQFWWS4LYO5RHLKEDJM2KFCIBN6 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 Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 9/8/25 06:01, Alyssa Ross wrote: >> Demi Marie Obenour writes: >>=20 >>> Instead of duplicating the logic in three different places, write common >>> code for all three makefiles to use instead. This will make future >>> changes much easier. >>> >>> Signed-off-by: Demi Marie Obenour >>=20 >> Makes sense, and we could do this now for the s6-rc directory without >> having to wait for the generated file list stuff. Does need to be >> updated for my review comments from the previous patch though (stick to >> POSIX). > > If we are going to stick with POSIX, I think it is best to test with both > GNU make and BSD make. Otherwise, GNUisms are bound to creep in. I wish there was something like shellcheck for Makefiles, but I'm not aware of one. If you can find a good way to ensure it (ideally without building everything twice), I'm all for it. >>> diff --git a/lib/erofs.mk b/lib/erofs.mk >>> new file mode 100644 >>> index 0000000000000000000000000000000000000000..b3fc112f5e793725977cd8c= 4b2e71d6ed8d888c4 >>> --- /dev/null >>> +++ b/lib/erofs.mk >>> @@ -0,0 +1,51 @@ >>> +override basedir ::=3D $(dir $(lastword $(MAKEFILE_LIST)))/.. > > This is one part that is not possible in POSIX make. Without > this, there is no way for the included makefile to know where > its wrapper scripts are. Maybe we can just have each Makefile define a "root" variable that points to the root of the source tree? Not very onerous if it works. >>> +override BUILD_FILES ::=3D $(BUILD_FILES) build/etc/s6-rc >>> +# No override here so that it can be overridden in host/rootfs/default= .nix. >>> +dest ::=3D build/rootfs.erofs >>> + >>> +all: >>> +.PHONY: all >>> +$(dest): $(basedir)/scripts/make-erofs.sh $(PACKAGES_FILE) $(addprefix= image/,$(FILES)) $(BUILD_FILES) build/empty build/fifo file-list.mk >>> + set -euo pipefail; ( \ >>> + cat $(PACKAGES_FILE) ;\ >>> + for file in $(FILES) $(LINKS); do printf 'image/%s\n%s\n' "$$file= " "$$file"; done ;\ >>> + for file in $(BUILD_FILES); do printf '%s\n%s\n' "$$file" "$${fil= e#build/}"; done ;\ >>> + $(and $(DIRS),printf 'build/empty\n%s\n' $(DIRS);)\ >>> + $(and $(FIFOS),printf 'build/fifo\n%s\n' $(FIFOS);)\ > > This also has no analog in POSIX make, though it might be possible > to emulate it with some shell hacks. Can be a for loop like above I think? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaMBABQAKCRBbRZGEIw/w okPKAQDZLtzMaFAuW/Dphc/aD2MzjXFRmziAh9h81b6Ymfz+8gD/d8mk3UDM0fVa b6oanByu/hVWOGxd4PjWkBGYh/lIrAI= =MNMQ -----END PGP SIGNATURE----- --=-=-=--