From: Guillaume Tucker <gtucker@gtucker.io>
To: "Nathan Chancellor" <nathan@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Onur Özkan" <work@onurozkan.dev>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
linux-doc@vger.kernel.org, workflows@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
automated-testing@lists.yoctoproject.org
Subject: Re: [PATCH 1/2] scripts: add TOML config to container tool
Date: Fri, 28 Aug 2026 19:25:18 +0200 [thread overview]
Message-ID: <b45e7864-928c-4b3c-aa62-64f4f63d85c7@gtucker.io> (raw)
In-Reply-To: <apG3hwaPA8f7SJeI@levanger>
Hi Nicolas,
On 28/08/2026 6:29 pm, Nicolas Schier wrote:
> On Mon, Aug 24, 2026 at 12:05:47PM +0200, Guillaume Tucker wrote:
>> Add support for a TOML configuration file to the scripts/container
>> tool. This improves user experience by not having to keep passing the
>> same command line options all the time or overly relying on built-in
>> default values. Include the concept of 'profiles' with different
>> named sections in the file to cover various use cases.
>>
>> Command line options take precedence over the config file, and values
>> defined in profile sections take precedence over the default one.
>>
>> Add a -c option to override the location of the .container.toml config
>> file which should otherwise be located in the current working
>> directory. If not found, the file is silently ignored as it is not
>> strictly required unless the -c option is used.
>>
>> Add a -p option to choose a particular profile section in the config
>> file rather than the default.
>>
>> Signed-off-by: Guillaume Tucker <gtucker@gtucker.io>
>> ---
>> scripts/container | 81 ++++++++++++++++++++++++++++++++++++++++-------
>> 1 file changed, 70 insertions(+), 11 deletions(-)
>>
>> diff --git a/scripts/container b/scripts/container
>> index b05333d8530b..cf126fa13510 100755
>> --- a/scripts/container
>> +++ b/scripts/container
>> @@ -1,17 +1,19 @@
>> #!/usr/bin/env python3
>> # SPDX-License-Identifier: GPL-2.0-only
>> -# Copyright (C) 2025 Guillaume Tucker
>> +# Copyright (C) 2025-2026 Guillaume Tucker
>>
>> """Containerized builds"""
>>
>> import abc
>> import argparse
>> +import dataclasses
>> import logging
>> import os
>> import pathlib
>> import shutil
>> import subprocess
>> import sys
>> +import tomllib
>
> Have you seen the comment from sashiko?
>
> | Will this unconditional import of tomllib crash the script on startup for
> | users running supported Python versions like 3.9 and 3.10?
> | The kernel's baseline requirement allows Python 3.9.x, but tomllib is only
> | available starting in Python 3.11.
>
> https://sashiko.dev/#/patchset/15e16f175f59ae666036764eb03c40cdf19809c7.1787896890.git.gtucker@gtucker.io
Yes, the minimum versions listed on this page are for building and
running the kernel:
https://www.kernel.org/doc/html/latest/process/changes.html
It states Python 3.9 which was already older than the 3.10 minimum
set when the container tool was merged. Also my understanding is
that it's not a hard requirement for all the kernel tools, only for
building and producing a functioning kernel. If I misunderstood this
then I can rework the code to use .ini files until 3.11 becomes the
minimum. However, looking at the whole tree:
$ vermin -v --no-make-paths-absolute $(git ls-files *.py) | grep -e
"3.1[0-9]"
!2, 3.10 scripts/sbom/sbom/cmd_graph/deps_parser.py
!2, 3.10 scripts/sbom/sbom/spdx/build.py
!2, 3.10 scripts/sbom/sbom/spdx/core.py
!2, 3.10 scripts/sbom/sbom/spdx/simplelicensing.py
!2, 3.10 scripts/sbom/sbom/spdx/software.py
!2, 3.13 tools/lib/python/abi/abi_regex.py
!2, 3.10 tools/net/sunrpc/xdrgen/generators/__init__.py
!2, 3.10 tools/net/sunrpc/xdrgen/generators/program.py
!2, 3.10 tools/net/sunrpc/xdrgen/subcmds/source.py
!2, 3.10 tools/net/sunrpc/xdrgen/xdr_ast.py
!2, 3.10 tools/perf/scripts/python/mem-phys-addr.py
!2, 3.10 tools/power/cpupower/bindings/python/test_raw_pylibcpupower.py
!2, 3.13 tools/testing/kunit/kunit.py
!2, 3.11 tools/testing/selftests/drivers/net/hw/rss_flow_label.py
!2, 3.11 tools/testing/selftests/drivers/net/hw/rss_input_xfrm.py
!2, 3.10 tools/verification/rvgen/rvgen/dot2k.py
> (and there are some others...)
Some of the other comments are a bit bogus, the uid / gid precedence
logic is correct as far as I can tell. It's a matter of convention,
maybe this should just be clarified a bit better in the documentation
(and we may add unit tests at some point...). The comment about
injecting malicious runtime options via the configuration file seems
misled as the user should be able to trust the config file just like
the command line. It's true that the image name itself could be
sanitised for extra safety anyway but that's not something introduced
by the config file. I can do this as a follow-up I guess.
The comment about a missing whitespace is valid though, and the one
about profiles with integer values of 0 is valid too so I'll get them
fixed in a v3.
By the way, I wish we could choose to get Sashiko's review as an
email directly in the thread, do you know if this can be done easily?
Thanks,
Guillaume
next prev parent reply other threads:[~2026-08-28 17:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 10:05 [PATCH 1/2] scripts: add TOML config to container tool Guillaume Tucker
2026-08-24 10:05 ` [PATCH 2/2] Documentation: dev-tools: update container.rst with config file Guillaume Tucker
2026-08-24 10:55 ` Guillaume Tucker
2026-08-28 6:35 ` Guillaume Tucker
2026-08-28 6:39 ` [PATCH 1/2] scripts: add TOML config to container tool Guillaume Tucker
2026-08-28 16:29 ` Nicolas Schier
2026-08-28 17:25 ` Guillaume Tucker [this message]
2026-08-28 17:35 ` Miguel Ojeda
2026-08-29 8:56 ` Guillaume Tucker
2026-08-29 11:01 ` Miguel Ojeda
2026-08-29 9:02 ` Guillaume Tucker
2026-08-29 10:57 ` Miguel Ojeda
2026-09-02 10:26 ` Guillaume Tucker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b45e7864-928c-4b3c-aa62-64f4f63d85c7@gtucker.io \
--to=gtucker@gtucker.io \
--cc=automated-testing@lists.yoctoproject.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=work@onurozkan.dev \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox