{"action":"opened","issue":{"url":"https://api.github.com/repos/ocaml/camlp4/issues/93","labels_url":"https://api.github.com/repos/ocaml/camlp4/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/camlp4/issues/93/comments","events_url":"https://api.github.com/repos/ocaml/camlp4/issues/93/events","html_url":"https://github.com/ocaml/camlp4/issues/93","id":90606907,"number":93,"title":"myocamlbuild does not work in a Cygwin environment when building for Windows","user":{"login":"martin-neuhaeusser","id":11831771,"avatar_url":"https://avatars.githubusercontent.com/u/11831771?v=3","gravatar_id":"","url":"https://api.github.com/users/martin-neuhaeusser","html_url":"https://github.com/martin-neuhaeusser","followers_url":"https://api.github.com/users/martin-neuhaeusser/followers","following_url":"https://api.github.com/users/martin-neuhaeusser/following{/other_user}","gists_url":"https://api.github.com/users/martin-neuhaeusser/gists{/gist_id}","starred_url":"https://api.github.com/users/martin-neuhaeusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin-neuhaeusser/subscriptions","organizations_url":"https://api.github.com/users/martin-neuhaeusser/orgs","repos_url":"https://api.github.com/users/martin-neuhaeusser/repos","events_url":"https://api.github.com/users/martin-neuhaeusser/events{/privacy}","received_events_url":"https://api.github.com/users/martin-neuhaeusser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-24T08:24:45Z","updated_at":"2015-06-24T08:24:45Z","closed_at":null,"body":"Hi all,\r\n\r\nwhen building camlp4 for Windows (using a Cygwin environment with the MSVC or mingw crosscompiler), the configuration fails:\r\n\r\n```\r\n$ make all\r\nocamlbuild -classic-display -no-ocamlfind  `./build/camlp4-byte-only.sh`\r\n+ echo camlp4/Camlp4.cmo camlp4/Camlp4Top.cmo camlp4/camlp4prof.byte.exe camlp4/mkcamlp4.byte.exe camlp4/camlp4.byte.exe camlp4/camlp4fulllib.cma camlp4/camlp4boot.byte.exe camlp4/camlp4boot.cma camlp4/camlp4r.byte.exe camlp4/camlp4r.cma camlp4/camlp4rf.byte.exe camlp4/camlp4rf.cma camlp4/camlp4o.byte.exe camlp4/camlp4o.cma camlp4/camlp4of.byte.exe camlp4/camlp4of.cma camlp4/camlp4oof.byte.exe camlp4/camlp4oof.cma camlp4/camlp4orf.byte.exe camlp4/camlp4orf.cma camlp4/Camlp4Parsers/Camlp4AstLoader.cmo camlp4/Camlp4Parsers/Camlp4DebugParser.cmo camlp4/Camlp4Parsers/Camlp4GrammarParser.cmo camlp4/Camlp4Parsers/Camlp4ListComprehension.cmo camlp4/Camlp4Parsers/Camlp4MacroParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.cmo camlp4/Camlp4Parsers/Camlp4OCamlParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlParserParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlReloadedParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.cmo camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.cmo camlp4/Camlp4Parsers/Camlp4QuotationCommon.cmo camlp4/Camlp4Parsers/Camlp4QuotationExpander.cmo camlp4/Camlp4Printers/Camlp4AstDumper.cmo camlp4/Camlp4Printers/Camlp4AutoPrinter.cmo camlp4/Camlp4Printers/Camlp4NullDumper.cmo camlp4/Camlp4Printers/Camlp4OCamlAstDumper.cmo camlp4/Camlp4Printers/Camlp4OCamlPrinter.cmo camlp4/Camlp4Printers/Camlp4OCamlRevisedPrinter.cmo camlp4/Camlp4Filters/Camlp4AstLifter.cmo camlp4/Camlp4Filters/Camlp4ExceptionTracer.cmo camlp4/Camlp4Filters/Camlp4FoldGenerator.cmo camlp4/Camlp4Filters/Camlp4LocationStripper.cmo camlp4/Camlp4Filters/Camlp4MapGenerator.cmo camlp4/Camlp4Filters/Camlp4MetaGenerator.cmo camlp4/Camlp4Filters/Camlp4Profiler.cmo camlp4/Camlp4Filters/Camlp4TrashRemover.cmo\r\nmkdir 'C:\\cygwin64\\home\\z002rwsm\\tools\\ocaml-libs\\camlp4\\camlp4-4.02\\_build'\r\n''C:/ocamlmgw/bin/ocamlopt.opt unix.cmxa -I 'C:/ocamlmgw/lib\\ocamlbuild' 'C:/ocamlmgw/lib\\ocamlbuild/ocamlbuildlib.cmxa' myocamlbuild_config.ml myocamlbuild.ml 'C:/ocamlmgw/lib\\ocamlbuild/ocamlbuild.cmx' -o myocamlbuild.exe\r\nmkdir camlp4\r\nmkdir camlp4/Camlp4\r\nmkdir camlp4/boot\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/boot/camlp4boot.ml > camlp4/boot/camlp4boot.ml.depends\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/boot/Camlp4.ml > camlp4/boot/Camlp4.ml.depends\r\nmkdir camlp4/config\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/config/Camlp4_config.mli > camlp4/config/Camlp4_config.mli.depends\r\nmkdir camlp4/import\r\n''cp C:/ocamlmgw/lib/compiler-libs/warnings.cmi camlp4/import/warnings.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/location.cmi camlp4/import/location.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/longident.cmi camlp4/import/longident.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/asttypes.cmi camlp4/import/asttypes.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/parsetree.cmi camlp4/import/parsetree.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/outcometree.cmi camlp4/import/outcometree.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/oprint.cmi camlp4/import/oprint.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/toploop.cmi camlp4/import/toploop.cmi\r\n''cp C:/ocamlmgw/lib/compiler-libs/topdirs.cmi camlp4/import/topdirs.cmi\r\n''C:/ocamlmgw/bin/ocamlc.opt -c -g -w Z -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4 -o camlp4/config/Camlp4_config.cmi camlp4/config/Camlp4_config.mli\r\n''C:/ocamlmgw/bin/ocamlc.opt -c -g -w a -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4/boot -o camlp4/boot/Camlp4.cmo camlp4/boot/Camlp4.ml\r\n''C:/ocamlmgw/bin/ocamlc.opt -c -g -w a -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4/boot -o camlp4/boot/camlp4boot.cmo camlp4/boot/camlp4boot.ml\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/config/Camlp4_config.ml > camlp4/config/Camlp4_config.ml.depends\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/config/gen_import.ml > camlp4/config/gen_import.ml.depends\r\n''C:/ocamlmgw/bin/ocamlc.opt -c -g -w Z -I +compiler-libs -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4 -o camlp4/config/gen_import.cmo camlp4/config/gen_import.ml\r\n''C:/ocamlmgw/bin/ocamlc.opt dynlink.cma -g -I +compiler-libs ocamlcommon.cma camlp4/config/gen_import.cmo -o camlp4/config/gen_import.byte\r\n''cp -p camlp4/config/gen_import.byte camlp4/config/gen_import.byte.exe\r\n''camlp4/config/gen_import.byte.exe C:/ocamlmgw/lib\r\n''C:/ocamlmgw/bin/ocamldep.opt -modules camlp4/config/Camlp4_import.ml > camlp4/config/Camlp4_import.ml.depends\r\n''C:/ocamlmgw/bin/ocamlc.opt -c -g -w Z -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4 -o camlp4/config/Camlp4_import.cmo camlp4/config/Camlp4_import.ml\r\n''C:/ocamlmgw/bin/ocamlopt.opt -c -g -w Z -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4 -o camlp4/config/Camlp4_import.cmx camlp4/config/Camlp4_import.ml\r\n''C:/ocamlmgw/bin/ocamlopt.opt -c -g -w Z -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4 -o camlp4/config/Camlp4_config.cmx camlp4/config/Camlp4_config.ml\r\n''C:/ocamlmgw/bin/ocamlopt.opt -c -g -w a -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4/boot -o camlp4/boot/Camlp4.cmx camlp4/boot/Camlp4.ml\r\n''C:/ocamlmgw/bin/ocamlopt.opt -c -g -w a -I camlp4/import -warn-error A-3 -I camlp4/config -I camlp4/boot -o camlp4/boot/camlp4boot.cmx camlp4/boot/camlp4boot.ml\r\n''C:/ocamlmgw/bin/ocamlopt.opt dynlink.cmxa -g camlp4/config/Camlp4_import.cmx camlp4/config/Camlp4_config.cmx camlp4/boot/Camlp4.cmx camlp4/boot/camlp4boot.cmx -o camlp4/boot/camlp4boot.native\r\n''C:/ocamlmgw/bin/ocamldep.opt -pp ''''camlp4\\boot\\camlp4boot.native' -D OPT' -modules camlp4/Camlp4/Debug.mli > camlp4/Camlp4/Debug.mli.depends\r\nDer Befehl \"camlp4bootcamlp4boot.native\" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\nFile \"camlp4/Camlp4/Debug.mli\", line 1:\r\nError: Error while running external preprocessor\r\nCommand line: camlp4bootcamlp4boot.native -D OPT \"camlp4/Camlp4/Debug.mli\" > C:\\cygwin64\\tmp\\ocamlpp4715dd\r\n\r\nExit code 2 while executing this command:\r\n  ''C:/ocamlmgw/bin/ocamldep.opt -pp ''''camlp4\\boot\\camlp4boot.native' -D OPT' -modules camlp4/Camlp4/Debug.mli > camlp4/Camlp4/Debug.mli.depends\r\nMakefile:13: die Regel für Ziel „byte“ scheiterte\r\nmake: *** [byte] Fehler 2\r\n```\r\n\r\nThe bug stems from a wrong use (actually, missing) path separators on Windows.\r\nIf line 89 of the myocamlbuild.ml script is changed to include path separators as follows:\r\n```\r\n\"\\\"camlp4\"/\"boot\"/exe ^ \"\\\"\"\r\n```\r\nthe compile succeeds.\r\n\r\nNote: I am not sure whether this modification breaks the build process on other platforms."}}