Skip to content

Commit 277c82e

Browse files
fix: Remove unnecessary makevars.ucrt (#414)
* fix: Remove unnecessary makevars.ucrt * update NEWS.md address lintr --------- Co-authored-by: Josiah Parry <[email protected]>
1 parent cbd93f6 commit 277c82e

File tree

8 files changed

+6
-26
lines changed

8 files changed

+6
-26
lines changed

.lintr

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ linters: linters_with_defaults(
44
commented_code_linter = NULL
55
)
66
encoding: "UTF-8"
7+
exclusions: list(
8+
"R/import-standalone-obj-type.R"
9+
)

NEWS.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# rextendr (development version)
22

3+
* Removes `Makevars.ucrt` as R versions < 4.1 are not supported by extendr <https://github.com/extendr/rextendr/pull/414>
34
* `purrr` has been replaced with [`R/standalone-purrr.R`](https://github.com/r-lib/rlang/blob/main/R/standalone-purrr.R) removing `purrr` from `Imports` <https://github.com/extendr/rextendr/pull/408>
45
* `document()` will no longer try to save all open files using rstudioapi <https://github.com/extendr/rextendr/issues/404> <https://github.com/extendr/rextendr/issues/407>
56
* `use_cran_default()` has been removed as the default package template is CRAN compatible <https://github.com/extendr/rextendr/pull/394>

R/source.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ get_specific_target_name <- function() {
503503
)
504504
}
505505

506-
return(NULL)
506+
NULL
507507
}
508508

509509
the <- new.env(parent = emptyenv())

R/use_extendr.R

-8
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ use_extendr <- function(path = ".",
116116
data = list(lib_name = lib_name)
117117
)
118118

119-
use_rextendr_template(
120-
"Makevars.ucrt",
121-
save_as = file.path("src", "Makevars.ucrt"),
122-
quiet = quiet,
123-
overwrite = overwrite,
124-
data = list(lib_name = lib_name)
125-
)
126-
127119
use_rextendr_template(
128120
"_gitignore",
129121
save_as = file.path("src", ".gitignore"),

inst/templates/Makevars.win.in

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ $(STATLIB):
3131
fi; \
3232
fi
3333

34-
# CARGO_LINKER is provided in Makevars.ucrt for R >= 4.2
3534
# Build the project using Cargo with additional flags
3635
export CARGO_HOME=$(CARGOTMP) && \
3736
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \

tests/testthat/_snaps/use_extendr.md

-14
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@
313313
fi; \
314314
fi
315315
316-
# CARGO_LINKER is provided in Makevars.ucrt for R >= 4.2
317316
# Build the project using Cargo with additional flags
318317
export CARGO_HOME=$(CARGOTMP) && \
319318
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
@@ -329,17 +328,6 @@
329328
clean:
330329
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) $(TARGET_DIR)
331330

332-
---
333-
334-
Code
335-
cat_file("src", "Makevars.ucrt")
336-
Output
337-
# Rtools42 doesn't have the linker in the location that cargo expects, so we
338-
# need to overwrite it via configuration.
339-
CARGO_LINKER = x86_64-w64-mingw32.static.posix-gcc.exe
340-
341-
include Makevars.win
342-
343331
---
344332

345333
Code
@@ -401,7 +389,6 @@
401389
> File 'src/entrypoint.c' already exists. Skip writing the file.
402390
> File 'src/Makevars.in' already exists. Skip writing the file.
403391
> File 'src/Makevars.win.in' already exists. Skip writing the file.
404-
> File 'src/Makevars.ucrt' already exists. Skip writing the file.
405392
> File 'src/.gitignore' already exists. Skip writing the file.
406393
> File 'src/rust/Cargo.toml' already exists. Skip writing the file.
407394
> File 'src/rust/src/lib.rs' already exists. Skip writing the file.
@@ -421,7 +408,6 @@
421408
v Writing 'src/entrypoint.c'
422409
v Writing 'src/Makevars.in'
423410
v Writing 'src/Makevars.win.in'
424-
v Writing 'src/Makevars.ucrt'
425411
v Writing 'src/.gitignore'
426412
v Writing 'src/rust/Cargo.toml'
427413
v Writing 'src/rust/src/lib.rs'

tests/testthat/test-rstudio-template.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test_that("RStudio template generation is correct", {
1515
"configure", "configure.win", "DESCRIPTION",
1616
"extendrtest.Rproj", "NAMESPACE", "R/extendr-wrappers.R",
1717
"src/entrypoint.c", "src/extendrtest-win.def",
18-
"src/Makevars.in", "src/Makevars.ucrt", "src/Makevars.win.in",
18+
"src/Makevars.in", "src/Makevars.win.in",
1919
"src/rust/Cargo.toml", "src/rust/src/lib.rs", "tools/msrv.R"
2020
)
2121

tests/testthat/test-use_extendr.R

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ test_that("use_extendr() sets up extendr files correctly", {
2929
expect_snapshot(cat_file("src", "Makevars.in"))
3030
expect_snapshot(cat_file("src", "entrypoint.c"))
3131
expect_snapshot(cat_file("src", "Makevars.win.in"))
32-
expect_snapshot(cat_file("src", "Makevars.ucrt"))
3332
expect_snapshot(cat_file("src", "testpkg-win.def"))
3433
expect_snapshot(cat_file("src", "rust", "Cargo.toml"))
3534
expect_snapshot(cat_file("src", "rust", "src", "lib.rs"))

0 commit comments

Comments
 (0)