From fbf9b29d6608fdc8db96b21078815996013eaf0d Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Mon, 8 Nov 2021 23:27:50 +0100 Subject: [PATCH 1/2] Create direct_call_to_external_tool.md --- rfcs/direct_call_to_external_tool.md | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 rfcs/direct_call_to_external_tool.md diff --git a/rfcs/direct_call_to_external_tool.md b/rfcs/direct_call_to_external_tool.md new file mode 100644 index 0000000..8ddf2ce --- /dev/null +++ b/rfcs/direct_call_to_external_tool.md @@ -0,0 +1,33 @@ +# Direct call to external toolchain + +The compiler shouldn't require a shell in order to work. + +# Motivation for the change + +I try to fix this https://github.com/esy/esy/issues/1344 +I can reduce process in esy but half of this has to be fixed in ocaml/flexdll + +# Technical details of the change + +Replace Sys.command by Unix.create_process or Unix.open_process_args + +# Drawbacks of the change and alternatives to the change + +pros: +- You earn some time without launching useless shell +- You avoid the [quoting nightmare](https://github.com/ocaml/ocaml/pull/10727) on OS with exec* +- You handle better all path (I have not tested path with $,; and other niceties) +- You workaround cmd limitation of 8187 + +cons: +- The flags -pp/-ppx 'binary -args' will not work + - User can still create a wrapper script + - We can add --ppopt, -ppxopt like -ccopt + - We can add -direct_pp,-direct_ppx so we don't break any projects. All good citizens that use dune will get a boost benefit freely. +- You loose usage of %COMSPEC% on windows (but is it still needed ?) + - We can still read that variable and act in consequence + +cons without workaround: +- Unix will not be optional anymore (or maybe at least the creation part) + +# Unresolved questions From 6cdbc5d1e7a434fd8ddc2a41ff72e89665555df1 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Tue, 9 Nov 2021 01:42:54 +0100 Subject: [PATCH 2/2] Add mention about ccopt/cclib --- rfcs/direct_call_to_external_tool.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rfcs/direct_call_to_external_tool.md b/rfcs/direct_call_to_external_tool.md index 8ddf2ce..d31216d 100644 --- a/rfcs/direct_call_to_external_tool.md +++ b/rfcs/direct_call_to_external_tool.md @@ -26,6 +26,8 @@ cons: - We can add -direct_pp,-direct_ppx so we don't break any projects. All good citizens that use dune will get a boost benefit freely. - You loose usage of %COMSPEC% on windows (but is it still needed ?) - We can still read that variable and act in consequence +- We break user that rely on this implementation detail and pass multiple opt to -ccopt/-cclib instead of repeating it. + - Workaround either split on space and/or implement word splitting that respect quoting. cons without workaround: - Unix will not be optional anymore (or maybe at least the creation part)