Skip to content

Commit 61cb40e

Browse files
committed
clean up output and do not copy truffle.h and polyglot.h
1 parent 7da8f1e commit 61cb40e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def update_import(name, suite_py, rev="origin/master"):
746746
parent = os.path.join(SUITE.dir, "..")
747747
for dirpath,dirnames,filenames in os.walk(parent):
748748
if os.path.sep in os.path.relpath(dirpath, parent):
749-
dirnames.clear() # we're looking for siblings or sibling-subdirs
749+
dirnames = [] # we're looking for siblings or sibling-subdirs
750750
elif name in dirnames:
751751
dep_dir = os.path.join(os.path.join(dirpath))
752752
break
@@ -848,12 +848,6 @@ def update_import_cmd(args):
848848
update_import(name, suite_py, rev=("HEAD" if idx else "origin/master"))
849849

850850
# copy files we inline from our imports
851-
shutil.copy(
852-
join(mx.dependency("SULONG_LEGACY").output, "include", "truffle.h"),
853-
join(SUITE.dir, "graalpython", "com.oracle.graal.python.cext", "include", "truffle.h"))
854-
shutil.copy(
855-
join(mx.dependency("SULONG_HOME").output, "include", "polyglot.h"),
856-
join(SUITE.dir, "graalpython", "com.oracle.graal.python.cext", "include", "polyglot.h"))
857851
shutil.copy(
858852
join(mx.suite("truffle").dir, "..", "common.json"),
859853
join(overlaydir, "python", "graal-common.json"))
@@ -868,10 +862,15 @@ def update_import_cmd(args):
868862
repos_updated.append(overlaydir)
869863

870864
# now allow dependent repos to hook into update
865+
output = mx.OutputCapture()
871866
for repo in repos:
872-
cmdname = "%s-update-import" % os.path.basename(repo)
873-
if mx.run_mx(["help", cmdname], nonZeroIsFatal=False, quiet=True) == 0:
867+
basename = os.path.basename(repo)
868+
cmdname = "%s-update-import" % basename
869+
is_mx_command = mx.run_mx(["help", cmdname], out=output, err=output, nonZeroIsFatal=False, quiet=True) == 0
870+
if is_mx_command:
874871
mx.run_mx([cmdname, "--overlaydir=%s" % overlaydir], suite=repo, nonZeroIsFatal=True)
872+
else:
873+
print(mx.colorize('%s command for %s.. skipped!' % (cmdname, basename), color='magenta', bright=True, stream=sys.stdout))
875874

876875
# update ci import in all our repos, commit the full update, and push verbosely
877876
prev_verbosity = mx._opts.very_verbose
@@ -889,7 +888,7 @@ def update_import_cmd(args):
889888
repos_updated.append(repo)
890889

891890
if repos_updated:
892-
mx.log("These repos were updated: " + ", ".join(repos_updated))
891+
mx.log("\n ".join(["These repos were updated:"] + repos_updated))
893892

894893

895894
def python_style_checks(args):

0 commit comments

Comments
 (0)