AntoinePrv commented on code in PR #50056:
URL: https://github.com/apache/arrow/pull/50056#discussion_r3459952855
##########
dev/archery/archery/benchmark/runner.py:
##########
@@ -217,19 +236,25 @@ def from_rev_or_path(src, root, rev_or_path, cmake_conf,
**kwargs):
build = CMakeBuild.from_path(rev_or_path)
return CppBenchmarkRunner(build, **kwargs)
else:
- # Revisions can references remote via the `/` character, ensure
- # that the revision is path friendly
- path_rev = rev_or_path.replace("/", "_")
+ path_rev = _rev_or_path_dirname(src, rev_or_path)
root_rev = os.path.join(root, path_rev)
- os.mkdir(root_rev)
+ os.makedirs(root_rev, exist_ok=True)
clone_dir = os.path.join(root_rev, "arrow")
- # Possibly checkout the sources at given revision, no need to
- # perform cleanup on cloned repository as root_rev is reclaimed.
- src_rev, _ = src.at_revision(rev_or_path, clone_dir)
+ if os.path.isdir(clone_dir):
+ src_rev = ArrowSources(clone_dir)
+ else:
+ src_rev, _ = src.at_revision(rev_or_path, clone_dir)
cmake_def = CppCMakeDefinition(src_rev.cpp, cmake_conf)
- build_dir = os.path.join(root_rev, "build")
- return CppBenchmarkRunner(cmake_def.build(build_dir), **kwargs)
+ run_root = os.path.join(root_rev, "build", "run")
+ os.makedirs(run_root, exist_ok=True)
+ run_id = f"{random.randrange(16**8):08x}"
Review Comment:
Yes, reusing it seemed to far fetched for this PR. Many things could have
changed: CMake options, env vars, dependencies...
I guess we could delete it afterwards, maybe keeping / reading
`CMakeCache.txt` which contains precious information.
On my computer a build dir is ~250Mb so even ten of them is manageable, but
no big opinion until we can find a clean way to reuse them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]