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

Fix compile error on Windows with Rust 1.70 #285

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"'
9 changes: 8 additions & 1 deletion .github/workflows/test_pkg_gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion inst/templates/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/use_extendr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down