build: Check if allow-run-as-root is an mpi option by executing cmake instead of dir

This commit is contained in:
Gabriel Ferreira
2025-10-13 23:34:52 +02:00
parent afa8618383
commit 970cda0ce6

6
ns3
View File

@@ -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