+10
-10
@@ -20,6 +20,7 @@ COMMANDS = (
|
||||
"package",
|
||||
"lsp",
|
||||
"clangd",
|
||||
"format",
|
||||
"run",
|
||||
)
|
||||
COMMON_DIR = pathlib.Path("build") / "build_common"
|
||||
@@ -65,6 +66,9 @@ def runtime_ready(root):
|
||||
and (root / TOOLS_DIR / "run.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "cli.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "export.py").is_file()
|
||||
and (root / TOOLS_DIR / "format.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "formatting.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "format_layout.py").is_file()
|
||||
)
|
||||
|
||||
def optional_credentials():
|
||||
@@ -103,13 +107,7 @@ def run(command, input_text=None, capture=False, display_command=None, env=None,
|
||||
def run_with_retries(command, attempts=3, input_text=None, display_command=None, env=None):
|
||||
completed = None
|
||||
for attempt in range(1, attempts + 1):
|
||||
completed = run(
|
||||
command,
|
||||
input_text=input_text,
|
||||
display_command=display_command,
|
||||
env=env,
|
||||
check=False,
|
||||
)
|
||||
completed = run(command, input_text=input_text, display_command=display_command, env=env, check=False)
|
||||
if completed.returncode == 0:
|
||||
return completed
|
||||
if attempt != attempts:
|
||||
@@ -204,9 +202,11 @@ RUN python3 -m venv /opt/modulus-python
|
||||
ENV PATH=/opt/modulus-python/bin:$PATH
|
||||
|
||||
COPY tools/requirements.txt /tmp/vamp-build-requirements.txt
|
||||
ARG MODULUS_TOOLS=build/build_tools
|
||||
COPY ${{MODULUS_TOOLS}}/docker/format-requirements.txt /tmp/modulus-format-requirements.txt
|
||||
|
||||
RUN python -m pip install --no-cache-dir \\
|
||||
conan=={CONAN_VERSION} -r /tmp/vamp-build-requirements.txt
|
||||
conan=={CONAN_VERSION} -r /tmp/vamp-build-requirements.txt -r /tmp/modulus-format-requirements.txt
|
||||
|
||||
LABEL org.khodo.product-vamp.build-requirements="{build_requirements_digest()}"
|
||||
|
||||
@@ -487,9 +487,9 @@ def run_package(argv):
|
||||
|
||||
def delegate(command, argv):
|
||||
root = repo_root()
|
||||
if command == "clangd":
|
||||
if command in {"clangd", "format"}:
|
||||
if not runtime_ready(root):
|
||||
print("Modulus clangd tooling is missing; run ./modulus.py configure first", file=sys.stderr)
|
||||
print(f"Modulus {command} tooling is missing; run ./modulus.py configure first", file=sys.stderr)
|
||||
return 1
|
||||
else:
|
||||
ensure_runtime(root)
|
||||
|
||||
Reference in New Issue
Block a user