Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report CRAN rust versions #40

Open
JosiahParry opened this issue Sep 7, 2024 · 1 comment
Open

Report CRAN rust versions #40

JosiahParry opened this issue Sep 7, 2024 · 1 comment

Comments

@JosiahParry
Copy link
Contributor

We can begin reporting CRAN's rust versions by using this script.
It relies on the CRAN check status of @albersonmiranda's {fio} package

library(rvest)

check_links <- "https://cran.r-project.org/web/checks/check_results_fio.html" |> 
  read_html() |> 
  html_node(".container") |> 
  html_nodes("a") |> 
  html_attr("href") 

check_links <- unique(check_links[grepl("^https://", check_links)])

install_logs <- gsub(
  "00check.html",
  "00install.html",
  check_links
)

extract_semver <- function(ver) {
  if (grepl("\\d+\\.\\d+(\\.\\d+)?", ver)) {
    sub(".*?(\\d+\\.\\d+(\\.\\d+)?).*", "\\1", ver)
  } else {
    NA
  }
}

versions <- lapply(install_logs, function(.log) {
  message("Extracting Rust & Cargo version from ", .log)
  lns <- readLines(.log)
  rust_version <- extract_semver(lns[grepl("^Rust version:", lns)])
  cargo_version <- extract_semver(lns[grepl("^Cargo version:", lns)])
  data.frame(rustc = rust_version, cargo = cargo_version)
})


# get all of the flavors
flavor <- dirname(
  gsub("https://www.r-project.org/nosvn/r.check/", "", tolower(install_logs))
)

res <- cbind(
  flavor = flavor,
  do.call(rbind.data.frame, versions)
) |> 
  dplyr::mutate(rustc = numeric_version(rustc), cargo = numeric_version(cargo)) |> 
  dplyr::arrange(rustc)
@JosiahParry
Copy link
Contributor Author

The MSRV of CRAN as of 2024-12-02:

flavor rustc cargo
r-devel-linux-x86_64-fedora-clang 1.69.0 1.69.0
r-devel-linux-x86_64-fedora-gcc 1.69.0 1.69.0
r-release-macos-arm64 1.70.0 1.70.0
r-release-macos-x86_64 1.70.0 1.70.0
r-oldrel-macos-arm64 1.70.0 1.70.0
r-oldrel-macos-x86_64 1.70.0 1.70.0
r-release-macos-arm64 1.70.0 1.70.0
r-release-macos-x86_64 1.70.0 1.70.0
r-oldrel-macos-arm64 1.70.0 1.70.0
r-oldrel-macos-x86_64 1.70.0 1.70.0
r-devel-windows-x86_64 1.81.0 1.81.0
r-release-linux-x86_64 1.81.0 1.81.0
r-release-windows-x86_64 1.81.0 1.81.0
r-oldrel-windows-x86_64 1.81.0 1.81.0
r-devel-linux-x86_64-debian-clang 1.82.0 1.82.0
r-devel-linux-x86_64-debian-gcc 1.82.0 1.82.0
r-patched-linux-x86_64 1.82.0 1.82.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant