From 0c134dd2c780c20d1fb2c6eb07a769fac18d0efb Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Sat, 4 May 2024 09:53:10 -0700 Subject: [PATCH] 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 --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 30411b2c3..07bebc0dc 100644 --- a/Makefile +++ b/Makefile @@ -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 .