-
Notifications
You must be signed in to change notification settings - Fork 404
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
Quote program path given to exec #3325
Conversation
I suppose that let exec fmt =
ksprintf (fun cmd ->
print_endline cmd;
Sys.command cmd)
fmt |
bootstrap.ml
Outdated
@@ -193,7 +193,7 @@ let ocamldep = get_prog bin_dir "ocamldep" | |||
let run_ocamllex src = | |||
let dst = String.sub src ~pos:0 ~len:(String.length src - 1) in | |||
let x = Sys.file_exists dst in | |||
let n = exec "%s -q %s" ocamllex src in | |||
let n = exec "\"%s\" -q %s" ocamllex src in |
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.
Shouldn't we use Filename.quote
here? /cc @dra27 for the windows side of things
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’m on Windows, that’s how I found the bug. I think the best patch would be to use Filename.quote_command since the command has arguments.
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.
Ok. The Windows CI is failing however :/
Well, that’s weird. Is it |
@diml would it be too much effort to embed |
@rgrinberg note that this is in the 1.x branch. IIRC, we don't have Unix in the bootstrap of 1.x. If we are serious about fixing this once and for all in 1.x, I'd suggest to backport Dune 2.x bootstrap instead. |
The 1.x branch is still used by Opam when bootstrapping. |
I see. @dra27 have you tried switching to dune 2 for the opam bootstrap? Or I guess it's not possible because opam still builds with 4.02? |
No, IIRC some of the bundled dependencies still use jbuilder files which are rejected by recent Dune. |
We aren't maintaining 1.x anymore. |
Hi!
When running
ocaml bootstrap.ml
, there are calls toocamllex
,ocamldep
, andocamlc
. The calls are not quoted: if the path contains a space, the shell won’t be able to find the executable, and Dune cannot be compiled.The bug is not present in 2.0.1 and recent versions.
Thanks!