On 14 December 2025 at 22:50, Konrad Rudolph wrote:
| One of my packages is failing on CRAN in R-devel [1], and I was requested
| to fix it. However, it is *only* failing on one specific configuration,
| 'r-devel-linux-x86_64-debian-gcc'. All other combinations — clang on
| Debian, both clang and GCC on Fedora, and Windows — keep running just fine.
| As my package is not using compiled code or anything OS-specific, I am at a
| loss to explain this highly specific failure. Before attempting to build a
| container image with this specific configuration locally (… are these
| configurations available as ready-made images?), I wanted to check if there
| was an obvious change in R-devel which might explain the issue.
My rocker/drd (for "daily R-devel"; but it now rebuilds weekly) fits that
bill. Access R-devel inside as either Rdevel or via alias RD.
| There are two failures, both with the same error message: “cannot change
| value of locked binding for '*tmp*'”. My package’s code isn’t attempting to
| directly change `*tmp*`, but it is using eval() to perform subset
| assignment to a complex expression inside an active binding. Here’s a
| minimal code snippet that *should* be equivalent to one of the two
| failures, and which should therefore also fail (in the last line):
|
| x = data.frame(a = 1 : 2, b = c('a', 'b'))
|
| f = function (value) {
| if (missing(value)) {
| evalq(x[1L, ], .GlobalEnv)
| } else {
| assign_expr = substitute(x[1L, ] <- value, list(value = value))
| eval(assign_expr, .GlobalEnv)
| }
| }
|
| makeActiveBinding('ax', f, .GlobalEnv)
|
| ax[1L] = 3L
|
| I had a look at the changes in in R-devel, but I couldn’t find anything
| obviously relevant. In particular, the code of R_MakeActiveBinding() hasn’t
| been touched in literally decades, and similar for the code that (as far as
| I understand) performs subset assignment, applydefine().
|
| Does anybody have an idea what might be going on here, or how to debug this
| issue?
It does fail for me under that drd container [1], and as you noted, not in my
usual R (4.5.2) on Ubuntu. As for the error, I have no idea...
Dirk
[1] Your example:
> x = data.frame(a = 1 : 2, b = c('a', 'b'))
> f = function (value) {
if (missing(value)) {
evalq(x[1L, ], .GlobalEnv)
} else {
assign_expr = substitute(x[1L, ] <- value, list(value = value))
eval(assign_expr, .GlobalEnv)
}
}
> makeActiveBinding('ax', f, .GlobalEnv)
> ax[1L] = 3L
Error in ax[1L] = 3L : cannot change value of locked binding for '*tmp*'
>
--
dirk.eddelbuettel.com | @eddelbuettel | [email protected]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel