Skip to content

update_cache_binaries(): length(x) = 2 > 1' in coercion to 'logical(1) ERROR #35

Closed

Description

@HenrikBengtsson

In update_cache_binaries(), there's:

if ("INSTALL_opts" %in% names(args) &&
grepl("--no-test-load", args$INSTALL_opts, fixed = TRUE)) return()

That grepl() statement can resolve to a logical vector of any length.

I just ran into this indirectly (sorry, tried but fail to reproduce and don't have much time) where I ran with:

_R_CHECK_LENGTH_1_CONDITION=true
_R_CHECK_LENGTH_1_LOGIC2_=true

and received:

...
Adding 'fs_1.3.0.tar.gz' to the cache
Error in "INSTALL_opts" %in% names(args) && grepl("--no-test-load", args$INSTALL_opts,  : 
  'length(x) = 2 > 1' in coercion to 'logical(1)'
Calls: <Anonymous> ... update_cache -> update_cache_safe -> update_cache_binaries

Activity

  1. jennybc commented on Apr 5, 2022

    @jennybc
    Member

    I just hit this in a bookdown render workflow (which is neither here nor there). I doubt it really matters, but in case there's useful info, here's what it looked like:

    trying URL 'https://cloud.r-project.org/bin/macosx/contrib/4.1/magrittr_2.0.3.tgz'
    Content type 'application/x-gzip' length 227497 bytes (222 KB)
    ==================================================
    downloaded 222 KB
    
    Quitting from lines 1018-1019 (Whole-game.Rmd) 
    Error in "INSTALL_opts" %in% names(args) && grepl("--no-test-load", args$INSTALL_opts,  : 
      'length(x) = 2 > 1' in coercion to 'logical(1)'
    Calls: local ... update_cache -> update_cache_safe -> update_cache_binaries
    In addition: Warning message:
    In in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,  :
      You changed the working directory to /private/tmp/RtmpdCJdRv/regexcite (probably via setwd()). It will be restored to /Users/jenny/rrr/r-pkgs. See the Note section in ?knitr::knit
    
    ✓ Setting active project to '<no active project>'
    Execution halted
    Error in Rscript_render(f, render_args, render_meta, add1, add2) : 
      Failed to compile Whole-game.Rmd
    

    I didn't really intend that rendering the book would install/update a package, so I'll go sort that out myself.

    But just a reminder that there's still a condition length > 1 thing going on here. Like @HenrikBengtsson, I've got env vars setup to surface this.

  2. llrs commented on Jul 25, 2023

    @llrs

    I think this (and #45) is fixed in fc51e31. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions