Conversation
`run_command_args` folded the program and its arguments into one string and handed that to a shell, so generators had to quote arguments themselves. That quoting broke in server mode on Windows: the command string is passed to cmd.exe as a single argv entry, which OCaml escapes as `\"…\"`, and the quotes end up literal in the child's arguments. `haxelib run hashlink build` then received `"bin/c/hlout/main.c"` and looked for `"bin/c/hlout/hlc.json` (regression from replacing the process C stubs, which handed the raw command line to CreateProcess). Unquoted arguments were no better: `nekoc` got a path with a space split into two arguments. Give `run_command_args` its own implementation that never builds a command string: the child is spawned from an argv, going through the command interpreter on Windows only so .bat/.cmd shims keep resolving. Generators pass their arguments raw.
tobil4sk
reviewed
Sep 18, 2026
| common_ctx.class_paths#iter (fun path -> | ||
| let path = path#path in | ||
| cmd := !cmd @ [Printf.sprintf "-I\"%s\"" (escape_command path)] | ||
| cmd := !cmd @ [Printf.sprintf "-I%s" path] |
Member
There was a problem hiding this comment.
It would be good to add a test to make sure spaces in these include paths still work with hxcpp (if we don't have one already).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_command_argsfolded the program and its arguments into one string and handed that to a shell, so generators had to quote arguments themselves. That quoting broke in server mode on Windows: the command string is passed to cmd.exe as a single argv entry, which OCaml escapes as\"…\", and the quotes end up literal in the child's arguments.haxelib run hashlink buildthen received"bin/c/hlout/main.c"and looked for"bin/c/hlout/hlc.json(regression from replacing the process C stubs, which handed the raw command line to CreateProcess). Unquoted arguments were no better:nekocgot a path with a space split into two arguments.Give
run_command_argsits own implementation that never builds a command string: the child is spawned from an argv, going through the command interpreter on Windows only so .bat/.cmd shims keep resolving. Generators pass their arguments raw.(fixes a regression from c49aa82)