-
Notifications
You must be signed in to change notification settings - Fork 413
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(windows): use unicode version of CreateProcess #10212
Conversation
c7179fd
to
3c6ee60
Compare
@kit-ty-kate can you test this? thanks |
Thanks for the ping, i'll do that in a minute |
still some issues with the vendoring, I'll ping you when it works, sorry |
560afa6
to
93b1be5
Compare
05f5040
to
655029f
Compare
|
655029f
to
7ea41f6
Compare
@kit-ty-kate this is now ready if you want to test it. |
I can confirm this fixes the issue. I tried twice with two different unicode characters which was reliably causing problems before and this PR fixes the issue. Thanks a lot! |
I've pushed the bootstrap changes to #10217 to make this a bit simpler. |
This seems to work, but TBH I'm not completely sold on passing |
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.
LGTM (modulo the questions below)
boot/libs.ml
Outdated
let build_flags = | ||
[ ("win32", [ "-ccopt"; "-D_UNICODE"; "-ccopt"; "-DUNICODE" ]) | ||
; ("win64", [ "-ccopt"; "-D_UNICODE"; "-ccopt"; "-DUNICODE" ]) | ||
; ("mingw", [ "-ccopt"; "-D_UNICODE"; "-ccopt"; "-DUNICODE" ]) | ||
; ("mingw64", [ "-ccopt"; "-D_UNICODE"; "-ccopt"; "-DUNICODE" ]) | ||
] |
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.
I don't see where this is used?
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.
This is used in the bootstrap process. It doesn't read the dune
files, so the build flags are read from boot/libs.ml
.
@dra27 @nojb I have some questions regarding how consistent we need to be with these C flags. Concretely, we have some C stubs in |
You can have Unicode-compatible and ANSI-compatible code in the same executable, so there is no requirement perse from that perspective. On the other hand, we very much want to be sure that all our Windows C code is Unicode-compatible. The stubs of the "fswatch" library use "W" (= Unicode-compatible) functions explicitly, which is why we don't need to define |
9faef00
to
7fb6e28
Compare
Thanks for the confirmation @nojb. Given the previous tests and reviews, I'm merging this. |
This does several things: - update our spawn vendored version to include janestreet/spawn#58 - pick the dune file - add new build flags for bootstrapping Fixes ocaml#10180 Signed-off-by: Etienne Millon <[email protected]>
7fb6e28
to
09c6e8e
Compare
This does several things: - update our spawn vendored version to include janestreet/spawn#58 - pick the dune file - add new build flags for bootstrapping Fixes ocaml#10180 Signed-off-by: Etienne Millon <[email protected]>
Yes, indeed - pretty much everything should use Unicode versions now (most especially when dealing with the file system). The exception is if you have non-ASCII data (say in a database) which was interpreted using the various ANSI legacy encodings. Defining |
This does several things: - update our spawn vendored version to include janestreet/spawn#58 - pick the dune file - add new build flags for bootstrapping Fixes #10180 Signed-off-by: Etienne Millon <[email protected]> Co-authored-by: Etienne Millon <[email protected]>
CHANGES: ### Fixed - When a directory is changed to a file, correctly remove it in subsequent `dune build` runs. (ocaml/dune#9327, fix ocaml/dune#6575, @emillon) - Fix a problem with the doc-new target where transitive dependencies were missed during compile. This leads to missing expansions in the output docs. (ocaml/dune#9955, @jonludlam) - coq: fix performance regression in coqdep unescaping (ocaml/dune#10115, fixes ocaml/dune#10088, @ejgallego, thanks to Dan Christensen for the report) - coq: memoize coqdep parsing, this will reduce build times for Coq users, in particular for those with many .v files (ocaml/dune#10116, @ejgallego, see also ocaml/dune#10088) - on Windows, use an unicode-aware version of `CreateProcess` to avoid crashes when paths contains non-ascii characters. (ocaml/dune#10212, fixes ocaml/dune#10180, @emillon)
This change seems to break compiling dune on 4.14+musl+static. Here's the error message:
and the link to a failing job |
Ah, it looks like that has been discovered in opam-ci too: ocaml/opam-repository#25456 |
This updates our spawn vendored version to include janestreet/spawn#58.
Fixes #10180