bzhanglab / WebGestaltR

R package for WebGestalt
https://bzhanglab.github.io/WebGestaltR/
34 stars 14 forks source link

Fix #49 error of caused by Windows GCC compiler #50

Closed iblacksand closed 2 months ago

iblacksand commented 3 months ago

Fixes error caused by gcc compiler provided by Rtools. Tested on R's provided windows check service.

iblacksand commented 3 months ago

Warnings with CRAN checks caused by depreciated R APIs. Being tracked in https://github.com/extendr/extendr/issues/806.

iblacksand commented 3 months ago

Build errors due to non-api calls. Fixed in the master branch of extendr/rextendr. Will update this PR with the latest version of rextendr when it is released.

CGMossa commented 3 months ago

The non-api issues are dealt with in #51

CGMossa commented 3 months ago

I'm very curious as to what is going on here.. Can you explain it to me?

iblacksand commented 3 months ago

This PR aims to address the linker issue in #49. The exact issue is hard to replicate, as it passes checks in my GitHub action, and passes both R-release and R-devel on the win-builder service (https://win-builder.r-project.org/).

There has been progress in this PR, as the current master branch will fail to build on win-builder. After I updated src/Makevars.win.in to follow the https://github.com/r-rust/hellorust structure, it builds without any errors. However, it still doesn't fix the linker issue the user faces.

I think the last piece of the puzzle is lgcc_eh, which from my understanding is not provided by Rtools. From my previous Makevars.win.in, the fix was to create an empty lgcc_eh.a file that is in the LIBRARY_PATH variable. This is going to be my next attempt to fix.

If you have any suggestions for how to fix this error, I would welcome any comments.

CGMossa commented 3 months ago

Yes! We routinely update the package configuration in rextendr (the R-package for using Rust in R with extendr). I'd really just recommend..

remotes::install_github("extendr/rextendr")
usethis::create_package("exampleRustRpkg")
rextendr::use_extendr()

And have a look at those files, copy them over, and adjust them to meet your package's needs.

Sorry, but these things are constantly changing, and we couldn't get it right the first time.

CGMossa commented 3 months ago

The reason I'm also here, is because I think you'd have some issues here with extracting info from the shell in Makevars. Something about using backticks for this for compatibility.. I don't recall the details of this, unfortunately.

PS: found it

image

See https://cran.r-project.org/doc/manuals/R-exts.html#Writing-portable-packages-1

iblacksand commented 2 months ago

This branch has solved some other peoples issues with windows, so I will merge this PR. I will work on a fix in a separate branch.