Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamlbuild -use-ocamlfind does not work together with -ocamlc switch #6300
Original bug ID: 6300
it appears to be impossible to specify for example ocamlcp as the bytecode compiler when also ocamlfind is used
Steps to reproduce
cat "let _ = 3" > test.ml
compiles silently with ocamlc instead of ocamlcp
in the trivial test, findlib is not needed, but in the real example it was.
Comment author: @gasche
Fixed in 4.02@15114.
"ocamlbuild -use-ocamlfind -ocamlc FOO" now invokes "ocamlfind FOO" instead of "ocamlfind ocamlc" -- similarly for all -ocamlfoo flags that correspond to ocamlfind subcommands.
There is a subtlety in the timing of when various options are taken into accounts to set these things -- read the commit message for more details. The take-away is that if you want to set use_ocamlfind through the myocamlbuild.ml rather than through the command-line, you should do this at the Before_options dispatch time rather than later. This means that users may be able to override this setting using -no-ocamlfind (the plugin cannot override the command-line option if it's passed), but I don't think that is problematic.