Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ninja system-wide detection #2364

Open
carlosal1015 opened this issue Oct 9, 2024 · 1 comment
Open

Improve ninja system-wide detection #2364

carlosal1015 opened this issue Oct 9, 2024 · 1 comment
Labels

Comments

@carlosal1015
Copy link

Describe the bug

In Arch Linux, ninja binary detection is wrong. Let's see a minimal extract of build_ninja().

# File located at /tmp/main.py
import sys
import os
import subprocess

try:
    subprocess.run(
        [sys.path[0] + os.path.sep + "ninja", "--version"], stdout=subprocess.PIPE
    )
except OSError:
    print("ninja executable not found. Building ...")
    subprocess.run(
        args=[
            subprocess.run(
                args=["which", "ninja"], capture_output=True, text=True
            ).stdout.strip(),
            "--version",
        ],
        stdout=subprocess.PIPE,
    )
    subprocess.run(["ninja", "--version"])

    subprocess.run(["pwd"])
    print(sys.path[0])
ninja executable not found. Building ...
1.12.1
/tmp
/tmp

Desktop

  • OS: Arch Linux
  • SU2 Version: v8.1.0
@pcarruscag
Copy link
Member

Thanks, please open a pull request with the proposed fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants