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

New release of js_of_ocaml breaks picos.thread #332

Closed
hhugo opened this issue Nov 24, 2024 · 2 comments · Fixed by #333
Closed

New release of js_of_ocaml breaks picos.thread #332

hhugo opened this issue Nov 24, 2024 · 2 comments · Fixed by #333

Comments

@hhugo
Copy link
Contributor

hhugo commented Nov 24, 2024

The new release of jsoo ocaml/opam-repository#26932 breaks picos.thread on ocaml < 5 because it no longer exports a caml_ml_domain_id runtime value on ocaml < 5.
I don't rely understand why picos is build with ocaml 4.

Is it ok to apply the following patch to thread.ocaml4.js ?

//Provides: caml_thread_self
//Requires: caml_ml_domain_id, caml_failwith, caml_thread
function caml_thread_self(unit) {
-   if (caml_ml_domain_id(unit) != caml_thread[1])
-    caml_failwith('caml_thread_self: spawning of domains is not supported')
  return caml_thread
}
polytypic added a commit that referenced this issue Nov 24, 2024
polytypic added a commit that referenced this issue Nov 24, 2024
@polytypic
Copy link
Collaborator

polytypic commented Nov 24, 2024

I don't rely understand why picos is build with ocaml 4.

Generally speaking Picos fully supports OCaml 4. One can use systhreads (i.e. the Thread module) in OCaml 4 and then run Picos fibers on systhreads. As long one doesn't use large numbers of fibers, it is entirely possible to write programs than can be built and run fine both with OCaml 4 and OCaml 5. The main intention behind this, of course, is to potentially help with porting applications to OCaml 5.

Is it ok to apply the following patch to thread.ocaml4.js ?

Hmm... Yes... I think we should also trim the Requires, but otherwise I think it should be fine.

Does #333 look good to you?

And thanks for opening the issue!

@polytypic polytypic linked a pull request Nov 24, 2024 that will close this issue
@hhugo
Copy link
Contributor Author

hhugo commented Nov 25, 2024

Your PR looks good.

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

Successfully merging a pull request may close this issue.

2 participants