-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ocamlfind by default #48
Comments
I'm open to pull requests implementing this feature. Note that the problem with PR#5547 never was that ocamlbuild was distributed with the compiler. The issue was that we tried to make This means work to ensure a smooth transition, though. I won't have time in the near future to handle it myself; if you want to push forward, please feel welcome to. |
Note that this makes |
The default configuration of ocamlbuild would generate calls to ocamlfind, whereas it currently does not. ocamlbuild would remain fully functional in absence of ocamlfind, you would just have to pass |
But then if you do |
@gasche Is it important to support (a) ocamlbuild without the presence of ocamlfind or (b) without invoking ocamlfind? If it's (a) then we run into the user experience problem @dbuenzli points out. If it's (b) then ocamlbuild should depend on ocamlfind, at least within opam, if |
I don't know, we should ask our no-ocamlfind users ( cc @avsm ? ). I would guess that, as you remark, requiring ocamlfind to be installed is okay. On the other hand, this is purely a packaging issue, not an ocamlbuild-development issue; for example, it may be possible to propose ocamlfind as an optional dependency, or to have some kind of virtual "ocamlfind or explicit opt-out" package to depend on. The user experience I have in mind would be to simply print "please use The problem we must solve is making sure that people that do not explicitly wish to use ocamlbuild without ocamlfind do not end up in that situation by chance. One easy solution to this problem is to have the default user-facing switches in OPAM install ocamlfind by default. |
I think that the tool behaviour should stay as it is now, with the However what should change is that |
Are you suggesting that using |
Would it make sense to have an optional configuration file for ocamlbuild that would specify whether ocamlfind is to be used? 90% of the use-cases will involve using ocamlfind, so why not make it easy for it to be the default? |
Argh no. This would select the actual compiler binaries depending on whether your
I think build systems should go in that direction and avoid the ocamlfind indirection for the compiler tools themselves. The number of logical names and tool indirections we have in the system at the moment is insane and we should aim at taking steps at simplifying this in general.
The problem is that In any case, the current status quo seems good enough and I would wait for the cross-compilation support landing at the |
I feel that we should be very prudent about changing default behaviors; for this reason, despite the fact that I personally feel making In the grand scheme of things I see your point about avoiding tool entanglement, but in the short to medium term I don't want to pay the price of developing and maintaining a robust ocamlbuild-level logic to replace what we have now. It was tried previously and it was worse than the current state -- it's hard to do well, as it seems you know even better than I do. |
@bluddy You can enable ocamlfind with this line in your let () = Ocamlbuild_plugin.Options.use_ocamlfind := true If the longer term goal is to either rework or rethink how ocamlfind is used I'm ok with that approach too. Feel free to close this issue if that's the case. |
@hcarty note that it would be more robust to set this setting from inside a hook, at either the Intuitively I feel that it would be better for everyone to not ask for any explicit mention of |
For people who just want to build their code easily, is juggling |
@dbuenzli: Is there a reason we can't just use pkg-config for ocaml projects? |
pkg-config is not really appropriate. It does not know, for example, about the OCaml linking semantics, or preprocessors. This would also be an incredibly intrusive change. |
Closing this in favor of the duplicate #214 where the discussion is (for now) more focused on the default issue. (Plus I'm embarrassed by the discussion I started on "magically setting use-ocamlfind if |
MPR discussion: http://caml.inria.fr/mantis/view.php?id=5547
Now that ocamlbuild is being developed and distributed separately from the compiler it would be nice to make this change.
The text was updated successfully, but these errors were encountered: