-
Notifications
You must be signed in to change notification settings - Fork 176
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
fix setting Lwt_process env on Windows #967
base: master
Are you sure you want to change the base?
Conversation
Thanks a lot for the MR. I don't have a windows machine to test this on so I can't reproduce locally. Nevertheless, I'll be reviewing this MR soon. |
i dunno if you can get CI to run on the first diff (1d199cd) but it'll show the bug. for example: https://github.com/mroch/lwt/actions/runs/3284275234/jobs/5410034604 I believe the |
I don't know either. I don't understand github's UI very well. ❓ ❗ But that's ok. When I do the review I might push a branch with just the first commit to force the CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this and fixing the bug. The code is semantically identical to OCaml's Unix
library, so I think this is good to go.
https://github.com/ocaml/ocaml/blob/c6d207656de19d97b5edf5c2f9028412aa218571/otherlibs/unix/createprocess.c#L120-L131
At first I was pleased that the code was so similar. I'll ask if it's ok. Basically, the added code is calling the functions provided by the ocaml project in the appropriate sequence. I think the alternative to using the same code is making a pull-request on the ocaml project to provide this sequence of calls as a function itself to be called. That might not be desirable upstream anyway… Anyway, I'll ask. |
A similar situation happened on the eio bugtracker: It's not exactly the same (not the same code being copied, not the same size of code) but it's also copying parts of the C code. |
I've made raphael-proust/ocaml@bdbddd2 which aims to expose the code that we actually need from the OCaml source. Please leave comments on there, I don't know that I did anything correctly. |
As per ocaml/ocaml#12492 (comment) it turns out licensing is not an issue. We can go ahead on this PR. |
This is long overdue ;) |
a93c0b9
to
a624a1c
Compare
Do we need to
|
Hmm, apparently I accidentally allowed ocaml/ocaml#11449 to be closed by the stale bot. The issue is that It might be possible to work around it by explicitly including |
a624a1c
to
0d5c510
Compare
0d5c510
to
b8a722f
Compare
I made a few attempts but it's a pain to work on without access to a windows machine. I'll make a release which won't be available for 5.2 on windows (sorry) and I can make a point release later to fix this. |
See #967 Version 5.8.1 will be a point fix release for availability
env
is an "environment block": a null-terminated block of null-terminated strings. usingcaml_stat_strdup_to_os
on it doesn't work, it only copies the first string.instead, we need to use an explicit length (
caml_string_length(env)
), but there's no public*_to_os
function for this so we have to use the internalcaml_win32_multi_byte_to_wide_char
directly.Fixes #966