You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4410 Reporter: inalan Assigned to: ertai Status: closed (set by @xavierleroy on 2010-04-29T12:26:09Z) Resolution: fixed Priority: normal Severity: minor Version: 3.10.0 Fixed in version: 3.10+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
I use ocaml regularly and have been looking forward to upgrading to 3.10 and using ocamlbuild. I use a combination of windows, cygwin and mingw, and cross-compile on linux (CentOs 4) as well. I discovered a bug in ocamlbuild-0.1 (as included in the ocaml-3.10.0 distribution). When building a plugin using a myocamlbuild.ml file, if the -build-dir option is specified and the build directory does not start with an underscore ('_'), the plugin will build properly but when ocamlbuild actually compiles and executes the plugin the following error is raised:
================ BEGIN DUMP ===============
ocamlbuild -install-lib-dir "C:\devtools\ocaml-3.10\lib\ocamlbuild" -build-dir .build -no-links -log .log src/main.byte
ocamlopt -I "C:\devtools\ocaml-3.10\lib\ocamlbuild" unix.cmxa "C:\devtools\ocaml-3.10\lib\ocamlbuild/ocamlbuildlib.cmxa" myocamlbuild.ml "C:\devtools\ocaml-3.10\lib\ocamlbuild/ocamlbuild.cmx" -o myocamlbuild
SANITIZE: a total of 6 files that should probably not be in your source tree
has been found. A script shell file "sanitize.sh" is being created. Check
this script and run it to remove unwanted files or use other options (such
as defining hygiene exceptions or using the -no-hygiene option).
IMPORTANT: I cannot work with leftover compiled files.
ERROR: Leftover dependency files:
File main.ml.depends in .build/src has suffix .ml.depends
ERROR: Leftover Ocaml compilation files:
File main.cmo in .build/src has suffix .cmo
File main.cmi in .build/src has suffix .cmi
ERROR: Leftover object files:
File myocamlbuild.o in .build has suffix .o
ERROR: Leftover Ocaml compilation files:
File myocamlbuild.cmi in .build has suffix .cmi
File myocamlbuild.cmx in .build has suffix .cmx
Exiting due to hygiene violations.
make: *** [wxO.exe] Error 1
================ END DUMP ===============
As you can see, I prefer to name my build directory ".build". This causes the above mentioned problem. Building instead using "_build" or "_bld" or any other name with an initial underscore, or not using the -build-dir flag, does not cause this problem and the plugin executes correctly. The reason for this error is the following set of lines from ocamlbuild/main.ml, in the definition of 'entry' in the proceed() function:
(String.length name > 0 && name.[0] <> '_' && not (List.mem name !Options.exclude_dirs))
An easy fix is to add the build directory to the list of excluded paths in the invocation of ocamlbuild:
ocamlbuild -build-dir $(BUILDDIR) -X $(BUILDDIR) etc.
This seems like a less than ideal solution, however. I believe this term:
name.[0] <> '_'
should be excluded from the conditional guard/clause, and instead it should be replaced with:
name <> !Options.build_dir
or that Options.build_dir should be added to Options.exclude_dirs (this latter solution doesn't seem as good because (though this does not currently seem to be the case) exclude_dirs could be used in other places in the system or in plugins).
I thought I might submit an actual patch but I think I will not have time to test it properly, so I decided to just describe a fix instead. I searched the archive but did not find this bug anywhere. The closest match was probably 0004387 (ocamlbuild doesn't use build directory properly), but it's not really the same issue.
The text was updated successfully, but these errors were encountered:
Original bug ID: 4410
Reporter: inalan
Assigned to: ertai
Status: closed (set by @xavierleroy on 2010-04-29T12:26:09Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10.0
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
I use ocaml regularly and have been looking forward to upgrading to 3.10 and using ocamlbuild. I use a combination of windows, cygwin and mingw, and cross-compile on linux (CentOs 4) as well. I discovered a bug in ocamlbuild-0.1 (as included in the ocaml-3.10.0 distribution). When building a plugin using a myocamlbuild.ml file, if the -build-dir option is specified and the build directory does not start with an underscore ('_'), the plugin will build properly but when ocamlbuild actually compiles and executes the plugin the following error is raised:
================ BEGIN DUMP ===============
ocamlbuild -install-lib-dir "C:\devtools\ocaml-3.10\lib\ocamlbuild" -build-dir .build -no-links -log .log src/main.byte
ocamlopt -I "C:\devtools\ocaml-3.10\lib\ocamlbuild" unix.cmxa "C:\devtools\ocaml-3.10\lib\ocamlbuild/ocamlbuildlib.cmxa" myocamlbuild.ml "C:\devtools\ocaml-3.10\lib\ocamlbuild/ocamlbuild.cmx" -o myocamlbuild
SANITIZE: a total of 6 files that should probably not be in your source tree
has been found. A script shell file "sanitize.sh" is being created. Check
this script and run it to remove unwanted files or use other options (such
as defining hygiene exceptions or using the -no-hygiene option).
IMPORTANT: I cannot work with leftover compiled files.
ERROR: Leftover dependency files:
File main.ml.depends in .build/src has suffix .ml.depends
ERROR: Leftover Ocaml compilation files:
File main.cmo in .build/src has suffix .cmo
File main.cmi in .build/src has suffix .cmi
ERROR: Leftover object files:
File myocamlbuild.o in .build has suffix .o
ERROR: Leftover Ocaml compilation files:
File myocamlbuild.cmi in .build has suffix .cmi
File myocamlbuild.cmx in .build has suffix .cmx
Exiting due to hygiene violations.
make: *** [wxO.exe] Error 1
================ END DUMP ===============
As you can see, I prefer to name my build directory ".build". This causes the above mentioned problem. Building instead using "_build" or "_bld" or any other name with an initial underscore, or not using the -build-dir flag, does not cause this problem and the plugin executes correctly. The reason for this error is the following set of lines from ocamlbuild/main.ml, in the definition of 'entry' in the proceed() function:
An easy fix is to add the build directory to the list of excluded paths in the invocation of ocamlbuild:
ocamlbuild -build-dir$(BUILDDIR) -X $ (BUILDDIR) etc.
This seems like a less than ideal solution, however. I believe this term:
should be excluded from the conditional guard/clause, and instead it should be replaced with:
or that Options.build_dir should be added to Options.exclude_dirs (this latter solution doesn't seem as good because (though this does not currently seem to be the case) exclude_dirs could be used in other places in the system or in plugins).
I thought I might submit an actual patch but I think I will not have time to test it properly, so I decided to just describe a fix instead. I searched the archive but did not find this bug anywhere. The closest match was probably 0004387 (ocamlbuild doesn't use build directory properly), but it's not really the same issue.
The text was updated successfully, but these errors were encountered: