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

Upkeep 2024-07 #264

Merged
merged 15 commits into from
Jul 30, 2024
Merged

Upkeep 2024-07 #264

merged 15 commits into from
Jul 30, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Jul 29, 2024

No description provided.

@hadley
Copy link
Member Author

hadley commented Jul 29, 2024

I am mystified by the mac failure

@lionel-
Copy link
Member

lionel- commented Jul 30, 2024

The crash reliably happens in:

test_that("with_device functions create a plot file", { fn_names <- c("with_bmp", "with_jpeg", "with_pdf", "with_png", "with_tiff", "with_svg", "with_cairo_pdf", "with_cairo_ps") fns <- mget(fn_names, envir = asNamespace("withr")) for (i in seq_along(fns)) { skip_if_needs_cairo(fn_names[[i]]) filename <- withr::local_tempfile() expect_no_error(fns[[i]](filename, plot(1))) expect_true(file.exists(filename), info = fn_names[[i]]) expect_gt(file.info(filename)$size, 0, label = fn_names[[i]]) }})

I tried to set _R_TRACE_LOADNAMESPACE_ to "4" to get more information about which library.dynam() call fails. Somehow this prevents the crash from happening. But we get these warnings which do look relevant:

══ Warnings ════════════════════════════════════════════════════════════════════
── Warning ('test-devices.R:17:5'): with_*device* functions create a plot file ──
unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
  dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 0x0006): Library not loaded: /opt/X11/lib/libSM.6.dylib
  Referenced from: <31EADEB5-0A17-3546-9944-9B3747071FE8> /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/modules/R_X11.so
  Reason: tried: '/opt/X11/lib/libSM.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/X11/lib/libSM.6.dylib' (no such file), '/opt/X11/lib/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libSM.6.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7.0/arm64/Contents/Home//lib/server/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libSM.6.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7.0/arm64/Contents/Home//lib/server/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources [... truncated]
Backtrace:
     ▆
  1. ├─testthat::expect_no_error(fns[[i]](filename, plot(1))) at test-devices.R:17:5
  2. │ └─testthat:::expect_no_(...)
  3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
  4. │     ├─testthat (local) .capture(...)
  5. │     │ └─rlang::try_fetch(...)
  6. │     │   ├─base::tryCatch(...)
  7. │     │   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8. │     │   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9. │     │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 10. │     │   └─base::withCallingHandlers(...)
 11. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 12. └─fns[[i]](filename, plot(1))
 13.   └─withr:::svg_dev(...)
 14.     └─withr:::svg_wrapper(...)
 15.       └─grDevices::svg(...) at withr/R/devices.R:14:3
 16.         └─grDevices:::symbolfamilyDefault(family)
 17.           └─grDevices:::symbolType1support()
 18.             └─grDevices::grSoftVersion()
── Warning ('test-devices.R:17:5'): with_*device* functions create a plot file ──
unable to load shared object '/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so':
  dlopen(/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so, 0x0006): Library not loaded: /opt/X11/lib/libXrender.1.dylib
  Referenced from: <63619C6D-FE72-3544-BCEF-9C834A5E39D8> /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/grDevices/libs/cairo.so
  Reason: tried: '/opt/X11/lib/libXrender.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/X11/lib/libXrender.1.dylib' (no such file), '/opt/X11/lib/libXrender.1.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libXrender.1.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7.0/arm64/Contents/Home//lib/server/libXrender.1.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libXrender.1.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7.0/arm64/Contents/Home//lib/ [... truncated]
Backtrace:
     ▆
  1. ├─testthat::expect_no_error(fns[[i]](filename, plot(1))) at test-devices.R:17:5
  2. │ └─testthat:::expect_no_(...)
  3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
  4. │     ├─testthat (local) .capture(...)
  5. │     │ └─rlang::try_fetch(...)
  6. │     │   ├─base::tryCatch(...)
  7. │     │   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8. │     │   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9. │     │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 10. │     │   └─base::withCallingHandlers(...)
 11. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 12. └─fns[[i]](filename, plot(1))
 13.   └─withr:::svg_dev(...)
 14.     └─withr:::svg_wrapper(...)
 15.       └─grDevices::svg(...) at withr/R/devices.R:14:3
 16.         └─grDevices:::symbolfamilyDefault(family)
 17.           └─grDevices:::symbolType1support()
 18.             └─grDevices::grSoftVersion()
  9. │     │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 10. │     │   └─base::withCallingHandlers(...)
 11. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 12. └─fns[[i]](filename, plot(1))
 13.   └─withr:::cairo_ps_dev(filename = new, ...)
 14.     └─grDevices::cairo_ps(filename = filename, ...) at withr/R/devices.R:29:3
── Warning ('test-devices.R:33:7'): local_device functions create a plot file ──
failed to load cairo DLL
Backtrace:
     ▆
  1. └─base::eval(...)
  2.   └─base::eval(...)
  3.     ├─testthat::expect_no_error(fns[[i]](filename)) at test-devices.R:33:7
  4.     │ └─testthat:::expect_no_(...)
  5.     │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
  6.     │     ├─testthat (local) .capture(...)
  7.     │     │ └─rlang::try_fetch(...)
  8.     │     │   ├─base::tryCatch(...)
  9.     │     │   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 10.     │     │   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 11.     │     │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 12.     │     │   └─base::withCallingHandlers(...)
 13.     │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 14.     └─fns[[i]](filename)
 15.       └─withr:::svg_dev(...)
 16.         └─withr:::svg_wrapper(...)
 17.           └─grDevices::svg(...) at withr/R/devices.R:14:3
── Warning ('test-devices.R:33:7'): local_device functions create a plot file ──
failed to load cairo DLL
Backtrace:
     ▆
  1. └─base::eval(...)
  2.   └─base::eval(...)
  3.     ├─testthat::expect_no_error(fns[[i]](filename)) at test-devices.R:33:7
  4.     │ └─testthat:::expect_no_(...)
  5.     │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
  6.     │     ├─testthat (local) .capture(...)
  7.     │     │ └─rlang::try_fetch(...)
  8.     │     │   ├─base::tryCatch(...)
  9.     │     │   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 10.     │     │   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 11.     │     │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 12.     │     │   └─base::withCallingHandlers(...)
 13.     │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 14.     └─fns[[i]](filename)
 15.       └─withr:::cairo_pdf_dev(filename = new, ...)
 16.         └─grDevices::cairo_pdf(filename = filename, ...) at withr/R/devices.R:24:3

Have you seen this before @gaborcsardi?

@gaborcsardi
Copy link
Member

Keep the XQuartz installation in the GHA workflow file, it is needed on macOS:
https://github.com/r-lib/withr/pull/264/files#diff-9c940e8ad2b7bc4c26ec3da57b94bc00e73e2166cfed689da51a4c59bcc0a310L54

@lionel-
Copy link
Member

lionel- commented Jul 30, 2024

It worked! Thanks!

@lionel- lionel- merged commit 5bbba33 into main Jul 30, 2024
12 of 13 checks passed
@lionel- lionel- deleted the upkeep-2024-07 branch July 30, 2024 08:21
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

Successfully merging this pull request may close these issues.

3 participants