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

unbound value receive_any () #58

Open
vincentaxhe opened this issue Oct 10, 2024 · 4 comments
Open

unbound value receive_any () #58

vincentaxhe opened this issue Oct 10, 2024 · 4 comments

Comments

@vincentaxhe
Copy link

I know little about ocaml, and just moved from go 'bubbletea', ocaml simple syntax attracted me.
But I enter every example subfolder, and run 'dune bulid' always failed for same error

File "minttea/io_loop.ml", line 49, characters 10-21:
49 |   let _ = receive_any () in
               ^^^^^^^^^^^
Error: Unbound value receive_any

I have installed minttea and Leaves by opam, why can't build smoothly like go 'bubbletea' examples, give anyone who tries a bit sweet to taste first.

@woeps
Copy link

woeps commented Oct 17, 2024

I think receive_any got introduced in riot@0.0.9. While the dune-project file references 0.0.9, minttea.opam references 0.0.8:

(riot (>= "0.0.9"))

"riot" {= "0.0.8"}

I got the "tutorial" code described in the readme compiling (which is also a temporary solution to #54):

  • pin to riot 0.0.9: opam pin add riot 0.0.9
  • pin to github main branch of minttea: opam pin add minttea git@github.com:leostera/minttea.git
  • pin edit minttea: change riot dependency to 0.0.9

@vincentaxhe
Copy link
Author

vincentaxhe commented Oct 17, 2024

I git pull, no updates.
then edit minttea/minttea.opam "riot" {= "0.0.8"}, and go to example/list, and run 'dune build', same error.
then run opam pin add riot 0.0.9 sucessfully, and run dune build again,

Entering directory '/home/vincent/disk/Codes/Ocaml/minttea'
File "minttea/dune", line 4, characters 12-16:
4 |  (libraries riot tty))
                ^^^^
Error: Library "riot" not found.
-> required by library "minttea" in _build/default/minttea
-> required by executable main in examples/list/dune:2
-> required by _build/default/examples/list/main.exe
-> required by alias examples/list/all
-> required by alias examples/list/default

then run opam install riot, got

he following actions will be performed:
=== install 2 packages
  ∗ gluon 0.0.9          [required by riot]
  ∗ riot  0.0.9 (pinned)

Proceed with ∗ 2 installations? [y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved gluon.0.0.9  (cached)
[ERROR] The compilation of gluon.0.0.9 failed at "dune build -p gluon -j 7
        @install".

#=== ERROR while compiling gluon.0.0.9 ========================================#
# context     2.2.1 | linux/x86_64 | ocaml.5.2.0 | https://opam.ocaml.org#ac01ad6037c0bdcca9f67fe49cd54475b585f9b2
# path        ~/sdisk/Ocaml/opam/default/.opam-switch/build/gluon.0.0.9
# command     ~/sdisk/Ocaml/opam/opam-init/hooks/sandbox.sh build dune build -p gluon -j 7 @install
# exit-code   1
# env-file    ~/sdisk/Ocaml/opam/log/gluon-290934-66ab60.env
# output-file ~/sdisk/Ocaml/opam/log/gluon-290934-66ab60.out
### output ###
# File "gluon/sys/unix/dune", line 11, characters 41-57:
# 11 |   (names gluon_unix_io gluon_unix_kqueue gluon_unix_epoll)
#                                               ^^^^^^^^^^^^^^^^
# (cd _build/default/gluon/sys/unix && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -pthread -g -fno-omit-frame-pointer -fPIC -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/ocaml/src=/usr/src/debug/ocaml[...]
# gluon_unix_epoll.c: 在函数‘gluon_unix_epoll_ctl’中:
# gluon_unix_epoll.c:73:20: 错误:assignment to ‘uint64_t’ {或称 ‘long unsigned int’} from ‘value *’ {或称 ‘long int *’} makes integer from pointer without a cast [-Wint-conversion]
#    73 |     event.data.u64 = ocaml_value;
#       |                    ^



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build gluon 0.0.9
└─
╶─ No changes have been performed

install failed.
can not run opam pin add minttea git@github.com:leostera/minttea.git

@woeps
Copy link

woeps commented Oct 18, 2024

I'm not sure about this error. Are you using ocaml >= 5.1?

Check with ocaml --version or opam switch list.

@vincentaxhe
Copy link
Author

The OCaml toplevel, version 5.2.0 on Arch.
If it's selfsustained will be better I think, though I know little about how ocaml works, but it give me an impression tui project written by ocaml is rough after I view some other projects in github.
But for a tui infrastructure, examples can be compiled is not a high request.

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

No branches or pull requests

2 participants