After updating to version 6.1.0 following issue appears
Updating xxxx documentation
Loading xxxx
Updating roxygen version in C:...\xxxx/DESCRIPTION
Error in file(con, "r") : cannot open the connection
Calls: suppressPackageStartupMessages ... parse_package -> lapply -> FUN -> read_lines ->
In addition: Warning messages:
1: roxygen2 requires Encoding: UTF-8
2: In file(con, "r") :
cannot open file 'C:...\xxxx\R': Permission denied
where xxxx is name of the package.
I am using Windows 10 OS.
Just received the identical error, using Windows 7
edit: installed version 6.0.1 and it ran fine.
In parse_package ->
package_files(base_path) new roxygen2 returns list of files interleaved with 4 "C:...\xxxx\R" lines.
Looks like split of Collate field on space inserts "R" folder paths and further down these are attempted to be open by file() were it blows up.
Thanks @lukaszbednarz , your diagnosis of the problem was spot on. I submitted a pull request with a very simple one-line fix.
Hi gustavdelius,
Thanks for fix. How long does it take for the fix to make it to next CRAN release?
Hi @lukaszbednarz, I am not one of the roxygen maintainers, so I do not know when they are planning to create a new cran release. But if you have the devtools package installed then you can do devtools::install_github("gustavdelius/roxygen") in the R console.
Just for completeness, while stripping the blank lines solves the proximate cause, the root cause is the change in roxygen2:::read.description()
.
In version 6.0.1, it relies on base::read.dcf()
, which strips white space from within the DESCRIPTION fields. In version 6.1.0, it relies on desc::desc()
which does not.
As it's not clear whether the desc
package intends this behavior and the issue affects other fields, the long term fix might be to change roxygen2:::read.description()
to strip white space from all the list fields it uses.
I have the same problem, windows 10 PRO:
roxygen2::roxygenise(clean = TRUE)
First time using roxygen2. Upgrading automatically...
Updating collate directive in C:...PKGNAME/DESCRIPTION
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'C:...PKGNAME\R': Permission denied
and I cant install @gustavdelius package to fix it:
devtools::install_github("gustavdelius/roxygen")
Downloading GitHub repo gustavdelius/roxygen@master
from URL https://api.github.com/repos/gustavdelius/roxygen/zipball/master
WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.1 was found. (Only the following incompatible version(s) of Rtools were found:3.5)
I can reproduce. Problem is indeed the collate
field which funnily enough is generated by roxygen itself. Packages without collate
field work just fine.
Problem persists when installing latest version from github. This needs a fix urgently, as it's impossible now to use the latest roxygen2 version when developing packages with S4. I need collate fields to load my classes before my methods.
Just so this doesn't get lost in the shuffle, there are two outstanding PRs that fix the issue, #791 and #768. I unfortunately did not realize #768 was the same thing at first.
Thx. Meanwhile, I provided a windows binary of roxygen 6.0.1 for download in the odd case anyone is not confident enough to build from source.
https://gist.github.com/JoFAM/b00f75386c3f64dbebe26f030ff50f67
This is now escalating further. Since devtools version 2.0.0 roxygen2 6.1.0 is required. Any idea, when this fix will be included in a release version? Thanks.
In the meantime I reverted back to devtools 1.13.6
Edit: 6.1.1 fixed this #790 Works now with devtools 2.0.1. Thank you!
Most helpful comment
Hi @lukaszbednarz, I am not one of the roxygen maintainers, so I do not know when they are planning to create a new cran release. But if you have the devtools package installed then you can do devtools::install_github("gustavdelius/roxygen") in the R console.