Skip to content

R_HOME warning prevents reading macros after devtools::load_all() #8453

@jakub-jedrusiak

Description

@jakub-jedrusiak

System details:

Positron and OS details:

Positron Version: 2025.07.0 build 74
Code - OSS Version: 1.100.0
Commit: fe621e8
Date: 2025-06-09T03:43:13.821Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Linux x64 6.15.3-1-MANJARO

Interpreter details:

R 4.5.1

Describe the issue:

I'm working on my package in Positron. After I run devtools::load_all() it seems that a warning about the value of R_HOME is sucked into the file path of some macro:

Warning message:
In file(con, "r") :
  cannot open file 'WARNING: ignoring environment value of R_HOME
/usr/share/R//Rd/macros/system.Rd': No such file or directory

Note that the warning is inside the quotation marks. This warning appears from time to time while I'm writing code and it prevents me from accessing help files, e.g.:

> ?tidyr::unnest_wider
Warning message:
In file(con, "r") :
  cannot open file 'WARNING: ignoring environment value of R_HOME
/usr/share/R//Rd/macros/system.Rd': No such file or directory
Error in `file()`:
! cannot open the connection
Hide Traceback
     ▆
  1. └─`?`(tidyr::unnest_wider)
  2.   └─pkgload::dev_topic_find(topic, pkg)
  3.     └─pkgload:::dev_topic_path(topic$topic, path = ns_path(pkg_name))
  4.       └─pkgload::dev_topic_index(path)
  5.         └─pkgload:::build_topic_index(path)
  6.           └─pkgload:::load_rd_macros(path)
  7.             └─tools::loadPkgRdMacros(dir)
  8.               └─tools:::initialRdMacros(pkglist)
  9.                 └─tools::loadRdMacros(file = macros)
 10.                   └─tools::parse_Rd(file, fragment = TRUE, macros = macros, warningCalls = FALSE)
 11.                     └─base::readLines(file, warn = FALSE)
 12.                       └─base::file(con, "r")

Do note that I don't have a custom value of R_HOME set.

Steps to reproduce the issue:

  1. Open a package as a workspace.
  2. Run devtools::load_all().
  3. Start writing code or try to access help file of any function.

Expected or desired behavior:

The error shouldn't appear, the warning message shouldn't be a part of the file path.

Were there any error messages in the UI, Output panel, or Developer Tools console?

No other errors were present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions