-
Notifications
You must be signed in to change notification settings - Fork 7
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
Should the script be recompiled if any "Ocaml.sources" file is changed? #2
Comments
Yes, that would be a good thing. The problem in the current design is that it relies on checking file modification timestamps before doing anything expensive; and launching The steps are essentially:
Some benchmarking would help but in my mind step 1 is very fast, step 2 can be fast if there's no need to write files, and step 3 is slow. The list of extra sources specified by the OCaml variable Assuming that running |
Thanks for the detailed notes. I'll have a go at prototyping something when I get a bit more free time. |
Oh and thanks for creating this project -- it's very useful! |
Hello, First thank you for this great project. I'm sorry to rise this old issue, but I would love to see this feature created. Indeed I don't think that the time problem is really relevant because someone that wants to use a fast program would compile it with oasis or something like this, there are few reasons to use Ocamlscript for that work. But ocamlscript is usefull when you want to give the priority to usability instead of speed. Any idea to solve this bug ? Thank you, Tobias. |
Changing a module that the script depends on does not cause recompilation of the OCamlscript script. This is a known issue with OCamlscript[1] and this patch works around this by unlinking the auto-generated binary after it has finished executing its main Lwt thread. [1]: ocaml-community/ocamlscript#2 Signed-off-by: Si Beaumont <[email protected]>
Changing a module that the script depends on does not cause recompilation of the OCamlscript script. This is a known issue with OCamlscript[1] and this patch works around this by unlinking the auto-generated binary after it has finished executing its main Lwt thread. [1]: ocaml-community/ocamlscript#2 Signed-off-by: Si Beaumont <[email protected]>
this should be labelled as a bug |
I'm taking a look at old issues to evaluate what should be done if we decided to give ocamlscript a second life. For this particular issue, I'm leaning toward not running
|
Maybe, dune should provide a one-liner invocation, where you just want an executable for a given ocaml file which doesn't have any dune nor opam file (ocamlbuild could do that IIRC, obuild too). |
I've been writing some scripts which share some common code in a separate module. When I edit the script itself and run it, the code is recompiled as expected. When I edit the separate module and run the script again, it is not recompiled and the old code runs instead. I was hoping it would magically notice that the separate module had changed and recompile, like traditional scripting languages would. (I'm trying to encourage people used to python to try this)
The text was updated successfully, but these errors were encountered: