AtlasOfLivingAustralia/galah-R

Problem installing galah on Linux from CRAN or GitHub

Closed this issue · 2 comments

Unable to install
This is using Ubuntu Linux 20.04 and R version 4.2.1. All relevant galah dependencies are installed. Latest CRAN and development versions of galah affected.

To reproduce
The standard install.packages("galah") fails, as does using remotes to install from Github. Here is the output:

Installing package into ‘/lvm/nras/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/galah_2.0.2.tar.gz'
Content type 'application/x-gzip' length 1940925 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

* installing *source* package ‘galah’ ...
** package ‘galah’ successfully unpacked and MD5 sums checked
** using staged installation
** R
Error in parse(outFile) : 
  /tmp/Rtmps2WnU6/R.INSTALL471d950f1df12/galah/R/build.R:157:27: unexpected input
156:                                      x = filters$query[!is_equals]) |>
157:       sub("\\]$", "", x = _
                               ^
ERROR: unable to collate and parse R files for package ‘galah’
* removing ‘/lvm/nras/R/x86_64-pc-linux-gnu-library/4.1/galah’
Warning in install.packages :
  installation of package ‘galah’ had non-zero exit status

Expected behaviour
Normal installation

Additional context
Installs on Windows 10. Older versions of galah (e.g. 1.5) install on Linux without problems.

Thanks for this @rasanderson! Interestingly this is the same bug reported by @williamlai2 here. There is definitely an issue with our DESCRIPTION, as it suggests galah 2.0.2 depends on R version 4.1.0 or greater, whereas this syntax was only introduced in R 4.2 (i.e. April 2022). However, that's not consistent with this issue persisting in version 4.2.1 as you report. Perhaps it's worth switching away from the use of native placeholders entirely, though I'm reluctant to do so if it's a legacy issue. Have you tried it on a more recent version of R?

Hi @mjwestgate
Yes, this looks like an R version issue. I found a colleague's Linux box that has R 4.2.2 and have just tried it on that: on the newer version galah installs without problems and runs fine. On my Linux machine with the slightly older R 4.1.2, galah failed to install, so it's obviously to do with the minor change in R syntax between the two versions.