Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006482OCamlOCamlbuild (the tool)public2014-07-11 00:512014-07-15 01:48
Reportergfxmonk 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSFedoraOS Version20
Product Version4.00.1 
Target Version4.02.1+devFixed in Version4.02.0+beta1 / +rc1 
Summary0006482: ocamlbuild fails with Sys_error if there is a _tags file anywhere inside an ignored (unhygienic) directory
DescriptionI could be misreading the cause, this is just what it seems like to me.
Steps To Reproduce1) Untar the attached minimal workspace
2) cd into ocamlbuild-bug
3) `ocamlbuild main.native`

I get:

Exception Sys_error("deps/foo/_tags: No such file or directory").
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
Additional InformationThe attached tar has the basic structure:

- main.ml
- _tags
- deps/foo/_tags (empty)
- deps/main.cmx (empty)

"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:

<deps>: not_hygienic

Running with -no-sanitize still causes the same error, so I don't think it's actually a bug in the sanitize plugin.
TagsNo tags attached.
Attached Filesgz file icon ocamlbuild-bug.tar.gz [^] (458 bytes) 2014-07-11 00:51

- Relationships

-  Notes
(0011811)
gasche (developer)
2014-07-14 16:46

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:

  <deps>: -traverse

You can also whitelist directories to traverse by disabling traversal by default:

  true: -traverse
  <lib1>: traverse
  <lib2>: traverse
(0011816)
gfxmonk (reporter)
2014-07-15 01:48

Thanks for the fix gasche, and also for the correction - I was indeed confused about what not_hygenic should be used for.

- Issue History
Date Modified Username Field Change
2014-07-11 00:51 gfxmonk New Issue
2014-07-11 00:51 gfxmonk File Added: ocamlbuild-bug.tar.gz
2014-07-11 12:04 doligez Status new => acknowledged
2014-07-11 12:04 doligez Target Version => 4.02.1+dev
2014-07-11 18:05 gasche Assigned To => gasche
2014-07-11 18:05 gasche Status acknowledged => assigned
2014-07-14 16:46 gasche Note Added: 0011811
2014-07-14 16:46 gasche Status assigned => resolved
2014-07-14 16:46 gasche Fixed in Version => 4.02.0+dev
2014-07-14 16:46 gasche Resolution open => fixed
2014-07-14 16:46 gasche Fixed in Version 4.02.0+dev => 4.02.0+beta1 / +rc1
2014-07-15 01:48 gfxmonk Note Added: 0011816


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker