Skip to content
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

Project status? #3

Open
wilhelmy opened this issue Mar 26, 2020 · 15 comments
Open

Project status? #3

wilhelmy opened this issue Mar 26, 2020 · 15 comments

Comments

@wilhelmy
Copy link

Hi, not an actual issue but I have no idea where else to ask questions about this project.

Just wondering, is this still alive? The organization overview says it was modified 27 days ago but I didn't see any recent commits...

@Armael
Copy link
Collaborator

Armael commented Mar 26, 2020

Hi! Thanks for your interest.

I believe the "27 days ago" refers to the currently opened pull request.
As for the current status of the project: this is an experiment that I started some time ago, and that I'd still like to pursue someday; however, I haven't had time to work on it for a while, and don't currently have that much time either.

That being said, I'd still think this is an interesting endeavor, that I hope I'll be able to pick up again at some point. There are several interesting problems to be solved here: for instance, it is not obvious at all what a nice and safe high-level API for wlroots should be (the current repo contains an attempt, but I think it needs to be reworked). See also for instance the difficulties that other people had when writing rust wrappers (http://way-cooler.org/blog/2019/04/29/rewriting-way-cooler-in-c.html).
Then, there's also the usual grunt work of writing the wrapper code itself.

And all of this only makes sense to in the end use the bindings to write a compositor (even a minimal one to start with), and coming up with something interesting is a project on its own.

So yeah, I guess the status is "experimental" and "hibernating" :-).

@wilhelmy
Copy link
Author

wilhelmy commented Mar 27, 2020

The reason I'm asking is because I'm interested in writing a compositor, but I can't promise I can deliver a good one because that would stress me out, and I also have to worry about work for now. Would it be possible to generate part of the bindings and write a nice ocaml'y interface on top of that?

Edit: You could try outsourcing some of this to a capable student via GSoC, perhaps.

@wilhelmy
Copy link
Author

I've seen some recent activity and became curious.

fukushima ~/s/wlroots-ocaml & dune external-lib-deps --missing '@@default'
Error: The following libraries are missing in the default context:
- xkbcommon
Hint: try: opam install xkbcommon
fukushima ~/s/wlroots-ocaml & opam install xkbcommon
[ERROR] No package named xkbcommon found.

Any ideas?

@Armael
Copy link
Collaborator

Armael commented Apr 21, 2020

Yeah, you should pin my (at the moment unreleased) xkbcommon bindings:

opam pin add xkbcommon https://github.com/Armael/ocaml-xkbcommon

But yeah, I've been doing some cleanup. Now everything should compile, and the API now corresponds to "thin bindings": it sticks to the wlroots API as much as possible while being type safe.
This should make it easy to translate C code that uses wlroots into ocaml code using the bindings, and then start experimenting.

Still, there is a lot of mechanical work to be done to be able to implement nontrivial examples on top of the bindings. In particular, I started porting tinywl, but it is not complete and needs more work extending the bindings. Any help with that is welcome :).

@wilhelmy
Copy link
Author

Hmmm... that doesn't work

fukushima ~/s/wlroots-ocaml & opam pin add xkbcommon https://github.com/Armael/ocaml-xkbcommon
Package xkbcommon does not exist, create as a NEW package? [Y/n] y
[xkbcommon.~dev] downloaded from https://github.com/Armael/ocaml-xkbcommon
[ERROR] Error getting source from https://github.com/Armael/ocaml-xkbcommon:
          - Unknown archive type: /tmp/opam-22413-1872ec/ocaml-xkbcommon

Thin bindings sound good. Building more ocaml-y bindings on top of that can always be done later. I'll take a more in-depth look and I'm aware that there's always mechanical work to be done for bindings. Thanks for your effort :)

@Armael
Copy link
Collaborator

Armael commented Apr 21, 2020

Ah, try:

opam pin add xkbcommon https://github.com/Armael/ocaml-xkbcommon.git

@wilhelmy
Copy link
Author

Thanks, that did the trick

@wilhelmy
Copy link
Author

Got a build failure now:

