Closed Ilia-Kosenkov closed 3 years ago
Just checked it in WSL2
- works fine on Ubuntu, so looks like again some Windows issue.
Also, if I attempt to re-build bindings using rextendr:::install_libR_bindings()
produces the following error:
I believe it originates from here (or is somehow related to)
Curious. R.lib
seems handled here. Is .Platform$dynlib.ext
.lib
on Windows?
https://github.com/extendr/rextendr/blob/4ec4d4413de0fe8b22b5d09ccfa41da90a647af0/R/source.R#L146-L150 https://github.com/extendr/rextendr/blob/4ec4d4413de0fe8b22b5d09ccfa41da90a647af0/R/source.R#L189-L198
@yutannihilation,
Nope, it says .dll
.
I would say it arises somewhere here
https://github.com/extendr/rextendr/blob/4ec4d4413de0fe8b22b5d09ccfa41da90a647af0/R/source.R#L121-L132
When building the resulting library, cargo
grabs incorrect R.lib
and ultimately fails.
Ah, sorry, you are right. But it succeeds on my Windows. My guess is that you need to use Rtools' GCC, not MSVC this time because what R provides is probably for Rtools (I don't have MSVC toolchain installed).
@yutannihilation, Ok, this worked for me. But I have two issues with this:
*-gnu
toolchain as default, which is a somewhat system-wide modification compared to the default toolchain used to build rust
projects under Windows. It is OK to ask user to install something extra but I would prefer to not modify any system defaults.--target
with default msvc
toolchain or by providing +toolchain
flag to cargo to override default toolchain.I can try investigating this.
Makes sense. I agree with you.
Just a general comment on tests: I agree there needs to be a test suite. It just must not run on CRAN, as it will cause never ending problems otherwise. I wanted to write some code that simply doesn't call any of the tests on CRAN, rather than add skip_on_cran()
everywhere, but I did't get to it and that's where it stopped.
There also shouldn't be any examples that require a working Rust install and that aren't wrapped into \dontrun{}
.
I'm happy to receive PRs that add tests, given these constraints.
I installed latest github version of the package and tried creating the following rust function from the README:
I unfortuantely experienced a liking issue at the end, see attached log:
This happened at least on Windows. One of the problems I see is that the linking is attempted agains
R.lib
, while it should beR.dll
. It seems that eitherMakevars
or something else is poorly configured.With that said, maybe we should have 'real' tests attached to this repository? For instance, creating such
add
function and checking its output, because the package can be installed andtestthat
succeeds, yet I am unable to use it.