From 20fe89bc8df7e591b7973105cc01063bee2f0e3a Mon Sep 17 00:00:00 2001 From: Dima Dorezyuk Date: Fri, 28 Jun 2024 13:16:29 +0200 Subject: [PATCH] Check for edm --- third-party/bazel/edm.bzl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/third-party/bazel/edm.bzl b/third-party/bazel/edm.bzl index 8cd08674a..ef7c205a8 100644 --- a/third-party/bazel/edm.bzl +++ b/third-party/bazel/edm.bzl @@ -5,9 +5,21 @@ def _edm_repositories_impl(rctx): build_files_args.append("--build-file") build_files_args.append(str(build_file)) print("build_files_args: ", build_files_args) + # If we don't have edm on the machine installed we try to recover and + # install it. + if rctx.which("edm") == None: + print("Installind edm") + rctx.execute( + [ + "python3", + "-m", + "pip", + "install", + "git+https://github.com/Everest/everest-dev-environment.git#subdirectory=dependency_manager", + ] + ) exec_result = rctx.execute( - ["edm", "bazel", rctx.attr.dependencies_yaml] + - build_files_args, + ["edm", "bazel", rctx.attr.dependencies_yaml] + build_files_args, ) if exec_result.return_code != 0: fail("edm exec error: ", exec_result.stderr) @@ -27,5 +39,5 @@ edm_repositories = repository_rule( allow_files=True, doc="List of build files for external repositories", ), - }, -) \ No newline at end of file + }, +)