carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
41 stars 26 forks source link

problem with sf library in R and udunits on deploy #566

Open jebyrnes opened 6 months ago

jebyrnes commented 6 months ago

I'm trying to build a new lesson. It compiles and looks great locally, and the pages build.... but, anything using the R sf library fails, with the following error.

Error: package or namespace load failed for 'sf' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/runner/.local/share/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu/units/0.8-5/119d19da480e873f72241ff6962ffd83/units/libs/units.so':
  libudunits2.so.0: cannot open shared object file: No such file or directory

I've looked through the files for the r-ras lesson, but cannot find where it would enable udunits being installed. What do I need to include and where to fix this.....

jebyrnes commented 6 months ago

note - here's the site and repo: site: https://cobalt-casco.github.io/r-shiny-geospatial/ repo: https://github.com/cobalt-casco/r-shiny-geospatial/edit/main/index.md

froggleston commented 6 months ago

Hi @jebyrnes !

This sounds like one of the dependencies of the SF package itself isn't fulfilled on your system. Could you try installing the required dependencies of sf (specifically in this case udunits2) as per the instructions in this SO post?

https://stackoverflow.com/questions/61234169/how-to-solve-error-libudunits2-a-not-found-when-installing-udunits2-in-r-3

Please let me know if you need any more assistance!

jebyrnes commented 6 months ago

This is actually ON github. It works just fine on my system. I can run sandpaper::build_lesson() locally, and everything is good. But when I push to github, I get the errors during the site build.

froggleston commented 6 months ago

Ah I see! Apologies, and thanks for the clarification. I'll try to dig into this over the next few days.

froggleston commented 6 months ago

I've been digging around in the action output from your repo, and found an issue with the step that retrieves dependencies for the specific R packages you use: https://github.com/cobalt-casco/r-shiny-geospatial/actions/runs/7535424481/job/20511384858#step:6:252

I'm afraid I'm as yet unaware of where these dependencies are generated from, and I can't see a similar output in the DC r-raster-geospatial lesson for example (which uses a lot of the same dependencies you're pulling in).

I'm guessing a typo somewhere, but am finding it tricky to discover where!

Update: It looks like it's the chromote package, but still digging! My suggestion would be that you remove that dependency from your renv.lock if it's not required, and try again? It seems webshot2 depends on chromote, so you might get away with only specifying the webshot2 dep and not the additional chromote? Just a thought!

froggleston commented 6 months ago

Final thought - you might need to specify an action to set up chrome specifically for GHA: https://github.com/browser-actions/setup-chrome

jebyrnes commented 6 months ago

Huh - will look. FYI, if you want to see a recently compiled DC raster lesson, I also forked and heavily modified the regular one for this workshop. No issues compiling the site via GH Actions. https://github.com/cobalt-casco/r-raster-vector-geospatial

jebyrnes commented 6 months ago

Oh - ok, now fully read your comment - ugh. Webshot no longer works properly, so had to move to webshot2. Will look deeper into setting up chrome.

Fortunately, I know the code works locally, so...... and the lesson went over well!

Bisaloo commented 4 months ago

I'm not entirely sure how we arrive to the strange error in build logs but in case that's helpful, the system requirements ultimately come from https://github.com/rstudio/r-system-requirements/blob/c02f1175b9c137b3ffd999c860b451ea4376992e/rules/chrome.json, via Posit Package Manager.