Skip to content
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

feature-wish: #! /usr/bin/env dune-run #1884

Open
smondet opened this issue Feb 26, 2019 · 1 comment
Open

feature-wish: #! /usr/bin/env dune-run #1884

smondet opened this issue Feb 26, 2019 · 1 comment

Comments

@smondet
Copy link

smondet commented Feb 26, 2019

Something to build executables in $TMPDIR and run them which could look like:

#! /usr/bin/env dune-run
#! dune-run --libraries cmdliner,base

let () = print_string "Hello world\n"

(the second-line of #! is what nix-shell does also
http://chriswarbo.net/projects/nixos/nix_shell_shebangs.html )

@ghost
Copy link

ghost commented Feb 27, 2019

Why not, but we might as well use the same syntax as dune files rather than invent something new:

#! /usr/bin/env dune run
#! (libraries cmdliner base) (preprocess (pps ppx_sexp_conv)) ...

...

We should also compile that in the xdg cache dir, to avoid recompiling it on every run. For instance in ~/.cache/dune/scripts/<hash-of-file-contents>/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants