ocaml / oasis

Cabal like system for OCaml
Other
124 stars 45 forks source link

setup.ml -build-byte #535

Open gildor478 opened 3 years ago

gildor478 commented 3 years ago

This feature request has been migrated from artifact #1378 on forge.ocamlcore.org. It was assigned to user102.

user116 posted on 2014-03-14 02:21:37:

Imagine large project built with CompiledObject: best in _oasis - because native code binaries are used for deployment. But during development it is much faster to build a bytecode target - this speeds up edit-compile-run cycle a lot. Unfortunately oasis makes it's choice at the configure state (whether to build byte or native binaries). So the proposal is to provide separate target to build bytecode binaries (without reconfiguring) regardless of what CompiledObject says. With ocamlbuild it is very easy - just change the invocation of ocamlbuild (actually I did that manually always, but nowadays I am using dynamic setup.ml and that won't work for obvious reasons).

user102 replied on 2014-03-14 07:45:41:

What about: ocaml setup.ml -configure --override is_native false

(I mean that is a solution that works with the current code).

user116 replied on 2014-03-14 10:52:13:

Yes, that works but it is an extra 1s delay...

user116 replied on 2014-03-14 10:54:28:

though probably sed -i 's/^is_native="true"$/is_native="false"/' setup.data will do

user102 replied on 2014-03-14 12:01:56:

You have to wait 1s for guessing is_native ? or to re-run ocaml-setup.ml --configure ?

Anyway, please remember the time it takes to run configure generated by autoconf -- we have a quite fast setup.ml with regard to this.

Although, this should be a 1 time setup when you are working on a project. So 1s is not big here.

Note that .cmxs generation is still buggy (don't know why) and is probably higher priority to fix to speedup compilation. I will also work on separating "-test" from "-build" to speedup generation of test (build only what is necessary to test, byte only if the test is byte only). That should probably offers you a good default options for edit-compile-test speed.