-
Notifications
You must be signed in to change notification settings - Fork 25
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
Port build system to jbuilder + configurator #6
Conversation
Away from oasis
Hello @rgrinberg . I don't know jbuilder very much. Does jbuilder allow to compile with any version of OCaml compiler? Do we absolutely need jbuilder to build binary from source or is it possible to release a tarball containing cryptokit sources plus whatever is produced by jbuilder to build from source? @xavierleroy : I don't have much opinion on this pull request. From a SW engineering point of view it adds one or more dependencies which always make the software more complex. But on the other side it is only a build dependency. And jbuilder might be the way to go, I don't follow OCaml ecosystem closely enough to have a meaningful opinion. I haven't tried the patch, let me know if you want me to do some tests. Best regards, |
Jbuilder officially supports OCaml >= 4.02.3. I'm pretty sure you could use jbuilder to compile against older versions of OCaml, but you'd need a precompiled version of jbuilder. I think it's pretty difficult to support anything older and -safe-string at the same time, so it's a valid lower bound IMO.
This isn't possible unfortunately. But note that using jbuilder doesn't increase the number of build tools - it decreases them. Currently, cryptokit needs both ocamlfind and ocamlbuild to build, and jbuilder makes both of those redundant. It's true that configurator brings in a bigger build time profile, but it's an orthogonal change that can be avoided. I'll simply have to parse |
I agree to get rid of Oasis for Cryptokit, but replacing it with jbuilder feels like going from an already complicated system that I don't fully understand to a very complicated system that I don't understand at all. For small libraries such as Cryptokit, what's wrong with a Makefile and a configure shell script? |
You can get started with a makefile quite easily, but I've never seen a makefile that covers all the needs of packaging an OCaml library. Here's a non exhaustive list of common omissions:
All in all, you can see that I'm skeptical of just using Makefiles. To the point where I'd even suggest to stick to the oasis status quo which at least addresses some of my points above. However, while jbuilder itself might not be so simple internally, it does free up quite a bit of complexity when defining the build for a package - just look at how much auto generated crap as been deleted in this PR. So if you'd like to maintain a Makefile based build system as well, I think there's nothing wrong with that. But for installing cryptokit through opam, jbuilder will give users a much better user experience. Site note: jbuilder is already the most popular build system by a fairly wide margin on opam today. Despite being so much younger than other contenders. Obviously I don't have an unbiased opinion here, and this isn't a popularity contest, but there are many others who are convinced that jbuilder solves many of these problems for them. |
I have tried many build systems for OCaml and it is true that jbuilder is not bad. Plus, at least there is some well funded manpower behinds it. Which is quite good for a component so critical to the whole OCaml user community... Plus, its development looks more open than other things from Janestreet. |
Note that the latest version of configurator gets rid of all the ppx build time dependencies. I don't think there's a reason to get rid of configurator anymore. |
One thing I've noticed in RWO's builds (that use Cryptokit as an example library) is that:
The incorrect /opt/local/lib warning possibly comes from the existing Makefile doing something wrong on OSX. https://dev.realworldocaml.org/14-command-line-parsing.html#running-basic-commands |
Why was this closed? |
This has a number of benefits:
$ make doc
)The only disadvantage here is that we're bringing in some extra build time dependencies from configurator. However, the dependency profile of configurator will be reduced. And of course build time dependencies shouldn't matter to the vast majority of users.