mirage / mirage-solo5

Solo5 core platform libraries for MirageOS
ISC License
20 stars 21 forks source link

Update to new Solo5 "manifest"-style APIs #46

Closed mato closed 5 years ago

mato commented 5 years ago

Update to Solo5 0.6.0 APIs, support multiple devices. This breaks downstream APIs.

Part of mirage/mirage#992.

hannesm commented 5 years ago

looking at the travis failures, it seems to install solo5-bindings-genode (opam's solver seems to prefer them) in all cases (which should be fine -- the EXTRA_DEPS is iirc evaluated later (and leads to another build step)). now, genode-solo5 passes slightly different CFLAGS via pkg-config to its consumers: other bindings use PC_CFLAGS, which expands in Makefile.common to -ffreestanding -fstack-protector-strong $(MAKECONF_CFLAGS)

genode uses PC_GENODE_CFLAGS := $(GENODE_APP_CFLAGS), which GENODE_APP_CFLAGS := $(CFLAGS) -fPIC -- and CFLAGS := -std=c11 -Wall -Wextra -Werror -O2 -g CFLAGS += -ffreestanding -fstack-protector-strong $(MAKECONF_CFLAGS) -- which results in -Werror (and others) being passed to the consumers (and our vendored openlibm is not compiling fine with -Werror).

I'd suggest to revise the PC_GENODE_CFLAGS, and avoid passing -Werror down the chain.

mato commented 5 years ago

Ah, thanks for tracking down where the '-std=c11' is coming from. I'll fix that, will need a new Solo5 release. The dependency issue -'ve been discussing on Slack, I think EXTRA_DEPS is not working as intended in the OCaml CI scripts.

mato commented 5 years ago

OK, so this is all green now, but if you look at what Travis is actually doing in the build jobs for https://travis-ci.org/mirage/mirage-solo5/builds/588617921?utm_source=github_status, EXTRA_DEPS is not being used and OPAM is always picking solo5-bindings-hvt in this instance.

@samoht @talex5 Any ideas?

samoht commented 5 years ago

I think it's fine as the extra deps are installed after the initial dependencies:

The following actions will be performed:
  ⊘ remove    solo5-bindings-hvt 0.6.2 [conflicts with solo5-bindings-spt]
  ∗ install   solo5-bindings-spt 0.6.2
  ↻ recompile ocaml-freestanding 0.4.7 [uses solo5-bindings-spt]

This is probably sub-optimal but that seems to work ok.

I would also advise to add a PACKAGE=mirage-solo5 entry in the global travisCI section so that opam pin pins the packages with the right name.

mato commented 5 years ago

This is probably sub-optimal but that seems to work ok.

Thanks, it'll do for now. It does make the CI runs somewhat non-deterministic if there is a single variant that fails and it's not the one initially picked by OPAM.

I would also advise to add a PACKAGE=mirage-solo5 entry in the global travisCI section so that opam pin pins the packages with the right name.

Done.