android_external_mesa3d/meson_to_hermetic
= cd3e8cb750 meson_to_hermetic_test: Adds some rudimentry unit tests for Config Parsing in meson_impl
See README.md for instructions

Test: python -m unittest meson_to_hermetic_test/meson_impl_test.py and see passing
Bug: 360173803
Change-Id: I54fc37043bff745de32c0c56496615f466790361
2024-08-27 22:41:36 +00:00
..
templates meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
.gitignore meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
__init__.py meson_to_hermetic_test: Adds some rudimentry unit tests for Config Parsing in meson_impl 2024-08-27 22:41:36 +00:00
aosp.toml meson_to_hermetic_test: Adds some rudimentry unit tests for Config Parsing in meson_impl 2024-08-27 22:41:36 +00:00
build-android-turnip.sh meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
build-fuchsia-turnip.sh meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
fuchsia.toml meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
generate_python_build.py meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
lint.sh meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
meson2python.py meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
meson_common.py meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
meson_impl.py meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
meson_to_hermetic.py meson_to_hermetic_test: Adds some rudimentry unit tests for Config Parsing in meson_impl 2024-08-27 22:41:36 +00:00
README.md meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
requirements.txt meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00
setup-venv.sh meson-to-hermetic: Rename meson-to-hermetic to -> meson_to_hermetic 2024-08-26 22:13:07 +00:00

meson-to-hermetic: automated build system generation

Goal: ease the integration of Mesa as a component inside larger projects like Android (AOSP).

How: parse the meson build tree into a python build script, which can be used together with configuration and options to generate other kinds of build scripts.

Status: useful, but rough. Supports Android (Soong) and Fuchsia (Bazel).

Python Dependencies

  • Python 3.11+
    • See requirements.txt
    • Ruff

Environment Setup

  1. Open a terminal within mesa3d/meson_to_hermetic
  2. Run the setup-venv.sh file to automatically create a python3 venv and install dependencies.

Linting the code

  1. Before pushing code for review; run lint.sh to automatically lint all of the python scripts.
    • IMPORTANT: Run the lint.sh from the meson_to_hermetic directory.

1 - Generate python from meson

generate_python_build.py: reads meson.build files (following subdir() commands) and uses meson2python to transform the meson into python.

meson2python.py: passes meson.build input and the meson grammar to python lark to perform lexing and parsing; then transforms the parse tree into valid python. The result is one large python script.

2 - Generate Android.bp from python

meson_android.py defines the meson API entry points and emits Android.bp build constructs. A config file is read to determine some build parameters such as cpu_family (similar to meson's cross file).

Limitations

Meson build options must be set by modifying the defaults in meson_options.txt.