From: David Gibson <david@gibson.dropbear.id.au>
To: Simon Glass <sjg@chromium.org>
Cc: Devicetree Compiler <devicetree-compiler@vger.kernel.org>
Subject: Re: [PATCH 2/2] README: Use meson in the Python section
Date: Thu, 29 Oct 2026 12:17:24 +1100 [thread overview]
Message-ID: <auKeowlno9ud_XEC@gractus.seuss> (raw)
In-Reply-To: <20261028112007.3980089-2-sjg@chromium.org>
[-- Attachment #1: Type: text/plain, Size: 3096 bytes --]
On Wed, Oct 28, 2026 at 05:20:02AM -0600, Simon Glass wrote:
> The Python section of README.md assumes a make build. It installs with
> 'make install', disables the library with NO_PYTHON, and runs its
> examples from the source tree, where make puts the built module. With
> meson the module is in the build directory instead, so the help example
> quietly imports whatever libfdt is installed, and the coverage example
> fails.
>
> Use meson to install and to disable the Python library, and run the
> examples from the build directory.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>
> README.md | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/README.md b/README.md
> index ed9039d..fcfc2e5 100644
> --- a/README.md
> +++ b/README.md
> @@ -37,7 +37,8 @@ distributions:
> $ sudo apt-get install swig python3-dev
> ```
>
> -The library provides an `Fdt` class which you can use like this:
> +The library provides an `Fdt` class which you can use like this, from
> +`build/tests` after running the tests:
>
> ```
> $ PYTHONPATH=../pylibfdt python3
> @@ -59,7 +60,7 @@ You will find tests in `tests/pylibfdt_tests.py` showing how to use each
> method. Help is available using the Python help command, e.g.:
>
> ```
> -$ cd pylibfdt
> +$ cd build/pylibfdt
> $ python3 -c "import libfdt; help(libfdt)"
> ```
>
> @@ -67,9 +68,9 @@ If you add new features, please check code coverage:
>
> ```
> $ sudo apt-get install python3-coverage
> -$ cd tests
> +$ cd build/tests
> # It's just 'coverage' on most other distributions
> -$ python3-coverage run pylibfdt_tests.py
> +$ python3-coverage run ../../tests/pylibfdt_tests.py
> $ python3-coverage html
> # Open 'htmlcov/index.html' in your browser
> ```
> @@ -91,20 +92,21 @@ host system first. Generally, using `--user` or `--prefix` is not
> necessary and pip will use the default location for the Python
> installation which varies if the user is root or not.
>
> -You can also install everything via make if you like, but pip is
> +You can also install everything with meson if you like, but pip is
> recommended.
>
> To install both libfdt and pylibfdt you can use:
>
> ```
> -$ make install [PREFIX=/path/to/install_dir]
> +$ meson setup [--prefix=/path/to/install_dir] build
> +$ meson install -C build
> ```
>
> To disable building the python library, even if swig and Python are available,
> use:
>
> ```
> -$ make NO_PYTHON=1
> +$ meson setup -Dpython=disabled build
> ```
>
> More work remains to support all of libfdt, including access to numeric
> ---
> base-commit: 1d50f3f8fa8bf9429eebb0769dafa5df37381ae1
> branch: readme-meson
>
> --
> 2.43.0
>
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-10-29 1:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 11:20 [PATCH 1/2] README: Explain how to build with meson Simon Glass
2026-10-28 11:20 ` [PATCH 2/2] README: Use meson in the Python section Simon Glass
2026-10-28 20:05 ` Herve Codina
2026-10-29 1:17 ` David Gibson [this message]
2026-10-28 19:52 ` [PATCH 1/2] README: Explain how to build with meson Herve Codina
2026-10-29 1:17 ` David Gibson
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=auKeowlno9ud_XEC@gractus.seuss \
--to=david@gibson.dropbear.id.au \
--cc=devicetree-compiler@vger.kernel.org \
--cc=sjg@chromium.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