Skip to content

Commit

Permalink
Fix R 4.0 and R 4.1 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Mar 29, 2024
1 parent 556c04f commit 498dc55
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ RELEASE.md
_files$
^vscode-build$
^vscode-integrate-build$
^patch$
^src/librstrtmgr\.a$
4 changes: 4 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ jobs:
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'oldrel'}
- {os: windows-latest, r: 'oldrel-1'}
- {os: windows-latest, r: 'oldrel-2'}
- {os: windows-latest, r: 'oldrel-3'}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

- Don't run tests that invoke re2 by default (#121, #127).

- Fix compilation for R 4.0 and R 4.1, regression introduced in v0.10.0. The package still cannot be built due to a missing `rstrtmgr.lib` in rtools40 (#130).
- Fix compilation for R 4.0 and R 4.1, regression introduced in v0.10.0. Using `librstrtmgr.a` from UCRT build of rtools40 (#130).

## Internal

Expand Down
8 changes: 8 additions & 0 deletions configure.win
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/sh

set -e

cd $(dirname $0)/src

# http://www.ii.uib.no/~olev/win32/tools/dlltool.html
if [ "$(${R_HOME}/bin/Rscript --vanilla -e 'writeLines(format(getRversion() < "4.2"))')" = "TRUE" ]; then
echo "Extracting librstrtmgr.a for R < 4.2"
gunzip -k librstrtmgr.a.gz
fi

# The purpose of this is to avoid rebuilding duckdb in every CI/CD run.
# We set the DUCKDB_R_PREBUILT_ARCHIVE environment variable to a file path
# that contains a .tar of all object files.
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ include Makevars.duckdb
CXX_STD = CXX17
PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD -Iduckdb/src/include -Iduckdb/third_party/fmt/include -Iduckdb/third_party/fsst -Iduckdb/third_party/re2 -Iduckdb/third_party/miniz -Iduckdb/third_party/utf8proc/include -Iduckdb/third_party/utf8proc -Iduckdb/third_party/hyperloglog -Iduckdb/third_party/skiplist -Iduckdb/third_party/fastpforlib -Iduckdb/third_party/tdigest -Iduckdb/third_party/libpg_query/include -Iduckdb/third_party/libpg_query -Iduckdb/third_party/concurrentqueue -Iduckdb/third_party/pcg -Iduckdb/third_party/httplib -Iduckdb/third_party/fast_float -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -Iduckdb/third_party/mbedtls/library -Iduckdb/third_party/jaro_winkler -Iduckdb/third_party/jaro_winkler/details -Iduckdb/extension/parquet/include -Iduckdb/third_party/parquet -Iduckdb/third_party/thrift -Iduckdb/third_party/snappy -Iduckdb/third_party/zstd/include -Iduckdb/third_party/mbedtls -Iduckdb/third_party/mbedtls/include -I../inst/include -Iduckdb -DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_BUILD_LIBRARY -DDUCKDB_PLATFORM_RTOOLS=1
OBJECTS=database.o connection.o statement.o register.o relational.o scan.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
PKG_LIBS=-lws2_32 -lrstrtmgr
PKG_LIBS=-lws2_32 -L. -lrstrtmgr
Binary file added src/librstrtmgr.a.gz
Binary file not shown.

0 comments on commit 498dc55

Please sign in to comment.