From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EW11fwVz; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id B7D455A004E for ; Mon, 23 Feb 2026 17:32:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771864326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1VCD67HvkM0XULOVJ1NxsxYqwqDwXRxU5dwLh74fmas=; b=EW11fwVzgl3cPa32b+9/A8qXA+ilmDX685N8lzj0sOG7H0Waesc6hd74u/0JYtBfOfk27o cEHuj3zoAa7HN9WIMb5qXu1HvnACvHvk+V93N5r3p7Lp4pkymP7pA4d2vmizWvMg9zBcfQ EYh6u0fG99KztQo8/Vb6OaliJm5+zRk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-QKH7cIbHO1CXc3RxWZYdyg-1; Mon, 23 Feb 2026 11:32:05 -0500 X-MC-Unique: QKH7cIbHO1CXc3RxWZYdyg-1 X-Mimecast-MFC-AGG-ID: QKH7cIbHO1CXc3RxWZYdyg_1771864324 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4836fbfa35cso31672215e9.1 for ; Mon, 23 Feb 2026 08:32:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771864324; x=1772469124; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1VCD67HvkM0XULOVJ1NxsxYqwqDwXRxU5dwLh74fmas=; b=jr5GryszQmouJcdpBaLXvYw9AyXqzjB4J7NvSatPtM92Zz7irJzwEMRxKheUWbvDNr cJJtPLpdBCsEy1cSI+OlTPMjDifCeQ7DCzqkGB8YpgIPODGjuuPr8BMr0gBMlQpoC8QQ X6p43snCNk9i6TIbAGaDu2ZPZ5mTmj1oRVD++ctLCAoJWiIvXI69XGFeVegA/jjp5Ppf 8lg5zaaOIsnM0bwnMSnSoldUlDjr3+UJch0yDPcbTYPjb6kUohgltqqJst96u7JwPdGU AH/etE9r04s8hoogOl9pnuXdfTeHaw43kArXx8kCqaxYkVo90qJKbBmH4qOjaqtXZJip 1vDw== X-Forwarded-Encrypted: i=1; AJvYcCWdvR2cxosG01vwDmYL/06bJVaVB/XL+tuQeAfpLYqaSgzdAvWv9rp9VFZ2WubGEjV6ht7laB+RxEo=@passt.top X-Gm-Message-State: AOJu0YwRGVuFHKmYV/+wvBQVUVcIFNzXumtpYo46kebTqXaNNhOz4GIa x1nRh+mDgpe6lVjj2irmYjN3T4aGAatXSWONq8QURnxeEAPIbhF3gAMoS5x9swdPbWu8oqOpaX4 lLKDz1EHtXzc+63NrXDyqxijygO+0w3ckltUqTwciB5PeETDPbylltw== X-Gm-Gg: AZuq6aL5ky/A/y657g2jrcXT/gcBzthOkZllY1VzwcupdRewQ/Wtw/0ksBycacmo/9o kIK/tlwnzNMVQkhKgnpVeEtHHA8dw+4dQ7omFVBrFayrWssbOD56FnXf5ngKSDXA2bbJ1fa5ysN H8sG3/XtJe6aN1TvQRsT9gGRKXARtIT7Bk1j41xMA7csMM1oH0xvikwgYkmmzZbFoUxhXJafY8P ybDkZUkvYYs+7r4E/9eFHWkapXYLIkiyXPWpZKzEoUfWhTWjDErX3/4xpx4IZSKUpalnWuJMOys 2vOad+yD78/b9jVgIrtulhcoKpJn9bxnXv66Mx2LpWBkxWPGOSlrKg2rZr81pKcTQXJ9ZaiA7sJ +w1SmqFLUyYCEXTp7H8jgX+kRI3XP63aDM+FRfWartkxY+mzf5g== X-Received: by 2002:a05:600c:638d:b0:480:1e40:3d2 with SMTP id 5b1f17b1804b1-483a95f5a62mr141195955e9.29.1771864323794; Mon, 23 Feb 2026 08:32:03 -0800 (PST) X-Received: by 2002:a05:600c:638d:b0:480:1e40:3d2 with SMTP id 5b1f17b1804b1-483a95f5a62mr141195385e9.29.1771864323225; Mon, 23 Feb 2026 08:32:03 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a4303447sm88234045e9.27.2026.02.23.08.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 08:32:02 -0800 (PST) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] Add missing includes to headers Message-ID: <20260223173200.32bdaf93@elisabeth> In-Reply-To: References: <20260219184454.1501389-1-pefoley@google.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Mon, 23 Feb 2026 17:32:01 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Fnh6bezg4aLyhfILv5HEJnyE0nNV9IzCt9R5t8r8_Ro_1771864324 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: JPWRQUHB2AOJJAIUX4RYBM5AGKQCUBQQ X-Message-ID-Hash: JPWRQUHB2AOJJAIUX4RYBM5AGKQCUBQQ X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Peter Foley , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 23 Feb 2026 16:33:32 +1100 David Gibson wrote: > On Thu, Feb 19, 2026 at 01:44:54PM -0500, Peter Foley wrote: > > Support build systems like bazel that check that headers are > > self-contained. > > > > Signed-off-by: Peter Foley > > There are kind of two schools of thoughts on headers. One is that > every header should #include anything it relies on. The other is that > headers should #include nothing, and .c files should includde > everything they need in the right order. The advantages of the second > approach are that it makes it easier to keep #includes in .c files > minimal, and makes circular dependencies more obvious and easier to > dientanble. > > We've kinda sorta been using approach two in passt, but not entirely, > and honestly, it's not really working. I would argue it *is* pretty much working, because it builds without warnings against glibc and musl, with several versions of gcc and Clang, on a large number of distributions and architectures, which is what it needs to do. There are currently two warnings with (unreleased) gcc 16-ish and glibc, I still have to post patches for them, but they have nothing to do with includes. That being said, sure, it's not either approach and admittedly kind of arbitrary and rather messy. > So I'm happy to convert to the > former approach. However, if we're adding #includes in the headers so > they're self contained, then we should be able to also *remove* a > bunch of #includes from .c files (and other .h files) which were > previously only there to satisfy the indirect dependencies. Just for clarity, while I agree, this patch does *not* magically make that Peter's job. :) I'd say that making it build with Bazel is more useful at this stage so I would happily accept this patch by itself (I just need to find a moment to try out builds on musl and on a couple of distributions, first). The cleanup you propose can also be done independently at a later point, also because I'm fairly sure there are a bunch of left-over includes (also/mostly from myself) even before this change. Note that this kind of cleanup would also take a bit of testing that we currently can't automate, for example building against musl on Alpine or Void Linux. -- Stefano