ropensci / NLMR

📦 R package to simulate neutral landscape models 🏔
https://ropensci.github.io/NLMR/
65 stars 17 forks source link

dealing with RF/RFutils (#95) #96

Closed achubaty closed 2 years ago

achubaty commented 2 years ago
achubaty commented 2 years ago

Since RF depends on RFutils, it's not strictly necessary to depends on RFutils.

achubaty commented 2 years ago

@bitbacchus I just pushed an update to this PR that explicitly adds the additional repository to the 2 failing GitHub Actions configs, which should hopefully resolve those failures. (Though note I switched to v2 of the r-setup from v1, without updating the downstream Actions -- i.e., there may be more tweaking of the Actions config needed)

achubaty commented 2 years ago

updated all R actions to v2 -- not sure why it wasn't finding the packages in the r-universe repo, because they are there and working on other test systems :/

mhesselbarth commented 2 years ago

Seems like it's still not finding the packages unfortunately

achubaty commented 2 years ago

:cry: looks like a bug in pak::pkg_install() which is being used in that action.

Trying locally, I get:

> getOption('repos')
                                                           CRAN 
"https://packagemanager.rstudio.com/all/__linux__/focal/latest" 
                                                             PE 
                    "https://predictiveecology.r-universe.dev/" 
> pak::pkg_install('RandomFields')
✓ Updated metadata database: 2.08 MB in 7 files.                          
ℹ source packages are missing from predictiveecology.r-universe.dev        
✓ Updating metadata database ... done                                     
Error: Cannot install packages:                                            
* RandomFields: Can't find package called RandomFields.
Type .Last.error.trace to see where the error occurred
achubaty commented 2 years ago

@mhesselbarth, I finally figured it out. pak choked on the trailing slash in the repo url (https://github.com/r-lib/pak/issues/400).

Removing the slash is worknig for me locally now, and I've pushed 7702bf5963b7ca4fdf3191eee9323f4e7ffccf96 to deal with this.

bitbacchus commented 2 years ago

Hm, the build fails for Linux and macOS. Apparently, the XML package can't be installed on Linux, but I don't see an obvious reason at the moment. At least, libxml2-dev seems to install successfully.

achubaty commented 2 years ago

perhaps a weird blip? my other GitHub Actions workflows that install XML on Linux are working.

bitbacchus commented 2 years ago

The issue seems to be with pak and R 4.2: https://github.com/r-lib/actions/issues/559

Can you try if this helps?

extra-packages: any::rcmdcheck, any::XML

Thanks a lot for your effort!

achubaty commented 2 years ago

@bitbacchus thanks for tracking down the issue in pak. I've pushed the workaround for XML. :crossed_fingers:

bitbacchus commented 2 years ago

macOS still fails:

Screenshot from 2022-08-11 19-23-08

Why though?

mhesselbarth commented 2 years ago

I tried to install RandomFields locally on my macOS, and needed to manually install gfortran because apparently thats shipped differently with the newest gcc compiler updates which caused issue. Maybe somehow related to that?

(https://github.com/fxcoudert/gfortran-for-macOS)

achubaty commented 2 years ago

The brew setup should automatically be getting the compiler tools needed, so I don't think that's the issue -- on my macOS machine, pak is trying to get the pkg from CRAN (and failing) but isn't trying the r-universe repo for some reason. Also note that the r-universe repo has pre-built binaries.

I'm going to try manual install.

achubaty commented 2 years ago

@mhesselbarth @bitbacchus this is now passing for me :tada:

bitbacchus commented 2 years ago

Awesome, thanks a ton, @achubaty :-)

achubaty commented 2 years ago

Thanks - any idea how soon you plan to get updated package version to CRAN?