[main] Rewrite rootcp in C++#20536
Conversation
ad80460 to
a6e4556
Compare
Test Results 21 files 21 suites 3d 5h 5m 53s ⏱️ Results for commit 9daafe2. ♻️ This comment has been updated with latest results. |
001245d to
76da6da
Compare
f96b407 to
666a298
Compare
fe1ca58 to
d025767
Compare
vepadulano
left a comment
There was a problem hiding this comment.
Great work, thanks! Some questions from my side.
45566a0 to
784e022
Compare
vepadulano
left a comment
There was a problem hiding this comment.
Nice work, all clear for me!
so that it can be reused by other utilities (rootcp, rootmv, ...)
With this change rootcp will by default not print Info messages (same as rootcp.py), will print a `cp -v`-like output with -v and more detailed info with -vv.
There is really no point in having it implicit and for clarity of intention it's better to spell it out.
4d85821 to
9daafe2
Compare
| std::cerr << "WARNING: Several versions of '" << key->GetName() << "' are present in '" << fileName | ||
| << "'. Only the most recent will be considered.\n"; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Why is this an error? Having backup keys is the common case?
There was a problem hiding this comment.
It's just a warning, and it was like this in rootcp.py so I kept it as-is
| std::sort(keys.begin(), keys.end(), | ||
| [](const auto *a, const auto *b) { return strcmp(a->GetName(), b->GetName()) < 0; }); |
There was a problem hiding this comment.
Why is this intermediary step needed? (And it seems it might also shuffle the ordering of the keys that corresponding to the same name).
There was a problem hiding this comment.
Because we want to show the keys sorted by name? I'm not sure I understand the question
This Pull request:
Depends on #20531.
Replaces
rootcp.pywith a native version in C++.Like for
rootlsandrootbrowse, this makesrootcpavailable even without python and, as a bonus, makes the tool significantly faster (the python version takes about 500ms just to start).The behaviour should be the same as the python version and it has the benefit of not crashing when trying to copy RNTuples (although RNTuple is not handled yet).
The new
rootcphas been currently mostly tested with our own roottest suite, but probably we want some more thorough testing before merging, especially if rootcp is used in experiments workflows.Other significant changes
rootlsandrootcp(will also be useful forrootmvand likelyrootmkdir): this is the code that basically converts a path like"file.root:a/b/*"to a tree of objects and directories.Checklist: