HaskellR icon indicating copy to clipboard operation
HaskellR copied to clipboard

Test H and inline-r on windows in CI

Open facundominguez opened this issue 2 years ago • 2 comments

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.

facundominguez avatar Jan 24 '23 20:01 facundominguez

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 avatar Jan 24 '23 21:01 djsamperi

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.

djsamperi avatar Jan 27 '23 15:01 djsamperi