-
Notifications
You must be signed in to change notification settings - Fork 197
Ocamlbuild to build the project #40
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
Conversation
|
(I'm not a js_of_ocaml contributor or anything, so I'm only giving a purely personal opinion here.) I'm impressed by the level of ocamlbuild expertise displaying in this myocamlbuild.ml. However, there is one small part where I think is going too far: the install/uninstall rule. Encoding them inside ocamlbuild is a clever trick, but I'm not sure it's actually a good idea on the long term. Indeed, while ocamlbuild systems can gain in concision and expressivity when compared to Makefile, they also require a more specialized skillset to maintain and modify, and this can be a barrier to user. I think it's important that the install/uninstall rules remain easy to tweak by non-project-expert, typically packagers for exotic systems you don't know about. So I would suggest that you keep using simple shell scripting in the Makefile for deploying the project on the system -- possibly at the cost of slightly more information duplication, I'm not sure I understand fully the move from in-makefile list of files to those That said, there have been some requests from users to have ocamlbuild help a bit with the "install" part of the project (not to do it itself, but help install tools do their work). See for example PR#6067 by Daniel Bünzli. I would be happy to have any feedback (or code/patch contribution) on these issues. |
|
Ocamlbuild seems kind of slow, though. |
|
The problem is: ocamlbuild is not able to parallelize :/ It's one of the defuncts of ocamlbuild but some people are working on it. |
|
Is this really possible ? Why does OASIS generates only byte files for syntax libraries. @gildor478 ? |
|
syntax extension is compiled like library, there is no reason it doesn't create .cmxs just as for library (i.e. native files for syntax libraries). But maybe the problem may be that camlp4o is will not use .cmxs ? (Never tried). |
|
Ok, it's compiled and installed, but not referenced in the META |
|
=> this is a bug (probably 1 line in the META plugin if you want to have a look, or open a bug) |
|
Ok, it's documented here, but it seems that |
|
What is the plugin predicate ? |
|
The |
|
OK, I was not sure about what you mean, concerning the plugin predicate. This is not documented in findlib, because it is not a standard predicate. Look at oasis/src/ext/plugin-loader/src/PluginLoad.ml line 148. The idea was to have something like toploop but for plugin and I use the generic framework offered by findlib to use it. Look at the initial mailing list message: The followup on this work is to ping Gerd to include this kind of plugin loading with the camlp4o syntax flag for findlib. (this will give you access to native plugin + native version of camlp4). |
|
it seams that ocamlbuild doesn't handle native camlp4 syntax extensions correctly. I use to wrap camlp4 calls with a script that either call camlp4/camlp4o/camlp4o.opt/camlp4r/camlp4r.opt/.. depending on whether native versions of libs are available. (hiding camlp4 binary using PATH env variable) I don't know how hard it would be to fix ocamlbuild. (one try here ocaml/ocaml@655cf17) |
|
@vouillon, would you consider merging this after the INSTALL is fixed/cleaned ? |
|
I don't really care. So, if you think this is an improvement, just go ahead and merge this. |
|
@hhugo do you plan to make the switch to oasis after merging ? |
|
I don't know. I could switch to oasis BEFORE the merge, so I don't have to rewrite the installation part. |
libfiles
|
I've a commit to switch to to oasis hhugo@2791cdb (need more test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware that this function is not tail-recursive and will fail on big files. I would argue that the imperative style alternative is better:
let lines = ref [] in try
while true do lines := input_line ic :: !lines; done; assert false
with End_of_file -> List.rev !lines
|
updated version available here |
review are welcome