-
Notifications
You must be signed in to change notification settings - Fork 11
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
Modularise Olly #43
Modularise Olly #43
Conversation
- Minimise the number of arguments being passed around, improving clarity - Add (currently unused) `runtime_counter`
Thanks @eutro. Do you have a reviewer in mind already? |
Make olly_gc_stats and olly_format_fuchsia (optional) - These are built anyway for the full olly package, but have unavailable dependencies on olly_bare Clean up dune-project
The dependency on For outstanding work, #40 is trivial to update. I started an implementation of #41 for Unix but haven't finished it. How to implement that on Windows I am not sure. |
eio-trace has its own minimal library for fuchsia support: https://github.com/ocaml-multicore/eio-trace/tree/main/fxt It does use |
This PR splits the single monolithic
bin/olly.ml
file into several separate libraries, (olly_common
,olly_trace
,olly_gc_stats
), as well as abstracting and modularising the trace formats ofolly_trace
. Other changes are:runtime_events_tools_bare
which builds the newbin/olly_bare.exe
, which depends only onocaml
,dune
, andcmdliner
(omittinggc-stats
andtrace --format=fuchsia
).trace --format=json
now logs customint
(as counter) andunit
(as instant) events, as they are with--format=fuchsia
The benefits are:
tracing
, which transitively depends on many other packages, which aren't portable to trunk builds of OCaml, nor to Windows.olly_bare
, builds with onlydune
andcmdliner
as dependencies; these can be installed without Opam.olly_bare
on trunk or Windows can be done by just installing OCaml and Dune, then addingcmdliner
as a git submodule, and runningdune build bin/olly_bare.exe
Unix
on Windows handles PIDs (asHANDLE
s casted toint
), which is incompatible withRuntime_events
needing real PIDs; the potential fixes aren't difficult, involving aGetProcessId
somewhere (though PIDs should also just be handled better by core OCaml on Windows, it shouldn't be on the user to hack around it, e.g. win32unix: cannot kill and wait for arbitrary processes ocaml/ocaml#11021)Potential issues are:
I am looking for feedback with whether this is desirable overall, as well as with the specific approach I took, since I am largely unexperienced with Dune as a build system, and with OCaml's ecosystem. For instance, the statically-linked minimal-
olly_bare
/full-olly
approach is somewhat unsatisfying due to inflexibility (e.g. to includegc-stats
without--format=fuchsia
, without changing Olly's code). It may be desirable, perhaps as future work, if the subcommands (and format backends) could instead be loaded dynamically, rather than linked statically.