Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSQLite compile error on Windows using GitHub Actions #513

Closed
anthonysena opened this issue May 30, 2024 · 7 comments
Closed

RSQLite compile error on Windows using GitHub Actions #513

anthonysena opened this issue May 30, 2024 · 7 comments

Comments

@anthonysena
Copy link

Hi - I'm hoping you can help me with an error I'm facing when running GitHub Actions on my project. This only appears to happen when using the latest Windows and R v4.2.3 & RTools 4.2. Please see the logs that start at: https://github.com/OHDSI/CohortGenerator/actions/runs/9289700700/job/25616598401#step:11:2554 and end: https://github.com/OHDSI/CohortGenerator/actions/runs/9289700700/job/25616598401#step:11:2979.

Please let me know if you need any further details from me. Thanks!

@krlmlr
Copy link
Member

krlmlr commented May 31, 2024

Perhaps clear the GitHub Actions cache? Easiest by changing the cache key.

@krlmlr
Copy link
Member

krlmlr commented May 31, 2024

(The cache for the installed R packages.)

@anthonysena
Copy link
Author

Thanks will give it a try and let you know.

@anthonysena
Copy link
Author

From review of my GitHub Action file, there is no caching for R packages on Windows (ref)

Looking closer at the output from the failed run, I found this excerpt from the failure to install RSQLite:

** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: Error: package or namespace load failed for 'RSQLite':
ERROR: loading failed
* removing 'D:/a/_temp/Library/RSQLite'
 .onLoad failed in loadNamespace() for 'RSQLite', details:
  call: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  error: there is no package called 'cachem'
Error: Error: loading failed

I then noticed a little further along in the output that cachem is installed so it looks like RSQLite would require cachem to be installed first? I'm installing these dependencies via this block:

      - name: Install dependencies
        run: |
          remotes::install_deps(dependencies = TRUE, INSTALL_opts=c("--no-multiarch"))
          remotes::install_cran("rcmdcheck")
        shell: Rscript {0}

So I'm unsure why the installs are not happening in the required order.

@krlmlr
Copy link
Member

krlmlr commented Jun 1, 2024

Thanks for double-checking.

I see the workflow is installing packages from source: https://github.com/OHDSI/CohortGenerator/actions/runs/9289700700/job/25616598401#step:11:1218 .

Is there a specific reason for testing on R 4.2?

What happens if you install cachem manually before running install_deps() ?

You could also consider pak, or moving altogether to the actions provided by https://github.com/r-lib/actions/ (which use pak under the hood).

@anthonysena
Copy link
Author

Hi - I'm testing on 4.2 since that's what we currently support for our collection of packages. As you probably saw from the GitHub Actions this does not appear to be an issue on the most recent release of R. I'll see if I can migrate to the newer actions that use pak and potentially install cachem ahead of installing the other dependencies. Thanks!

@anthonysena
Copy link
Author

Hi for now I've opted to install cachem before installing the other dependencies as we should be moving towards the latest release of R and we can evaluate using the r-lib/actions as you mentioned. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants