From 3d6741f455a3f0177ec4965c3af5f40ef52bbdb0 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Fri, 7 Jul 2023 10:26:01 +0900 Subject: [PATCH] Regenerate with the latest rextendr (#22) --- .Rbuildignore | 1 + DESCRIPTION | 1 + R/extendr-wrappers.R | 7 ----- src/.gitignore | 1 + src/Makevars | 11 +++++++- src/Makevars.win | 13 +++++++-- src/rust/Cargo.lock | 63 +++++++++++++------------------------------- src/rust/Cargo.toml | 1 + 8 files changed, 44 insertions(+), 54 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 2580db3..798908b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,4 @@ ^tests/testthat/_snaps$ ^\.github$ +^src/\.cargo$ diff --git a/DESCRIPTION b/DESCRIPTION index aa8b2ed..14827a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,3 +18,4 @@ RoxygenNote: 7.2.3 Suggests: rmarkdown, testthat +Config/rextendr/version: 0.3.1.9000 diff --git a/R/extendr-wrappers.R b/R/extendr-wrappers.R index 2a01f73..f2e34c6 100644 --- a/R/extendr-wrappers.R +++ b/R/extendr-wrappers.R @@ -1,11 +1,5 @@ -# Generated by extendr: Do not edit by hand - # nolint start -# -# This file was created with the following call: -# .Call("wrap__make_helloextendr_wrappers", use_symbols = TRUE, package_name = "helloextendr") - #' @docType package #' @usage NULL #' @useDynLib helloextendr, .registration = TRUE @@ -15,5 +9,4 @@ NULL #' @export hello_world <- function() .Call(wrap__hello_world) - # nolint end diff --git a/src/.gitignore b/src/.gitignore index 0acc02d..c23c7b3 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -2,3 +2,4 @@ *.so *.dll target +.cargo diff --git a/src/Makevars b/src/Makevars index c0f07e4..ccab448 100644 --- a/src/Makevars +++ b/src/Makevars @@ -7,12 +7,21 @@ all: C_clean $(SHLIB): $(STATLIB) +CARGOTMP = $(CURDIR)/.cargo + $(STATLIB): # In some environments, ~/.cargo/bin might not be included in PATH, so we need # to set it here to ensure cargo can be invoked. It is appended to PATH and # therefore is only used if cargo is absent from the user's PATH. - export PATH="$(PATH):$(HOME)/.cargo/bin" && \ + if [ "$(NOT_CRAN)" != "true" ]; then \ + export CARGO_HOME=$(CARGOTMP); \ + fi && \ + export PATH="$(PATH):$(HOME)/.cargo/bin" && \ cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) + if [ "$(NOT_CRAN)" != "true" ]; then \ + rm -Rf $(CARGOTMP) && \ + rm -Rf $(LIBDIR)/build; \ + fi C_clean: rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) diff --git a/src/Makevars.win b/src/Makevars.win index 19efbf7..40c4a1c 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -9,6 +9,8 @@ all: C_clean $(SHLIB): $(STATLIB) +CARGOTMP = $(CURDIR)/.cargo + $(STATLIB): mkdir -p $(TARGET_DIR)/libgcc_mock # `rustc` adds `-lgcc_eh` flags to the compiler, but Rtools' GCC doesn't have @@ -20,12 +22,19 @@ $(STATLIB): touch $(TARGET_DIR)/libgcc_mock/libgcc_eh.a # CARGO_LINKER is provided in Makevars.ucrt for R >= 4.2 - export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \ + if [ "$(NOT_CRAN)" != "true" ]; then \ + export CARGO_HOME=$(CARGOTMP); \ + fi && \ + export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \ export LIBRARY_PATH="$${LIBRARY_PATH};$(CURDIR)/$(TARGET_DIR)/libgcc_mock" && \ cargo build --target=$(TARGET) --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR) + if [ "$(NOT_CRAN)" != "true" ]; then \ + rm -Rf $(CARGOTMP) && \ + rm -Rf $(LIBDIR)/build; \ + fi C_clean: rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) clean: - rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) rust/target + rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) $(TARGET_DIR) diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index e3fe31e..d92c366 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "extendr-api" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ddc930e3d31c8c1a694ae2046919d24488ee07822b8f585baa3dc4f733071d" +checksum = "1e36d66fa307948c291a6fc5b09d8295dd58e88ab5e8d782d30e23670113e9ab" dependencies = [ "extendr-engine", "extendr-macros", @@ -17,18 +17,18 @@ dependencies = [ [[package]] name = "extendr-engine" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1f8530ca57a3cf70225c59cfa127cc412b4c52f8a95d45b3f79b5c68349ef4" +checksum = "8298d5a2e38bb91820b92bbd7e5aaf1d3b95ed9f096fc66393c50af38ff8155d" dependencies = [ "libR-sys", ] [[package]] name = "extendr-macros" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90d5d38a703fd5d0168f86abd4c2f6b9d3dbb2d4ae2f654221575b528221ea0c" +checksum = "09bf0849f0d48209be8163378248137fed5ccb5f464d171cf93a19f31a9e6c67" dependencies = [ "proc-macro2", "quote", @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "helloextendr" -version = "0.1.0" +version = "0.3.0" dependencies = [ "extendr-api", ] @@ -50,42 +50,39 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libR-sys" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a97fd689379c62156b5c9b7b368d118ef660ad8c220a2f3e4c655529ad52384" -dependencies = [ - "winapi", -] +checksum = "cd728a97b9b0975f546bc865a7413e0ce6f98a8f6cea52e77dc5ee0bcea00adf" [[package]] name = "paste" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -94,28 +91,6 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 2d533c0..85fa259 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -1,5 +1,6 @@ [package] name = 'helloextendr' +publish = false version = '0.3.0' edition = '2021'