libcamera/utils
Laurent Pinchart a5f12d2eb3 meson: utils: Provide environment for Python scripts
Python scripts run as part of the build process need to take a few
actions specific to the environment in which they operate. One of those
is disabling the Python bytecode cache, to avoid writing .pyc files to
the source tree. This is done manually in the IPC generate.py and
parser.py scripts.

The current implementation is not ideal because it hardcodes in the
scripts information related to the environment in which they operate. As
those scripts are part of libcamera this is more of a theoretical issue
than a practical one. A second issue is that future Python scripts will
need to duplicate similar mechanisms, resulting in a higher maintenance
burden.

Address the issue with a different approach, by creating a meson
environment for the Python scripts, and passing it to the
custom_target() functions. The environment only disables the bytecode
cache for now.

The diffstat shows an increase in code size. This is expected to be
offset by usage of the environment for more Python scripts, as well as
support of more variables in the environment.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-16 00:00:23 +03:00
..
codegen meson: utils: Provide environment for Python scripts 2024-08-16 00:00:23 +03:00
hooks hooks: pre-push: Disable interpretation of escape sequences 2024-01-09 15:39:04 +00:00
ipu3 libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
raspberrypi utils: raspberrypi: ctt: Add a maximum gain parameter for LSC 2024-06-13 11:02:39 +01:00
rkisp1 libcamera: Drop remaining file name from header comment blocks 2024-05-09 23:31:15 +03:00
tracepoints meson: Move all code generation scripts to utils/codegen/ 2024-08-15 23:59:08 +03:00
tuning utils: tuning: Change Tuner.add() to accept a list of modules 2024-08-14 16:22:07 +02:00
abi-compat.sh utils: ABI Compatibility checker 2023-07-04 20:25:10 +01:00
checkstyle.py utils: checkstyle.py: Add __repr__ method to Commit class 2024-08-12 15:44:23 +03:00
gen-ipa-priv-key.sh libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
gen-version.sh utils: gen-version: Use posix compliant date 2024-07-25 09:57:54 +01:00
meson.build meson: Move all code generation scripts to utils/codegen/ 2024-08-15 23:59:08 +03:00
release.sh utils: Provide a release script 2022-10-13 12:40:24 +01:00
run-dist.sh build: Preserve upstream git versioning using meson dist 2021-10-19 13:14:54 +03:00
semver utils: semver: Add version helper 2022-10-13 12:40:23 +01:00
update-kernel-headers.sh update-kernel-headers: Add linux/udmabuf.h to headers to sync 2024-06-03 12:14:33 +03:00
update-mojo.sh utils: update-mojo.sh: Commit the mojo update 2024-01-09 15:39:05 +00:00