Skip to content

Commit 05c8504

Browse files
Fix compile error on Windows with Rust 1.70 (#285)
1 parent ee00811 commit 05c8504

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.github/workflows/R-CMD-check.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,18 @@ jobs:
5555
cache-version: 2
5656
extra-packages: rcmdcheck
5757

58+
# TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html)
59+
- name: Check R version
60+
id: error-on
61+
run: |
62+
output <- Sys.getenv("GITHUB_OUTPUT")
63+
if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") {
64+
cat('level=error', file = output, append = TRUE)
65+
} else {
66+
cat('level=warning', file = output, append = TRUE)
67+
}
68+
shell: Rscript {0}
69+
5870
- uses: r-lib/actions/check-r-package@v2
71+
with:
72+
error-on: '"${{ steps.error-on.outputs.level }}"'

.github/workflows/test_pkg_gen.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,19 @@ jobs:
9999
)
100100
Sys.chmod("configure", "0755")
101101
102+
# TODO: allow warnings on oldrel (cf., https://stat.ethz.ch/pipermail/r-package-devel/2023q2/009229.html)
103+
if (.Platform$OS.type == "windows" && getRversion() < "4.3.0") {
104+
error_on <- "error"
105+
} else {
106+
error_on <- "warning"
107+
}
108+
102109
# check if rextendr::document() compiles and generates wrappers properly
103110
rextendr::document()
104111
rcmdcheck::rcmdcheck(
105112
path = ".",
106113
args = c("--no-manual", "--as-cran"),
107-
error_on = "warning",
114+
error_on = error_on,
108115
check_dir = "check_use_extendr"
109116
)
110117

inst/templates/Makevars.win

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TARGET = $(subst 64,x86_64,$(subst 32,i686,$(WIN)))-pc-windows-gnu
33
TARGET_DIR = ./rust/target
44
LIBDIR = $(TARGET_DIR)/$(TARGET)/release
55
STATLIB = $(LIBDIR)/lib{{{lib_name}}}.a
6-
PKG_LIBS = -L$(LIBDIR) -l{{{lib_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt
6+
PKG_LIBS = -L$(LIBDIR) -l{{{lib_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt -lntdll
77

88
all: C_clean
99

tests/testthat/_snaps/use_extendr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
TARGET_DIR = ./rust/target
8585
LIBDIR = $(TARGET_DIR)/$(TARGET)/release
8686
STATLIB = $(LIBDIR)/libtestpkg.a
87-
PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt
87+
PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt -lntdll
8888
8989
all: C_clean
9090

0 commit comments

Comments
 (0)