Skip to content

Commit

Permalink
Create direct_call_to_external_tool.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Et7f3 committed Nov 8, 2021
1 parent 2ab45a2 commit fbf9b29
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions rfcs/direct_call_to_external_tool.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fbf9b29

Please sign in to comment.