Skip to content

Commit fbf9b29

Browse files
committed
Create direct_call_to_external_tool.md
1 parent 2ab45a2 commit fbf9b29

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Direct call to external toolchain
2+
3+
The compiler shouldn't require a shell in order to work.
4+
5+
# Motivation for the change
6+
7+
I try to fix this https://github.com/esy/esy/issues/1344
8+
I can reduce process in esy but half of this has to be fixed in ocaml/flexdll
9+
10+
# Technical details of the change
11+
12+
Replace Sys.command by Unix.create_process or Unix.open_process_args
13+
14+
# Drawbacks of the change and alternatives to the change
15+
16+
pros:
17+
- You earn some time without launching useless shell
18+
- You avoid the [quoting nightmare](https://github.com/ocaml/ocaml/pull/10727) on OS with exec*
19+
- You handle better all path (I have not tested path with $,; and other niceties)
20+
- You workaround cmd limitation of 8187
21+
22+
cons:
23+
- The flags -pp/-ppx 'binary -args' will not work
24+
- User can still create a wrapper script
25+
- We can add --ppopt, -ppxopt like -ccopt
26+
- 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.
27+
- You loose usage of %COMSPEC% on windows (but is it still needed ?)
28+
- We can still read that variable and act in consequence
29+
30+
cons without workaround:
31+
- Unix will not be optional anymore (or maybe at least the creation part)
32+
33+
# Unresolved questions

0 commit comments

Comments
 (0)