Fix makefile target check with Make jobserver keep-going (#46784)

This commit is contained in:
Jordan Galby 2024-10-14 00:02:49 +02:00 committed by GitHub
parent a8029c8ec4
commit 02a991688f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1855,13 +1855,22 @@ def _has_make_target(self, target):
#
# BSD Make:
# make: don't know how to make test. Stop
#
# Note: "Stop." is not printed when running a Make jobserver (spack env depfile) that runs
# with `make -k/--keep-going`
missing_target_msgs = [
"No rule to make target `{0}'. Stop.",
"No rule to make target '{0}'. Stop.",
"don't know how to make {0}. Stop",
"No rule to make target `{0}'.",
"No rule to make target '{0}'.",
"don't know how to make {0}.",
]
kwargs = {"fail_on_error": False, "output": os.devnull, "error": str}
kwargs = {
"fail_on_error": False,
"output": os.devnull,
"error": str,
# Remove MAKEFLAGS to avoid inherited flags from Make jobserver (spack env depfile)
"extra_env": {"MAKEFLAGS": ""},
}
stderr = make("-n", target, **kwargs)