swaywm / wlroots-ocaml

OCaml bindings to wlroots [experimental]
GNU Lesser General Public License v2.1
25 stars 9 forks source link

Fix some build problems #2

Closed talex5 closed 4 years ago

talex5 commented 4 years ago

Error was:

In file included from types_stubgen.c:4:
/usr/include/wlr/backend.h:6:2: error: #error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
    6 | #error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
      |  ^~~~~

Note: the project still doesn't build, due to other upstream API changes. I don't know how to fix those. Would be good to enable CI for this repository.

Armael commented 4 years ago

Thanks a lot for the PR. As I was mentioning in https://github.com/swaywm/wlroots-ocaml/pull/3 , note that the project is in a somewhat dormant state right now, but I'll see what I can do for the other build failures today.

Armael commented 4 years ago

Everything now build in master, and I made some progress on porting the examples (examples/simple.ml is now complete).

I do agree that it would be really nice to add CI to the repository, in particular CI triggered on updates in wlroots, so that we know when the bindings become outdated. However I have no experience doing that (or doing CI for ocaml projects in fact). Would you be able to help with this maybe? Or if you just have a couple pointers that would be very fine as well.

talex5 commented 4 years ago

I'd suggest:

  1. Add a conf-wlroots.opam package with a depext on the wlroots package of at least one platform (e.g. fedora).
  2. Add https://github.com/apps/ocaml-ci to https://github.com/swaywm, enabled for just this repository. ocaml-ci is experimental, but I can add swaywm to list of alpha testers if you want to try it.

Alternatively, you could set up Travis with e.g. https://github.com/ocaml/ocaml-ci-scripts/blob/master/README-travis.md - that's more mature, but usually takes much longer to run because it does no caching.

Armael commented 4 years ago

Thanks! Let's try to use ocaml-ci then.

A couple more questions:

talex5 commented 4 years ago

Yes, you can put conf-wlroots.opam in here too.

For unreleased dependencies, I normally use git submodule add .... The CI will use git clone --recursive to get them too, and will opam pin any *.opam files it finds.

Armael commented 4 years ago

OK, thanks.

Just to be clear: what I thought would be useful is that the CI would trigger not only on new commits for the wlroots-ocaml repository, but also on new commits on the main wlroots repository. This way, I would know when I need to update the bindings because of changes upstream. Is it something that's possible?

Then I guess the conf-wlroots package would have to contain instructions for building wlroots from source...?

Armael commented 4 years ago

(it might be worth noting that AFAIK wlroots/sway has its own CI system, that could be worth using if that is simpler)

talex5 commented 4 years ago

Yes, good point. Probably best to use the same CI as the rest of the project, indeed.