Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"type_sum not exported" error on Windows with R 3.6 #1378

Closed
gadenbuie opened this issue Mar 14, 2022 · 3 comments
Closed

"type_sum not exported" error on Windows with R 3.6 #1378

gadenbuie opened this issue Mar 14, 2022 · 3 comments

Comments

@gadenbuie
Copy link

I'm seeing a repeat of r-lib/pillar#462 but very specifically just on Windows with R 3.6.3. I've traced it to rlang::abort(), which calls pillar::type_sum() inside rlang:::trace_back(). I understand rlang and pillar are quite entangled in this area, so please let me know if I should move this issue to or open a complementary issue in rlang.

https://github.com/rstudio/learnr/runs/5521901016?check_suite_focus=true#step:7:210

== Failed tests ================================================================
-- Error (test-exercise.R:109:1): render_exercise() returns envir_result up to error --
Error: Error: 'type_sum' is not an exported object from 'namespace:pillar'
-- Error (test-knitr-hooks.R:31:1): Detection of chained setup cycle works -----
Error: Error: 'type_sum' is not an exported object from 'namespace:pillar'
-- Error (test-options-reveal_solution.R:32:1): Solutions are revealed or hidden with tutorial_options() --
Error: Error: 'type_sum' is not an exported object from 'namespace:pillar'
-- Error (test-options-reveal_solution.R:52:1): Solutions are revealed or hidden with global option --
Error: Error: 'type_sum' is not an exported object from 'namespace:pillar'

Here's a concise summary of the session info in the runner.

  - Session info ---------------------------------------------------------------
   setting  value
   version  R version 3.6.3 (2020-02-29)
   os       Windows Server x64 (build 20348)

  - Packages -------------------------------------------------------------------
   package      * version    date (UTC) lib source
   pillar         1.7.0      2022-02-01 [1] RSPM
   rlang          1.0.2      2022-03-04 [1] RSPM
@krlmlr krlmlr transferred this issue from r-lib/pillar Mar 14, 2022
@krlmlr
Copy link
Member

krlmlr commented Mar 14, 2022

Thanks. Does this come from rlang_type_sum() ? Should we check that the function exists to avoid this behavior?

rlang/R/types.R

Lines 474 to 482 in 22fe9e9

# Use different generic name to avoid import warnings when loading
# packages that import all of rlang after it has been load_all'd
rlang_type_sum <- function(x) {
if (is_installed("pillar")) {
pillar::type_sum(x)
} else {
UseMethod("rlang_type_sum")
}
}

@lionel-
Copy link
Member

lionel- commented Mar 14, 2022

Maybe is_installed() should check that the package is fully loaded?

We ran into similar issues before when loadNamespace() is called recursively with user hooks involved. Not sure how that could come into play here though.

@lionel-
Copy link
Member

lionel- commented May 24, 2022

Hopefully the attached commit fixes this. I'll also try to send a patch for base R when I get the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants