Skip to content

Commit 9db60d0

Browse files
chore: update Cargo.toml generation (#465)
* chore: update Cargo.toml template * fix: typo * tests: update snaps * tests: manually update snaps
1 parent b226db3 commit 9db60d0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# rextendr (development version)
22

3+
* Sets the release profile to use `lto=true` and `codegen-units=1` to ensure compatible builds with WebR as well as reduce the overall compiled package size <https://github.com/extendr/rextendr/pull/465>.
34
* Fixes compatibility with WebR by adding `CARGO_PROFILE_DEV_PANIC="abort" CARGO_PROFILE_RELEASE_PANIC="abort"` when targeting `wasm32-unknown-emsacripten` target <https://github.com/extendr/rextendr/pull/461>
45

56
# rextendr 0.4.1

R/use_extendr.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ use_extendr <- function(
136136
`rust-version` = "1.65"
137137
),
138138
lib = list(`crate-type` = array("staticlib", 1), name = lib_name),
139-
dependencies = list(`extendr-api` = "*")
139+
dependencies = list(`extendr-api` = "*"),
140+
`profile.release` = list(
141+
lto = TRUE,
142+
`codegen-units` = 1
143+
)
140144
)
141145

142146
use_rextendr_template(

tests/testthat/_snaps/use_extendr.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@
319319
320320
[dependencies]
321321
extendr-api = '*'
322+
323+
[profile.release]
324+
lto = true
325+
codegen-units = 1
322326

323327
---
324328

@@ -405,6 +409,10 @@
405409
406410
[dependencies]
407411
extendr-api = '*'
412+
413+
[profile.release]
414+
lto = true
415+
codegen-units = 1
408416

409417
# use_rextendr_template() can overwrite existing files
410418

0 commit comments

Comments
 (0)