diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8a6c85be..423a5bb4 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -55,4 +55,18 @@ jobs: cache-version: 2 extra-packages: rcmdcheck + # TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html) + - name: Check R version + id: error-on + run: | + output <- Sys.getenv("GITHUB_OUTPUT") + if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") { + cat('level=error', file = output, append = TRUE) + } else { + cat('level=warning', file = output, append = TRUE) + } + shell: Rscript {0} + - uses: r-lib/actions/check-r-package@v2 + with: + error-on: '"${{ steps.error-on.outputs.level }}"' diff --git a/.github/workflows/test_pkg_gen.yaml b/.github/workflows/test_pkg_gen.yaml index e7fe261e..f2d7e9fd 100644 --- a/.github/workflows/test_pkg_gen.yaml +++ b/.github/workflows/test_pkg_gen.yaml @@ -99,12 +99,19 @@ jobs: ) Sys.chmod("configure", "0755") + # TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html) + if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") { + error_on <- "error" + } else { + error_on <- "warning" + } + # check if rextendr::document() compiles and generates wrappers properly rextendr::document() rcmdcheck::rcmdcheck( path = ".", args = c("--no-manual", "--as-cran"), - error_on = "warning", + error_on = error_on, check_dir = "check_use_extendr" ) diff --git a/inst/templates/Makevars.win b/inst/templates/Makevars.win index 43654fbf..e47a9ab2 100644 --- a/inst/templates/Makevars.win +++ b/inst/templates/Makevars.win @@ -3,7 +3,7 @@ TARGET = $(subst 64,x86_64,$(subst 32,i686,$(WIN)))-pc-windows-gnu TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/lib{{{lib_name}}}.a -PKG_LIBS = -L$(LIBDIR) -l{{{lib_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt +PKG_LIBS = -L$(LIBDIR) -l{{{lib_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt -lntdll all: C_clean diff --git a/tests/testthat/_snaps/use_extendr.md b/tests/testthat/_snaps/use_extendr.md index 451bc427..1d30fb2e 100644 --- a/tests/testthat/_snaps/use_extendr.md +++ b/tests/testthat/_snaps/use_extendr.md @@ -84,7 +84,7 @@ TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/libtestpkg.a - PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt + PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt -lntdll all: C_clean