Repository: single-cell-data/TileDB-SOMA (language: python)

Issue:
[r] Remove core version check
This was very much put in place for a good reason at the time it was put in place. However, as of recently we no longer use the tiledb-r path to read or write arrays.
[r/ci] R CI fails today with "Error in readRDS(dest) : error reading from connection"
R CI has a persistent fail this morning on multiple PRs (I don't believe it to be due to anything we've changed) -- example

https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11744407390/job/32719440280

```
[1] "methods"   "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
Error in readRDS(dest) : error reading from connection
Calls: <Anonymous> ... eval -> eval -> <Anonymous> -> <Anonymous> -> readRDS
```

[[sc-59087]](https://app.shortcut.com/tiledb-inc/story/59087/r-ci-r-ci-fails-today-with-error-in-readrds-dest-error-reading-from-connection-3314)

## Docker repro

```
$ alias dreb
alias dreb='docker run --rm -it --entrypoint=/bin/bash'

$ dreb eddelbuettel/r2u:jammy

# apt-get update
# apt-get install -y git cmake

# cd /tmp
# git clone https://github.com/single-cell-data/TileDB-SOMA
# cd TileDB-SOMA
```

Then follow lines from our [r-ci.yml](https://github.com/single-cell-data/TileDB-SOMA/blob/main/.github/workflows/r-ci.yml):

```
# cd apis/r

# tools/r-ci.sh bootstrap
```

Then run these in R:

```
rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
repo <- "https://tiledb-inc.r-universe.dev"
(opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")), timeout = 300L)', repo, codename, rversion, repo))
cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
```

Then

```
# Rscript tools/install-tiledb-r.R

  comp   vers
1   >= 0.30.0
[1] "methods"   "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
Error in readRDS(dest) : error reading from connection
Calls: <Anonymous> ... eval -> eval -> <Anonymous> -> <Anonymous> -> readRDS
Execution halted
```

In an R session so I can get a traceback:

```
>
> source('tools/install-tiledb-r.R')
Error in readRDS(dest) : error reading from connection
> traceback()
12: readRDS(dest)
11: utils::available.packages(contriburl = contriburl, method = method,
        ...)
10: (utils::getFromNamespace("install_both", asNamespace("bspm")))(pkgs,
        contriburl, method, dependencies, ...)
9: eval(expr, p)
8: eval(expr, p)
7: eval.parent(exprObj)
6: .doTrace({
       if (missing(pkgs))
           stop("no packages were specified")
       if (type == "both" && !getOption("bspm.version.check", TRUE))
           type <- "binary-source"
       if (is.null(repos)) {
           type <- "source"
       }
       else if (type == "both") {
           pkgs <- (utils::getFromNamespace("install_both", asNamespace("bspm")))(pkgs,
               contriburl, method, dependencies, ...)
           type <- "source"
       }
       else if (type == "binary") {
           if (!length(pkgs <- bspm::install_sys(pkgs)))
               type <- "source"
       }
       else if (type == "binary-source") {
           type <- "both"
           pkgs <- (utils::getFromNamespace("install_fast", asNamespace("bspm")))(pkgs,
               contriburl, method, ...)
           type <- "source"
       }
   })
5: utils::install.packages(intersect(ups, rownames(db))) at install-tiledb-r.R#48
4: eval(ei, envir)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("tools/install-tiledb-r.R")
```
[r/ci] R CI fails today with "Error in readRDS(dest) : error reading from connection"
R CI has a persistent fail this morning on multiple PRs (I don't believe it to be due to anything we've changed) -- example

https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11744407390/job/32719440280

```
[1] "methods"   "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
Error in readRDS(dest) : error reading from connection
Calls: <Anonymous> ... eval -> eval -> <Anonymous> -> <Anonymous> -> readRDS
```

[[sc-59087]](https://app.shortcut.com/tiledb-inc/story/59087/r-ci-r-ci-fails-today-with-error-in-readrds-dest-error-reading-from-connection-3314)

## Docker repro

```
$ alias dreb
alias dreb='docker run --rm -it --entrypoint=/bin/bash'

$ dreb eddelbuettel/r2u:jammy

# apt-get update
# apt-get install -y git cmake

# cd /tmp
# git clone https://github.com/single-cell-data/TileDB-SOMA
# cd TileDB-SOMA
```

Then follow lines from our [r-ci.yml](https://github.com/single-cell-data/TileDB-SOMA/blob/main/.github/workflows/r-ci.yml):

```
# cd apis/r

# tools/r-ci.sh bootstrap
```

Then run these in R:

```
rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
repo <- "https://tiledb-inc.r-universe.dev"
(opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")), timeout = 300L)', repo, codename, rversion, repo))
cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
```

Then

```
# Rscript tools/install-tiledb-r.R

  comp   vers
1   >= 0.30.0
[1] "methods"   "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
Error in readRDS(dest) : error reading from connection
Calls: <Anonymous> ... eval -> eval -> <Anonymous> -> <Anonymous> -> readRDS
Execution halted
```

In an R session so I can get a traceback:

```
>
> source('tools/install-tiledb-r.R')
Error in readRDS(dest) : error reading from connection
> traceback()
12: readRDS(dest)
11: utils::available.packages(contriburl = contriburl, method = method,
        ...)
10: (utils::getFromNamespace("install_both", asNamespace("bspm")))(pkgs,
        contriburl, method, dependencies, ...)
9: eval(expr, p)
8: eval(expr, p)
7: eval.parent(exprObj)
6: .doTrace({
       if (missing(pkgs))
           stop("no packages were specified")
       if (type == "both" && !getOption("bspm.version.check", TRUE))
           type <- "binary-source"
       if (is.null(repos)) {
           type <- "source"
       }
       else if (type == "both") {
           pkgs <- (utils::getFromNamespace("install_both", asNamespace("bspm")))(pkgs,
               contriburl, method, dependencies, ...)
           type <- "source"
       }
       else if (type == "binary") {
           if (!length(pkgs <- bspm::install_sys(pkgs)))
               type <- "source"
       }
       else if (type == "binary-source") {
           type <- "both"
           pkgs <- (utils::getFromNamespace("install_fast", asNamespace("bspm")))(pkgs,
               contriburl, method, ...)
           type <- "source"
       }
   })
5: utils::install.packages(intersect(ups, rownames(db))) at install-tiledb-r.R#48
4: eval(ei, envir)
3: eval(ei, envir)
2: withVisible(eval(ei, envir))
1: source("tools/install-tiledb-r.R")
```


Discussion / hints:
@mojaveazure Maybe in a follow-up PR?
Yeah, that should be a follow-up, I was just making a note of what else can be done thanks to the relaxing of tiledb-r versions. The current CI is working, and that's good enough for now
Running lines from `tools/install-tiledb.R` interactively:

```
> utils::install.packages(intersect(ups, rownames(db)))
Error in readRDS(dest) : error reading from connection

> intersect(ups, rownames(db))
[1] "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
```

```
> utils::install.packages('Rcpp')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('nanotime')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('spdl')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('nanoarrow')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('RcppInt64')
Error in readRDS(dest) : error reading from connection
```
When I comment out the `.Rprofile` line
```
options(repos = c("https://tiledb-inc.r-universe.dev/bin/linux/jammy/4.4", "https://tiledb-inc.r-universe.dev", getOption("repos")), timeout = 300L)
```
then the `tools/install-tiledb-r.R` runs successfully
A re-run of https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11745810131/job/32724737665 is now not failing ...
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11745810131/job/32724737665 just ran to completion.

Problem appears to have been transient.

cc @mojaveazure 
@mojaveazure has some follow-up thoughts which he understands well; re-assigning
Running lines from `tools/install-tiledb.R` interactively:

```
> utils::install.packages(intersect(ups, rownames(db)))
Error in readRDS(dest) : error reading from connection

> intersect(ups, rownames(db))
[1] "Rcpp"      "nanotime"  "spdl"      "nanoarrow" "RcppInt64"
```

```
> utils::install.packages('Rcpp')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('nanotime')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('spdl')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('nanoarrow')
Error in readRDS(dest) : error reading from connection
> utils::install.packages('RcppInt64')
Error in readRDS(dest) : error reading from connection
```
When I comment out the `.Rprofile` line
```
options(repos = c("https://tiledb-inc.r-universe.dev/bin/linux/jammy/4.4", "https://tiledb-inc.r-universe.dev", getOption("repos")), timeout = 300L)
```
then the `tools/install-tiledb-r.R` runs successfully
A re-run of https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11745810131/job/32724737665 is now not failing ...
https://github.com/single-cell-data/TileDB-SOMA/actions/runs/11745810131/job/32724737665 just ran to completion.

Problem appears to have been transient.

cc @mojaveazure 
@mojaveazure has some follow-up thoughts which he understands well; re-assigning

Fix patch:
diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml
index bf045172b4..c9dfd1c6d5 100644
--- a/.github/workflows/pkgdown.yaml
+++ b/.github/workflows/pkgdown.yaml
@@ -31,23 +31,6 @@ jobs:
         with:
           use-public-rspm: true
 
-      - name: Set additional repositories (macOS)
-        if: ${{ matrix.os != 'ubuntu-latest' }}
-        run: echo 'options(repos = c("https://tiledb-inc.r-universe.dev", getOption("repos")), timeout = 300L)' | tee -a ~/.Rprofile
-
-      - name: Set additional repositories (Linux)
-        if: ${{ matrix.os == 'ubuntu-latest' }}
-        run: |
-          rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
-          codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
-          repo <- "https://tiledb-inc.r-universe.dev"
-          (opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")), timeout = 300L)', repo, codename, rversion, repo))
-          cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
-        shell: Rscript {0}
-
-      - name: Install tiledb-r
-        run: cd apis/r && Rscript tools/install-tiledb-r.R
-
       # Run this daily to surface errors as tracked at
       # https://github.com/single-cell-data/TileDB-SOMA/issues/2052
       - name: Install dependencies
diff --git a/.github/workflows/r-ci.yml b/.github/workflows/r-ci.yml
index 7c75fa2507..1d9c3e7e33 100644
--- a/.github/workflows/r-ci.yml
+++ b/.github/workflows/r-ci.yml
@@ -60,23 +60,6 @@ jobs:
       - name: Bootstrap
         run: cd apis/r && tools/r-ci.sh bootstrap
 
-      - name: Set additional repositories (macOS)
-        if: ${{ matrix.os != 'ubuntu-latest' }}
-        run: echo 'options(repos = c("https://tiledb-inc.r-universe.dev", getOption("repos")), timeout = 300L)' | tee -a ~/.Rprofile
-
-      - name: Set additional repositories (Linux)
-        if: ${{ matrix.os == 'ubuntu-latest' }}
-        run: |
-          rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
-          codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
-          repo <- "https://tiledb-inc.r-universe.dev"
-          (opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")), timeout = 300L)', repo, codename, rversion, repo))
-          cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
-        shell: Rscript {0}
-
-      - name: Install tiledb-r
-        run: cd apis/r && Rscript tools/install-tiledb-r.R
-
       - name: Install BioConductor package SingleCellExperiment
         run: cd apis/r && tools/r-ci.sh install_bioc SingleCellExperiment
 
diff --git a/.github/workflows/r-valgrind.yaml b/.github/workflows/r-valgrind.yaml
index 6a84c0d235..83647109a6 100644
--- a/.github/workflows/r-valgrind.yaml
+++ b/.github/workflows/r-valgrind.yaml
@@ -25,18 +25,6 @@ jobs:
       - name: System Dependencies
         run: apt update -qq && apt upgrade --yes && apt install --yes --no-install-recommends valgrind cmake git
 
-      - name: Set additional repositories (Linux)
-        run: |
-          rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
-          codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
-          repo <- "https://tiledb-inc.r-universe.dev"
-          (opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")), timeout = 300L)', repo, codename, rversion, repo))
-          cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
-        shell: Rscript {0}
-
-      - name: Install tiledb-r
-        run: cd apis/r && Rscript tools/install-tiledb-r.R
-
       - name: Package Dependencies
         run: cd apis/r && R -q -e 'remotes::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
 


Test patch:
diff --git a/.github/workflows/r-python-interop-testing.yml b/.github/workflows/r-python-interop-testing.yml
index 079ee15331..0ae38b5c57 100644
--- a/.github/workflows/r-python-interop-testing.yml
+++ b/.github/workflows/r-python-interop-testing.yml
@@ -32,19 +32,6 @@ jobs:
       - name: Bootstrap
         run: cd apis/r && tools/r-ci.sh bootstrap
 
-      - name: Set additional repositories (Linux)
-        if: ${{ matrix.os == 'ubuntu-latest' }}
-        run: |
-          rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
-          codename <-  system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
-          repo <- "https://tiledb-inc.r-universe.dev"
-          (opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")))', repo, codename, rversion, repo))
-          cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
-        shell: Rscript {0}
-
-      - name: Install tiledb-r
-        run: cd apis/r && Rscript tools/install-tiledb-r.R
-
       - name: Dependencies
         run: cd apis/r && Rscript -e "remotes::install_deps(dependencies = TRUE, upgrade = FALSE)"