diff --git a/DESCRIPTION b/DESCRIPTION index 7dd4a58..9470050 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: orbweaver Title: Fast and Efficient Graph Data Structures -Version: 0.14.0 +Version: 0.15.0 Authors@R: c(person(given = "ixpantia, SRL", role = "cph", diff --git a/LICENSE.note b/LICENSE.note index 373d7d3..05ce8e3 100644 --- a/LICENSE.note +++ b/LICENSE.note @@ -15,231 +15,7 @@ the licenses are the same as listed here. =============================== -Name: adler -Files: vendor/adler/* -Authors: Jonas Schievink -License: 0BSD OR MIT OR Apache-2.0 - ------------------------------- - -Name: ahash -Files: vendor/ahash/* -Authors: Tom Kaitchuck -License: MIT OR Apache-2.0 - ------------------------------- - -Name: byteorder -Files: vendor/byteorder/* -Authors: Andrew Gallant -License: Unlicense OR MIT - ------------------------------- - -Name: cfg-if -Files: vendor/cfg-if/* -Authors: Alex Crichton -License: MIT/Apache-2.0 - ------------------------------- - -Name: crc32fast -Files: vendor/crc32fast/* -Authors: Sam Rijs, Alex Crichton -License: MIT OR Apache-2.0 - ------------------------------- - -Name: crossbeam-deque -Files: vendor/crossbeam-deque/* -Authors: -License: MIT OR Apache-2.0 - ------------------------------- - -Name: crossbeam-epoch -Files: vendor/crossbeam-epoch/* +Name: +Files: vendor//* Authors: -License: MIT OR Apache-2.0 - ------------------------------- - -Name: crossbeam-utils -Files: vendor/crossbeam-utils/* -Authors: -License: MIT OR Apache-2.0 - ------------------------------- - -Name: either -Files: vendor/either/* -Authors: bluss -License: MIT OR Apache-2.0 - ------------------------------- - -Name: extendr-api -Files: vendor/extendr-api/* -Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Hiroaki Yutani, Ilia A. Kosenkov, Michael Milton -License: MIT - ------------------------------- - -Name: extendr-macros -Files: vendor/extendr-macros/* -Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Hiroaki Yutani, Ilia A. Kosenkov -License: MIT - ------------------------------- - -Name: flate2 -Files: vendor/flate2/* -Authors: Alex Crichton, Josh Triplett -License: MIT OR Apache-2.0 - ------------------------------- - -Name: fxhash -Files: vendor/fxhash/* -Authors: cbreeden -License: Apache-2.0/MIT - ------------------------------- - -Name: half -Files: vendor/half/* -Authors: Kathryn Long -License: MIT OR Apache-2.0 - ------------------------------- - -Name: hashbrown -Files: vendor/hashbrown/* -Authors: Amanieu d'Antras -License: MIT OR Apache-2.0 - ------------------------------- - -Name: libR-sys -Files: vendor/libR-sys/* -Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Ilia A. Kosenkov, Hiroaki Yutani -License: MIT - ------------------------------- - -Name: miniz_oxide -Files: vendor/miniz_oxide/* -Authors: Frommi, oyvindln -License: MIT OR Zlib OR Apache-2.0 - ------------------------------- - -Name: once_cell -Files: vendor/once_cell/* -Authors: Aleksey Kladov -License: MIT OR Apache-2.0 - ------------------------------- - -Name: orbweaver -Files: vendor/orbweaver/* -Authors: ixpantia, Andrés F. Quintero -License: MIT - ------------------------------- - -Name: paste -Files: vendor/paste/* -Authors: David Tolnay -License: MIT OR Apache-2.0 - ------------------------------- - -Name: proc-macro2 -Files: vendor/proc-macro2/* -Authors: David Tolnay, Alex Crichton -License: MIT OR Apache-2.0 - ------------------------------- - -Name: quote -Files: vendor/quote/* -Authors: David Tolnay -License: MIT OR Apache-2.0 - ------------------------------- - -Name: rayon-core -Files: vendor/rayon-core/* -Authors: Niko Matsakis, Josh Stone -License: MIT OR Apache-2.0 - ------------------------------- - -Name: rayon -Files: vendor/rayon/* -Authors: Niko Matsakis, Josh Stone -License: MIT OR Apache-2.0 - ------------------------------- - -Name: serde_cbor -Files: vendor/serde_cbor/* -Authors: Pyfisch, Steven Fackler -License: MIT/Apache-2.0 - ------------------------------- - -Name: serde_derive -Files: vendor/serde_derive/* -Authors: Erick Tryzelaar, David Tolnay -License: MIT OR Apache-2.0 - ------------------------------- - -Name: serde -Files: vendor/serde/* -Authors: Erick Tryzelaar, David Tolnay -License: MIT OR Apache-2.0 - ------------------------------- - -Name: string-interner -Files: vendor/string-interner/* -Authors: Robbepop -License: MIT/Apache-2.0 - ------------------------------- - -Name: syn -Files: vendor/syn/* -Authors: David Tolnay -License: MIT OR Apache-2.0 - ------------------------------- - -Name: unicode-ident -Files: vendor/unicode-ident/* -Authors: David Tolnay -License: (MIT OR Apache-2.0) AND Unicode-DFS-2016 - ------------------------------- - -Name: version_check -Files: vendor/version_check/* -Authors: Sergio Benitez -License: MIT/Apache-2.0 - ------------------------------- - -Name: zerocopy-derive -Files: vendor/zerocopy-derive/* -Authors: Joshua Liebow-Feeser -License: BSD-2-Clause OR Apache-2.0 OR MIT - ------------------------------- - -Name: zerocopy -Files: vendor/zerocopy/* -Authors: Joshua Liebow-Feeser -License: BSD-2-Clause OR Apache-2.0 OR MIT +License: diff --git a/configure b/configure index d656e00..0f4c1be 100755 --- a/configure +++ b/configure @@ -1,20 +1,3 @@ #!/usr/bin/env sh - -# https://github.com/eitsupi/prqlr/blob/main/configure -export PATH="$PATH:$HOME/.cargo/bin" - -if [ ! "$(command -v cargo)" ]; then - echo "----------------------- [RUST NOT FOUND]---------------------------" - echo "The 'cargo' command was not found on the PATH. Please install rustc" - echo "from: https://www.rust-lang.org/tools/install" - echo "" - echo "Alternatively, you may install cargo from your OS package manager:" - echo " - Debian/Ubuntu: apt-get install cargo" - echo " - Fedora/CentOS: dnf install cargo" - echo " - macOS: brew install rustc" - echo "-------------------------------------------------------------------" - echo "" - exit 1 -fi - -exit 0 +: "${R_HOME=`R RHOME`}" +"${R_HOME}/bin/Rscript" tools/msrv.R diff --git a/configure.win b/configure.win index d9b66ed..f1945ac 100644 --- a/configure.win +++ b/configure.win @@ -1,15 +1,2 @@ -#!/bin/sh - -# https://github.com/eitsupi/prqlr/blob/main/configure.win -export PATH="$PATH:$HOME/.cargo/bin" - -if [ ! "$(command -v cargo)" ]; then - echo "----------------------- [RUST NOT FOUND]---------------------------" - echo "The 'cargo' command was not found on the PATH. Please install rustc" - echo "from: https://www.rust-lang.org/tools/install" - echo "-------------------------------------------------------------------" - echo "" - exit 1 -fi - -exit 0 +#!/usr/bin/env sh +"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" tools/msrv.R diff --git a/inst/AUTHORS b/inst/AUTHORS index 2696944..aeef038 100644 --- a/inst/AUTHORS +++ b/inst/AUTHORS @@ -1,126 +1,4 @@ The authors of the dependency Rust crates: -adler (version 1.0.2): - Jonas Schievink - -ahash (version 0.8.11): - Tom Kaitchuck - -byteorder (version 1.5.0): - Andrew Gallant - -cfg-if (version 1.0.0): - Alex Crichton - -crc32fast (version 1.4.2): - Sam Rijs - Alex Crichton - -crossbeam-deque (version 0.8.5): - - -crossbeam-epoch (version 0.9.18): - - -crossbeam-utils (version 0.8.20): + (version ): - -either (version 1.12.0): - bluss - -extendr-api (version 0.6.0): - andy-thomason - Thomas Down - Mossa Merhi Reimert - Claus O. Wilke - Hiroaki Yutani - Ilia A. Kosenkov - Michael Milton - -extendr-macros (version 0.6.0): - andy-thomason - Thomas Down - Mossa Merhi Reimert - Claus O. Wilke - Hiroaki Yutani - Ilia A. Kosenkov - -flate2 (version 1.0.30): - Alex Crichton - Josh Triplett - -fxhash (version 0.2.1): - cbreeden - -half (version 1.8.3): - Kathryn Long - -hashbrown (version 0.14.5): - Amanieu d'Antras - -libR-sys (version 0.6.0): - andy-thomason - Thomas Down - Mossa Merhi Reimert - Claus O. Wilke - Ilia A. Kosenkov - Hiroaki Yutani - -miniz_oxide (version 0.7.3): - Frommi - oyvindln - -once_cell (version 1.19.0): - Aleksey Kladov - -orbweaver (version 0.9.0): - ixpantia - Andrés F. Quintero - -paste (version 1.0.15): - David Tolnay - -proc-macro2 (version 1.0.85): - David Tolnay - Alex Crichton - -quote (version 1.0.36): - David Tolnay - -rayon-core (version 1.12.1): - Niko Matsakis - Josh Stone - -rayon (version 1.10.0): - Niko Matsakis - Josh Stone - -serde_cbor (version 0.11.2): - Pyfisch - Steven Fackler - -serde_derive (version 1.0.203): - Erick Tryzelaar - David Tolnay - -serde (version 1.0.203): - Erick Tryzelaar - David Tolnay - -string-interner (version 0.17.0): - Robbepop - -syn (version 2.0.66): - David Tolnay - -unicode-ident (version 1.0.12): - David Tolnay - -version_check (version 0.9.4): - Sergio Benitez - -zerocopy-derive (version 0.7.34): - Joshua Liebow-Feeser - -zerocopy (version 0.7.34): - Joshua Liebow-Feeser diff --git a/src/Makevars.win b/src/Makevars.win index 554f2a9..8e65288 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -13,13 +13,6 @@ CRAN_FLAGS=-j 2 --offline CARGOTMP = $(CURDIR)/.cargo VENDOR_DIR = $(CURDIR)/vendor -all: C_clean - -$(SHLIB): $(STATLIB) - -CRAN_FLAGS=-j 2 --offline -CARGOTMP = $(CURDIR)/.cargo - $(STATLIB): # uncompress vendored deps if [ -f ./rust/vendor.tar.xz ]; then \ diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 14b2a71..39cff0d 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -132,8 +132,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "orbweaver" -version = "0.14.0" -source = "git+https://github.com/ixpantia/orbweaver-rs.git?rev=b397ad8aa389bcc17aef17593302adb7af765c21#b397ad8aa389bcc17aef17593302adb7af765c21" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbeaad559ff389ba4afe076543487a2c9563bdaa5b58ab324f5c2136a1630c75" dependencies = [ "flate2", "fxhash", diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index f9eb03a..175fb99 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -9,7 +9,7 @@ name = 'orbweaver_r' [dependencies] extendr-api = { version = "0.7", features = ["serde"] } -orbweaver = { git = "https://github.com/ixpantia/orbweaver-rs.git", rev = "b397ad8aa389bcc17aef17593302adb7af765c21" } +orbweaver = { version = "0.15" } # This will help us filter the platforms # we support to make the final bundle size diff --git a/src/rust/vendor-config.toml b/src/rust/vendor-config.toml index 53a5f3c..0236928 100644 --- a/src/rust/vendor-config.toml +++ b/src/rust/vendor-config.toml @@ -1,10 +1,5 @@ [source.crates-io] replace-with = "vendored-sources" -[source."git+https://github.com/ixpantia/orbweaver-rs.git?rev=b397ad8aa389bcc17aef17593302adb7af765c21"] -git = "https://github.com/ixpantia/orbweaver-rs.git" -rev = "b397ad8aa389bcc17aef17593302adb7af765c21" -replace-with = "vendored-sources" - [source.vendored-sources] directory = "vendor" diff --git a/src/rust/vendor.tar.xz b/src/rust/vendor.tar.xz index 77f1f49..680d3d5 100644 Binary files a/src/rust/vendor.tar.xz and b/src/rust/vendor.tar.xz differ diff --git a/tools/msrv.R b/tools/msrv.R new file mode 100644 index 0000000..baa33aa --- /dev/null +++ b/tools/msrv.R @@ -0,0 +1,116 @@ +# read the DESCRIPTION file +desc <- read.dcf("DESCRIPTION") + +if (!"SystemRequirements" %in% colnames(desc)) { + fmt <- c( + "`SystemRequirements` not found in `DESCRIPTION`.", + "Please specify `SystemRequirements: Cargo (Rust's package manager), rustc`" + ) + stop(paste(fmt, collapse = "\n")) +} + +# extract system requirements +sysreqs <- desc[, "SystemRequirements"] + +# check that cargo and rustc is found +if (!grepl("cargo", sysreqs, ignore.case = TRUE)) { + stop("You must specify `Cargo (Rust's package manager)` in your `SystemRequirements`") +} + +if (!grepl("rustc", sysreqs, ignore.case = TRUE)) { + stop("You must specify `Cargo (Rust's package manager), rustc` in your `SystemRequirements`") +} + +# split into parts +parts <- strsplit(sysreqs, ", ")[[1]] + +# identify which is the rustc +rustc_ver <- parts[grepl("rustc", parts)] + +# perform checks for the presence of rustc and cargo on the OS +no_cargo_msg <- c( + "----------------------- [CARGO NOT FOUND]--------------------------", + "The 'cargo' command was not found on the PATH. Please install Cargo", + "from: https://www.rust-lang.org/tools/install", + "", + "Alternatively, you may install Cargo from your OS package manager:", + " - Debian/Ubuntu: apt-get install cargo", + " - Fedora/CentOS: dnf install cargo", + " - macOS: brew install rustc", + "-------------------------------------------------------------------" +) + +no_rustc_msg <- c( + "----------------------- [RUST NOT FOUND]---------------------------", + "The 'rustc' compiler was not found on the PATH. Please install", + paste(rustc_ver, "or higher from:"), + "https://www.rust-lang.org/tools/install", + "", + "Alternatively, you may install Rust from your OS package manager:", + " - Debian/Ubuntu: apt-get install rustc", + " - Fedora/CentOS: dnf install rustc", + " - macOS: brew install rustc", + "-------------------------------------------------------------------" +) + +# Add {user}/.cargo/bin to path before checking +new_path <- paste0( + Sys.getenv("PATH"), + ":", + paste0(Sys.getenv("HOME"), "/.cargo/bin") +) + +# set the path with the new path +Sys.setenv("PATH" = new_path) + +# check for rustc installation +rustc_version <- tryCatch( + system("rustc --version", intern = TRUE), + error = function(e) { + stop(paste(no_rustc_msg, collapse = "\n")) + } +) + +# check for cargo installation +cargo_version <- tryCatch( + system("cargo --version", intern = TRUE), + error = function(e) { + stop(paste(no_cargo_msg, collapse = "\n")) + } +) + +# helper function to extract versions +extract_semver <- function(ver) { + if (grepl("\\d+\\.\\d+(\\.\\d+)?", ver)) { + sub(".*?(\\d+\\.\\d+(\\.\\d+)?).*", "\\1", ver) + } else { + NA + } +} + +# get the MSRV +msrv <- extract_semver(rustc_ver) + +# extract current version +current_rust_version <- extract_semver(rustc_version) + +# perform check +if (!is.na(msrv)) { + # -1 when current version is later + # 0 when they are the same + # 1 when MSRV is newer than current + is_msrv <- utils::compareVersion(msrv, current_rust_version) + if (is_msrv == 1) { + fmt <- paste0( + "\n------------------ [UNSUPPORTED RUST VERSION]------------------\n", + "- Minimum supported Rust version is %s.\n", + "- Installed Rust version is %s.\n", + "---------------------------------------------------------------" + ) + stop(sprintf(fmt, msrv, current_rust_version)) + } +} + +# print the versions +versions_fmt <- "Using %s\nUsing %s" +message(sprintf(versions_fmt, cargo_version, rustc_version))