Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamlbuild fails with Sys_error if there is a _tags file anywhere inside an ignored (unhygienic) directory #6482
Original bug ID: 6482
I could be misreading the cause, this is just what it seems like to me.
Steps to reproduce
Exception Sys_error("deps/foo/_tags: No such file or directory").
The attached tar has the basic structure:
"deps" in the original source tree (which uncovered the bug) is where I've compiled some third party code, so I need it to be ignored by the sanitization plugin. So I've got the following toplevel _tags rule:
Running with -no-sanitize still causes the same error, so I don't think it's actually a bug in the sanitize plugin.
Comment author: @gasche
There is both a bug in ocamlbuild and, I think an incomprehension about what not_hygienic means.
The bug is fixed in 4.02 and trunk.
The incomprehension is the following: gfxmonk seems to expect that not_hygienic means that those directories will not be traversed by ocamlbuild. This is not the case! Non-hygienic directories are normal build directories (which will be used to look for targets to build and their dependencies), only they're allowed to contain stuff that looks like partial build output. In particular, any _tags file contained in those directories will be parsed -- this is why adding not_hygienic was not a workaround for the bug.
If you want to prevent ocamlbuild from traversing a directory, parsing its _tags file and using its content, you should disable the "traverse" tag for this directory:
You can also whitelist directories to traverse by disabling traversal by default: