While trying to use ROOT 6 in a “Ubuntu 20.04” VirtualBox (6.1.32) machine in a “Shared Folder” working directory ("/c/Temp/output" below), I get:
[...]:/c/Temp/output$ rootcint -v1 -f outputProjectDict.cxx -I$ROOTSYS/include -I"/opt/ROOT/releases/root_v6.24.06/etc/" -I"/opt/ROOT/releases/root_v6.24.06/etc//cling" -I"/opt/ROOT/releases/root_v6.24.06/include/" -I"/opt/ROOT/releases/root_v6.24.06/include" outputProjectHeaders.h outputLinkDef.h
Error: Renaming outputProjectDict.cxx_tmp_5513 into outputProjectDict.cxx!
If the working directory (“output”) is inside of the VM “.vdi” disk then it works fine.
The host (which serves “/c/Temp”) is a Windows 10 Pro machine.
BTW. ROOT 5 does not have this problem.
Hi @Wile_E_Coyote ,
thank you for the report.
The code relevant to the error should be this: root/rootcling_impl.cxx at 7a2612dc7ae62832c7683081020e190c49b75569 · root-project/root · GitHub , which makes me think this should be reproducible in isolation.
touch a file called
outputProjectDict.cxx_tmp_5513 in that directory and then try to call
std::rename('outputProjectDict.cxx_tmp_5513 into outputProjectDict.cxx', 'somethingelse')? We need to figure out why
std::rename fails in this case.
std::rename” from the ROOT prompt works fine.
It looks like this is some kind of a problem in “Windows host” <-> “Linux guest” file system synchronization (though it could also be a general problem for all kinds of hosts when a “Shared Folder” is used in VirtualBox).
In lines 2944 - 2955 (rootcling_impl.cxx"), there is a special “WIN32” fix which may be relevant also in this case.
Alright, if a simple
std::rename works then the problem might be with renaming files that are currently in use (i.e. what the WIN32 workaround is for). Can you
std::rename a file (e.g. a ROOT file) in that partition after you have opened it (e.g. as a TFile)?
my link pointed to the wrong lines of course, fixed above
I can confirm that one cannot “rename” an opened file.
I tried a simple fix, which seems to work.
Move the lines 2948/2949: “
if (ifile.is_open()) ifile.close();” to a place right before the line 2944 “
Note that the problem originates in the “
commit” procedure itself. In the line 2941 it opens the relevant file (and unfortunately leaves it opened). Simply closing it seems to solve the problem.
BTW. Maybe there are other places where some file is “left unnecessarily opened” and should be fixed, too.
There is a PR addressing this issue. Thanks @Wile_E_Coyote and @eguiraud for reporting it and proposing a solution
I’ll take a look
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.