tweag / HaskellR

The full power of R in Haskell.
https://tweag.github.io/HaskellR
Other
584 stars 47 forks source link

Test H and inline-r on windows in CI #397

Open facundominguez opened 1 year ago

facundominguez commented 1 year ago

Currently, we don't test H in CI. This ticket is about producing some simple test for H and running it in CI together with the tests for inline-r on Windows.

djsamperi commented 1 year ago

I installed under Windows using several recent versions of R (up to and including 4.2.2) and the usual 'stack exec H' did not work for me. Modules could not be found, or R complains about bad input.

djsamperi commented 1 year ago

Here is more info on the problem. I'm using Windows 11, with ghc 9.2.5, and R-4.2.2.

Following the instructions at tweag.github.io/HaskellR, H installs without problems, but 'stack exec H' results in a ghci> prompt instead of the usual H> prompt. When I enter the quasi quote [r|2|], I get this...

An error occurred while trying to parse the R code. The stderr of the R interpreter was: Error: '\U' used without hex digits in character string starting ""C:\u"

Googling for the error string results in about 500,000 results. The problem arises because a string with Windows-style backslashes is provided, as in read.csv("C:\Users\bob\test.csv"). The work-around is to use forward slashes, or escapes, that is, use double backslashes. I tried specifying the input directories for extra-include-dirs and extra-lib-dirs using forward slashes and compressed names (PROGRA~1 instead of "Program Files"), and H was installed without problems, but the same hex error message appears.

In a different scenario, if I do not clone the files from the HaskellR repository, and simply issue the stack install command using global configs, H installs without error, but 'stack exec H' leads to...

\<no location info>: error: Could not find module 'H.Prelude.Interactive' It is not a module in the current program, or in any known package.

\<interactive>:21:1: error: Not in scope: 'Language.R.Instance.initialize' No module name 'Language.R.Instannce' is imported.

\<interactive>:21:32: error: Not in scope: 'Language.R.Instance.defaultConfig' No module named 'Language.R.Instance is imported.