-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
TLDR for users hitting
object 'ffi_list2' not found
I believe if you do the following, you can get back up and running:
remove.packages("rlang")- Restart R to be safe
install.packages("rlang")- Restart R to be safe
- Try your code again
That should put you on rlang 1.1.7, which has ffi_list2.
ggplot2 seems to capture rlang::list2() at package build time, meaning that whatever definition of rlang::list2() is available at build time is the one that all users of ggplot2 must have.
Lines 142 to 143 in 4ea78a4
| # We encapsulate rlang::list2 | |
| new_env <- new_environment(list(list2 = list2), env) |
This constructor seems to then be called at package build time in many places, like
Line 84 in 4ea78a4
| geom_contour <- make_constructor( |
In rlang 1.1.7, we changed the internals of list2() to directly drop into a new C function called ffi_list2.
Unfortunately I believe this can cause a large variety of errors.
See r-lib/rlang#1866
And https://stackoverflow.com/questions/79869479/cannot-plot-geom-point-in-r-ggplot2
Based on looking at these problems, my diagnosis is:
- CRAN builds ggplot2 4.0.1 binaries against rlang 1.1.7 with the
ffi_list2definition. This captures that definition at ggplot2 binary build time for all users who download ggplot2 from CRAN. - A user downloads ggplot2 4.0.1. This does not necessarily prompt them to update rlang to 1.1.7.
- They have an older rlang and try and plot, this results in the "
ffi_list2not found" error seen in all of the reports.
I believe there is nothing to be done on the rlang side of things.
If ggplot2 could please not capture rlang::list2() at package build time, and could send out a patch release that fixes this, then that would be great!