Skip to content

bslib dependencies fail during file copy when installed read-only #1154

@natashanath

Description

@natashanath

Permission denied when using precompiled css from a read-only bslib installation

In enterprise settings it is not uncommon to have a centralized library of packages where everything is installed read-only and maintained by designated users/teams. Another use case which is quickly gaining popularity is using Nix package manager for maintaining data science environments. Nix also installs everything read-only.

file.copy(precompiled_css, out_file)

One solution would be to add copy.mode = FALSE to the file.copy calls, so that the file mode attributes are not preserved.

This fails in applications that call bslib internally, like elmer

library(S7)
library(httr2)
library(coro)
library(shinychat)
library(elmer)

chat <- chat_ollama(
  model = 'zephyr7b',
  system_prompt = 'You are a friendly but terse coding assistant. You are an expert in R, Python, SQL.',
  echo = TRUE
)
elmer::live_browser(chat)
# UI error displayed:
An error occurred: inherits(pool, "curl_multi") is not TRUE
# Error in debugging:
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.eot to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.eot: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.svg to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.svg: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/librarybslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.ttf: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.woff to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.woff: Permission denied
Warning in file.copy(from, to, ...) :
  problem copying /path/to/R/library/bslib/lib/bs3/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 to /path/to/tmp/bslib-precompiled-5/fonts/bootstrap/glyphicons-halflings-regular.woff2: Permission denied

Added here based on the issue raised on elmer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions