News for hackers. Stuff that matters.
Re:OCaml Workshop 2020 Online Conference is live now by avsm on Friday August 28, 2020 @09:19AM (#24304473)
This is indeed on our development list for this winter to integrate more. Over in MirageOS (mirage.io), we've been working hard on getting RISC-V support in shape, so we can build unikernels for bare metal embedded devices with a simple "dune build @riscv-solo5".

As part of that work, a few things are going on:

- use "dune workspaces" (essentially a cross compilation context) to build all C bindings in OCaml packages with custom CFLAGS/LDFLAGS. Ongoing work here: https://github.com/mirage/mirage/pull/1153

- upstream in OCaml, the core developers have specced out the design for integrating cross-compilation more naturally into the compiler.

- OCaml 4.11.0 has just been released with a native code RISC-V backend (and of course has had ARM for years).

Mirage doesn't really use OpenEmbedded or Yocto, but I expect it should be straightforward to embed the workflow in there once it's stable upstream in Mirage itself. Any pointers to something I should read about how to get involved in Yocto?

Re:OCaml Workshop 2020 Online Conference is live now by transpute on Friday August 28, 2020 @10:43AM (#24305453)
There's a non-upstream OpenEmbedded layer for building OCaml components, but it jumps through hoops to coordinate OCaml toolchain with upstream OE releases, https://github.com/OpenXT/meta-openxt-ocaml-platform

This could be generalized to create an upstream OE layer that uses the upcoming cross-compiling improvements from upstream Ocaml, which would then enable MirageOS unikernels in OE meta-virtualization, https://layers.openembedded.org/layerindex/branch/master/lay.... RISC-V support is in early stages for meta-virt, Western Digital added some support.

Intro to meta-virt: https://youtube.com/watch?feature=emb_title&v=fIbWvrlWJYg

Intro to Yocto: https://elinux.org/images/a/a8/Getting_Started_with_Embedded...

Meta-virt mailing list would be a good place for discussion, https://lists.yoctoproject.org/g/meta-virtualization

Re:OCaml Workshop 2020 Online Conference is live now by avsm on Friday August 28, 2020 @12:07PM (#24306568)
Very handy, thanks. I notice that the openxt-ocaml-platform repo uses ocamlbuild/ocamlfind. Life should get a lot easier when we move that to use ocaml/dune directly -- cross-compilation really needs a lot of help from the build system, and dune is moving fast to support these workflows.
Re:OCaml Workshop 2020 Online Conference is live now by transpute on Friday August 28, 2020 @01:08PM (#24307309)
Hopefully there can be a way to use ocaml/dune directly without importing "everything" into each per-component build tree. OE best practices employ per-recipe sysroots for building each component, where a minimal set of dependencies is present for the build environment. This helps with reproducible builds and generation of manifests for supply chain integrity.
Re:OCaml Workshop 2020 Online Conference is live now by avsm on Friday August 28, 2020 @02:53PM (#24308628)
Yes that should be fine. For incremental installation, there is a `dune build -x` which builds using a particular cross-compilation toolchain. MirageOS builds everything in one go, but it can be broken up too (as opam itself does).