From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796323720; b=gj28h1i7Tb+tqENJDY550y1qjiB/DKhDZwS1inpS8VfMS1dUTuj1IUBoyw0oDxUP3sqk GdvkxWEztFrk4w4unutmrFEC3Gi/WCVHM0w/JvGBxSloqMLSlGM7G6JbKfo4S1h4T4QUy wvhmQhx3qL3igJRv9/Eea1lp+TPGnOemTuskCdi0b7b4EUaxwJ9jXpi7UKmZzdIyIvNXh hKcKNr7DQIqgvk57aOil8mhsz9cDJ8MXdiLcACzuhvE8QTbmUNOwpY/X1oltIu7xSShKu QyjaoTLzubA+HCqiYVeEr1mtg85lHrgzh4sfhn4vDBfU8nkHYn/h5q1OiV7QX2Xt1+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796323720; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=0eIP0aKV8dbqXHYi0BBOhikYNa83NEiEv4L5LtTl2qc=; b=iBFXkwb0V4MKo4jiN8c1xupBWLxXQh2hCpPglJlvlHkaRoMsRxPtZYOsGDly4b0xAULl m4s54vv32rwRy0VnB21XWoyL9jlpMNHfN3/iTGWakkrc+5SFNIg3hlqW1k0qX45BEnwHp GYI20CxOMZlM15pgTaIPGjJEQTl054hmbEo4VJa9gBMQ5GySXv9NH6uiV1RfFkedTDpYo ViXyvHuZ6Ks/EboEp6OUoIhP6f1hWz+xv56IxoqkfhdvHEMsFHxD5WOa4Q6gVBPX7KGFa 9av+JUaokrQhb/S5ZzvIwznmHoTT4iaQ21iq7xaI8nb0NSEuO3zL6uL4iiNW7Si/WhQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bzJQS2qG; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93259606A322; Thu, 3 Dec 2026 18:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bzJQS2qG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B2891F00923; Thu, 3 Dec 2026 18:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796323720; bh=0eIP0aKV8dbqXHYi0BBOhikYNa83NEiEv4L5LtTl2qc=; h=From:To:Cc:Subject:Date; b=bzJQS2qGKoQkjRS9i87icDq2jHRhtEyYVwrZJQv9EkTen/1viQK0Na0LwOrTsmNs6 XSDWPCYgpshI1y1/FPGNO1bKC+91trxZD4yKlzU9MO4KGEt5op+xSZJeps35LYv10q Ss36yMVM7u1JjComhR/R1VtHQscJpFlOLQuZdpNpM8+WTHDRkwn7OeS9mMHYQ+kDvA JTxWmXJdS0qibqJBdDLQNVGb9w9i56vgJIDP4zgDvo7aXdDIk7oTvc4WlU0bTRBZFY ogJT6U8QXyf4V8gEdJb3hO7/OuQ8DwHj6kH1D8bs8y2Of4u8/zg+0W4RvvsJxWp0A1 FoB2V5tyIM4lg== From: Sasha Levin To: Nathan Chancellor , Nicolas Schier Cc: Shuah Khan , Dan Rue , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: sort the config fragments in kselftest-merge Date: Thu, 3 Dec 2026 13:48:37 -0500 Message-ID: <20261203184837.390792-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit kselftest-merge passes the selftest config fragments to merge_config.sh in the order find(1) returns them, which is the directory order of the filesystem. Where two fragments select different members of a choice, the result depends on which of them is merged last, so the same tree can give different configurations on different machines. Two choices are affected today: - bpf/config.aarch64 and bpf/config.s390x select HZ_100, while net/packetdrill/config selects HZ_1000; - bpf/config, exec/config and ftrace/config select DEBUG_INFO_DWARF4, while vsock/config selects DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT. KernelCI builds its selftest kernels with this target. Its arm64 builds of v7.4-rc5-100-g0810bd27d7bb and v7.4-rc5-103-gd06ce6f1eb5e merged the fragments in different orders, and the two configurations differ only in the timer frequency: HZ is 100 in the first and 1000 in the second. Sort the list. The Makefile sets LC_COLLATE=C, so the order is the same everywhere. The shell glob that find replaced was sorted as well. Fixes: 6d3db46c8e33 ("kbuild: teach kselftest-merge to find nested config files") Signed-off-by: Sasha Levin --- Based on mainline (d06ce6f1eb5e). It also applies to next-20261202. Tested with arm64 and x86_64 defconfig and LLVM=1. Merging the fragments by hand in sorted and in reverse order gives configs that differ in the HZ and DWARF choices on arm64, and in the DWARF choice on x86_64. With this patch kselftest-merge gives the sorted one, also with LC_ALL=en_US.UTF-8 in the environment. The conflicting fragments are not changed. With the sorted order both architectures get HZ_1000 and DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT. The two KernelCI builds, with the .config next to each log: https://files.kernelci.org/kbuild-gcc-14-arm64-6b1087cd37f1074a9a2871b8/build.log.gz https://files.kernelci.org/kbuild-gcc-14-arm64-6b10cf3037f1074a9a2b95c6/build.log.gz Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3bd24ea8ff893..2327a97a061c0 100644 --- a/Makefile +++ b/Makefile @@ -1657,6 +1657,7 @@ PHONY += kselftest-merge kselftest-merge: $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!)) $(Q)find $(srctree)/tools/testing/selftests -name config -o -name config.$(UTS_MACHINE) | \ + sort | \ xargs $(srctree)/scripts/kconfig/merge_config.sh -y -m $(objtree)/.config $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106 -- 2.53.0