tweag / HaskellR

The full power of R in Haskell.

Home Page:https://tweag.github.io/HaskellR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

H: ghci: createProcess: runInteractiveProcess: exec: does not exist trying to run examples

skeydan opened this issue · comments

Hi,

could you please help with the following problem?

When calling
H -- -ghci-script nls.H
I get the above error.

I'm on Fedora, so I've used nix for installation, as per the recommendation in the FAQs.
I've installed H locally to ~/.local/bin.

Thank you very much in advance!

Cheers
Sigrid

Thanks for heads up!
I've tried to run setup in the similar environment and that I've found so far:

  1. In order to run the script the simplest way is to run everything using stack.
    You need the following command:
~/tmp/HaskellR/examples/nls$  stack --nix \
  --stack-yaml ../../stack-ghc-8.0.yaml exec  \
  H -- -- -ghci-script ../../H/H.ghci -ghci-script nls.H

The options explanation:

  1. you need to run it from the examples directory otherwise example will not be able to load library scripts

  2. stack --nix - use nix backed for stack

  3. --stack-yaml ../../stack-ghc-8.0.yaml you need this option only if you want to use ghc-8, omit it if default one suite your needs

  4. exec H -- execute H executable from the stack directories

  5. First -- - split stack options from H options

  6. Second -- - split H options from ghci options

  7. -ghci-script ../../H/H.ghci - load H defaults, really this is included in H itself, but for some reason
    ghci reorders options in a way that nls.H is loaded before the H.ghci so default import doesn't work.
    This can be solved rather by loading H and then call :load to load example. I'll try to investigate the issue but I'm not sure that I'll find nice workaround easily

  8. -ghci-script nls.H -- run script itself.

  9. Also script was rather rotted and used pre inline-r-0.8 API, so I've updated the script in #288.

I hope that will be able to unblock you on this task.

Thank you very much, this helps a lot!

In fact it even explains that when, before, I tried with stack exec H (I've added nix: enable to stack.yaml) I got a different error:

[key@key HaskellR]$ stack exec H -- -ghci-script examples/nls/nls.H
Unknown flag: -g

... so this was because I didn't have the -- --, as you explain above.

thx again!