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

'length(x) = 2 > 1' when installing evalcast dependency bettermc #651

Open
brookslogan opened this issue Jul 17, 2023 · 5 comments
Open

Comments

@brookslogan
Copy link
Collaborator

When attempting to install evalcast, or trying to install its dependency bettermc@v1.1.2 via renv, pak, remotes::install_github, remotes::install_local, or R CMD INSTALL, I get the following error:

*** installing help indices
  converting help for package ‘bettermc’
    finding HTML links ... done
    char_map                                html  
Error: 'length(x) = 2 > 1' in coercion to 'logical(1)'

I thought we selected this version because it somehow seemed to avoid this error, but I guess it does not. What does seem to work is:

  • Clone bettermc
  • Switch to v1.1.2 branch to satisfy evalcast's tag demand (hopefully)
  • Rename the man directory to something else, e.g., was_man (... or maybe just re-document()ing with latest devtools & roxygen2?? haven't tried this yet)
  • Install it via remotes::install_local etc.
  • Install evalcast

I'm on

R version 4.1.3 (2022-03-10)
remotes_2.4.2  renv_1.0.0

The 4.1.3 is probably related; perhaps this error is from using && or || with an arg that is a length-2 logical vector. And the issue appears to be in parsing the Rd files.

Aside from posting the hack above, it'd be nice if we could make evalcast installation work more smoothly. Maybe this means filing an Issue/PR to bettermc and seeing if we can update our dependency on it to the fixed version. Or maybe we could set up a fork to patch specifically v1.1.2.

@brookslogan
Copy link
Collaborator Author

Hacking around this issue is a bit harder if you are using an renv, as installing evalcast afterward appears to insist on installing the GitHub version of bettermc over the local version, unless the lockfile is updated with the local installation (which might not be portable across systems).

@dshemetov
Copy link
Collaborator

Do you get this issue just trying to install bettermc by itself? Like with pak::pkg_install("gfkse/bettermc@v1.2.1")?

@brookslogan
Copy link
Collaborator Author

Yes. I get the error trying direct installation with remotes, pak, renv, and R CMD INSTALL. (At some point I thought 1.2.1 was special and didn't give the error? But that's not the case now, or maybe ever.)

@dshemetov
Copy link
Collaborator

dshemetov commented Jul 22, 2023

Hm, I can't reproduce with remotes or pak. I'm on R 4.3.1. Might need to try this in those versioned Docker containers later.

Since this error is showing up in R 4.1.3, but not in R 4.3.1 (mine) and not in R 3.5 (their CI), this makes me think it's not an R version error, but something else particular to your installation.

@dshemetov
Copy link
Collaborator

This Dockerfile installs fine

FROM rocker/verse:4.1.3

RUN mkdir /app
WORKDIR /app

ARG GITHUB_PAT
ENV GITHUB_PAT=${GITHUB_PAT}

RUN R -e "remotes::install_github('gfkse/bettermc@v1.2.1')"

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

2 participants