Skip to content

Commit 04947cd

Browse files
committed
Make logic clearer for producing PGO in bench jobs
1 parent 7db7880 commit 04947cd

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,18 @@ def libpythonvm_build_args():
308308
profile = get_profile(["--branch", b])
309309
except BaseException:
310310
pass
311-
if CI and not os.path.isfile(profile or "") and (
312-
# When running on a release branch or attempting to merge into
313-
# a release branch, make sure we can use a PGO profile
314-
any(b.startswith("release/") for b in [branch, os.environ.get("TO_BRANCH", "")])
315-
# When running in the CI on a bench runner, use a PGO profile
316-
or ",bench," in os.environ.get("LABELS", "")
317-
):
318-
mx.warn("PGO profile must exist for benchmarking and release, creating one now...")
319-
profile = graalpy_native_pgo_build_and_test()
311+
312+
if CI and not os.path.isfile(profile or ""):
313+
mx.log("No profile in CI job")
314+
# When running on a release branch or attempting to merge into
315+
# a release branch, make sure we can use a PGO profile, and
316+
# when running in the CI on a bench runner, ensure a PGO profile
317+
if (
318+
any(b.startswith("release/") for b in [branch, os.environ.get("TO_BRANCH", "")])
319+
or (",bench," in os.environ.get("LABELS", ""))
320+
):
321+
mx.warn("PGO profile must exist for benchmarking and release, creating one now...")
322+
profile = graalpy_native_pgo_build_and_test()
320323

321324
if os.path.isfile(profile or ""):
322325
print(invert(f"Automatically chose PGO profile {profile}. To disable this, set GRAALPY_PGO_PROFILE to an empty string'", blinking=True), file=sys.stderr)

0 commit comments

Comments
 (0)