From 970cda0ce631ae97ab2223b5ce5f7a49295c6d24 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Mon, 13 Oct 2025 23:34:52 +0200 Subject: [PATCH] build: Check if allow-run-as-root is an mpi option by executing `cmake` instead of `dir` --- ns3 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ns3 b/ns3 index 1b95a22aa..6a5580678 100755 --- a/ns3 +++ b/ns3 @@ -1540,7 +1540,11 @@ def run_step(args, target_to_run, target_args): if target_to_run in ["mpiexec", "mpirun"] and os.getenv("MPI_CI"): if shutil.which("ompi_info"): try: - subprocess.check_call([target_to_run, "--allow-run-as-root", "dir"]) + subprocess.check_call( + [target_to_run, "--allow-run-as-root", "cmake", "--version"], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) target_args = ["--allow-run-as-root"] + target_args except subprocess.CalledProcessError: pass