[wlroots.~dev] no changes from git+file:///home/mw/src/wlroots-ocaml#master
The following actions will be performed:
  - install wlroots ~dev*
[wlroots.~dev] synchronised from git+file:///home/mw/src/wlroots-ocaml#master

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of wlroots failed at "/home/mw/.opam/opam-init/hooks/sandbox.sh build dune build -p wlroots -j 3 @install".

#=== ERROR while compiling wlroots.~dev =======================================#
# context     2.0.6 | linux/x86_64 | ocaml-system.4.10.0 | pinned(git+file:///home/mw/src/wlroots-ocaml#master#9642b0f0)
# path        ~/.opam/default/.opam-switch/build/wlroots.~dev
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p wlroots -j 3 @install
# exit-code   1
# env-file    ~/.opam/log/wlroots-25534-dc6e87.env
# output-file ~/.opam/log/wlroots-25534-dc6e87.out
### output ###
# [...]
# File "_none_", line 1:
# Warning 58: no cmx file was found in path for module Time_unix, and its interface was not compiled with -opaque
#       ocamlc lib/generated_ffi_stubs.o (exit 2)
# (cd _build/default/lib && /usr/bin/ocamlc.opt -g -I /home/mw/.opam/default/lib/bytes -I /home/mw/.opam/default/lib/ctypes -I /home/mw/.opam/default/lib/integers -I /home/mw/.opam/default/lib/mtime -I /home/mw/.opam/default/lib/mtime/os -I /home/mw/.opam/default/lib/result -I /home/mw/.opam/default/lib/unix-errno -I /home/mw/.opam/default/lib/unix-time -I /home/mw/.opam/default/lib/xkbcommon -[...]
# generated_ffi_stubs.c: In function ‘wlroots_stub_24_wlr_renderer_init_wl_display’:
# generated_ffi_stubs.c:174:17: error: void value not ignored as it ought to be
#   174 |    _Bool x102 = wlr_renderer_init_wl_display(x100, x101);
#       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# generated_ffi_stubs.c: In function ‘wlroots_stub_25_wlr_keyboard_set_keymap’:
# generated_ffi_stubs.c:181:17: error: void value not ignored as it ought to be
#   181 |    _Bool x107 = wlr_keyboard_set_keymap(x105, x106);
#       |                 ^~~~~~~~~~~~~~~~~~~~~~~



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build wlroots ~dev
+- 
- No changes have been performed

@Armael
Copy link
Collaborator

Armael commented Apr 21, 2020

Do you have the latest version of wlroots (from their git)?

@wilhelmy
Copy link
Author

Nope, but I didn't know you're targeting their git master instead of release. I have 0.10.1. I can check with master later. (Maybe all this should go into README.md?)

@Armael
Copy link
Collaborator

Armael commented Apr 21, 2020

Yeah, all of this should definitely go in the readme. I think at targeted the release branch at some point, and ended up installing the git version for other purposes, and didn't checked whether it broke.

For now let's just say I target the git master yeah :/.

@wilhelmy
Copy link
Author

No worries, it's not like I'm expecting a finished product ;)

@wilhelmy
Copy link
Author

wilhelmy commented May 2, 2020

I'm messing around with it a little bit (I've never really used OCaml, only SML) and I'm stuck at writing a .merlin file for the tinywl subdir. Sorry to bum so much support off you, but I looked at the other .merlin files and there's numbers and underscores that I don't understand. Do you generate them somehow?

@Armael
Copy link
Collaborator

Armael commented May 2, 2020

Yeah you shouldn't have to write .merlin files by hand, dune generates them automatically. So if you build tinywl (dune build tinywl/tinywl.exe or just make examples) then that will generate the .merlin files, and merlin should provide you with type information.

@wilhelmy
Copy link
Author

wilhelmy commented May 2, 2020

Ah, I see. I assume it isn't being built because of the build failure with wlr_renderer_init_wl_display being void on release but bool on master. I'll try to fix that and see if it works afterwards. What's weird is that the other directories have .merlin files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants