3

I'm generating some documentation using doxygen, which generates a lot of files in a folder.

So as not to have to wait for the removal of the previous folder, I decided to move the folder in the current process, delete that moved folder in a separate process and then create the doxygen documents. Except what happens is that the moved folder is still being reference by doxygen. Here is the code:

mv doxygen/ doxygen.tmp
rm -rf doxygen.tmp&
doxygen Doxyfile

I originally had this on one line, but putting it into a script file on multiple lines like this didn't make a difference.

What could be causing the issue? Could it be caused by a cygwin bug? Or am I missing something?

NOTE: The doxygen used is the one for windows, not cygwin. I'm only using cygwin for job control. The windows one is faster due to not using fork which is an expensive emulation on cygwin.

EDIT: Both the windows and the cygwin version of doxygen show the following which I didn't notice before:

windows:

...
Searching for files in directory C:/cygwin/home/Adrian/Projects/genLang
Searching for files in directory C:/cygwin/home/Adrian/Projects/genLang/doxygen
Searching for files in directory C:/cygwin/home/Adrian/Projects/genLang/tmpaaaa
Searching for files in directory C:/cygwin/home/Adrian/Projects/genLang/tmpaaaa/html
Searching for files in directory C:/cygwin/home/Adrian/Projects/genLang/tmpaaaa/html/d0
...

cygwin:

...
Searching INPUT for files to process...
Searching for files in directory /home/Adrian/Projects/genLang
Searching for files in directory /home/Adrian/Projects/genLang/doxygen
Searching for files in directory /home/Adrian/Projects/genLang/tmpaaaa
Searching for files in directory /home/Adrian/Projects/genLang/tmpaaaa/html
Searching for files in directory /home/Adrian/Projects/genLang/tmpaaaa/html/d2
...
Adrian
  • 10,246
  • 4
  • 44
  • 110
  • How do you see doxygen using the moved path? Does it use it as `doxygen` or as `doxygen.tmp` (could that be an internal name doxygen uses)? Does this happen if you use a name like `mvtest` instead? – Etan Reisner Sep 03 '15 at 14:00
  • @EtanReisner, doxygen companies that it can't find files and then spits out the path of `.../doxygen.tmp/...`. And no, not a name that doxygen uses. I've tried other temp directory names. – Adrian Sep 03 '15 at 14:12
  • If it spits out `doxygen.tmp` then it is seeing the new name. You get the same failure from other temp directory names? Where whatever name you chose is in the error message? – Etan Reisner Sep 03 '15 at 14:19
  • Yeah, it would appear that doxygen is grabbing the inode and using that. – Adrian Sep 03 '15 at 14:21
  • What's in your Doxyfile? Does it use wildcards or other greedy techniques like recursing through `.`? – Jens Sep 03 '15 at 14:22
  • No wildcards. The line which specifies what dir to output to states: `OUTPUT_DIRECTORY = doxygen`. – Adrian Sep 03 '15 at 14:25
  • doxygen can't be seeing the file at `doxygen.tmp` once `mv` has finished unless cygwin is doing something *really* strange behind the scenes (and breaking all atomicity guarantees that normally exist (though those are fs dependent). If you move it *out* of the current directory does this still happen? – Etan Reisner Sep 03 '15 at 14:28
  • Oh. I suppose it is possible that cygwin has not synced the `mv` so Windows can see it yet. Does this happen with the cygwin doxygen? – Etan Reisner Sep 03 '15 at 14:29
  • Yeah, I just tried that. Same thing. See my edit. The name changes in the middle of processing. – Adrian Sep 03 '15 at 14:39

1 Answers1

4

I figured out the issue.

The problem isn't that the inode is being held or bash is screwing up, but that doxygen is recursively searching the directory for files to document. Since the documentation is being put in the same directory as the source, it looks in the documentation directory for stuff to document, which are being deleted, resulting in errors. Adding this:

EXCLUDE_PATTERNS       = doxygen*

or moving the doxygen document directory to another path location fixes the issue.

Adrian
  • 10,246
  • 4
  • 44
  • 110