make: fix running fix target after verify

Define a Python virtual environment to install yamllint, if not
installed locally, in a temporary directory and delete it after the run
of the verify-yamllint command. This avoids the issue of building the
build of materials that doesn't follow symlinks in the virtual
environment directory.

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2024-05-04 09:53:10 -07:00
parent 25367fc7e9
commit 0c134dd2c7
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5

View File

@ -125,9 +125,11 @@ verify-genproto:
verify-yamllint:
ifeq (, $(shell which yamllint))
@echo "Installing yamllint..."
python3 -m venv bin/python
bin/python/bin/python3 -m pip install yamllint
./bin/python/bin/yamllint --config-file tools/.yamllint .
tmpdir=$$(mktemp -d); \
trap "rm -rf $$tmpdir" EXIT; \
python3 -m venv $$tmpdir; \
$$tmpdir/bin/python3 -m pip install yamllint; \
$$tmpdir/bin/yamllint --config-file tools/.yamllint .
else
@echo "yamllint already installed..."
yamllint --config-file tools/.yamllint .