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

pegboard broken under R-4.3.3 #149

Closed
ns-rse opened this issue Mar 1, 2024 · 1 comment · Fixed by #150
Closed

pegboard broken under R-4.3.3 #149

ns-rse opened this issue Mar 1, 2024 · 1 comment · Fixed by #150

Comments

@ns-rse
Copy link

ns-rse commented Mar 1, 2024

Further to #130 I encountered this error today with R-4.3.3. I've been embedding Mermaid Diagrams generated on mermaid.live as it seemed a neat solution to incorporate such diagrams in the Workbench.

A typical link looks like...

![Basic GitHub Branches](https://mermaid.ink/img/pako:eNqVkTtrwzAUhf-KuWDcgh30sPVa29KlW7fiRZHkWKS2gitDU-P_XjshJUNKqab7-M65gjOBCdaBgjSdfO-jSqYstq5zmUqyrf5wWZ5kOx-fB31os3U7hKijewhd5-OL3rr3ZRqH0c11n1zeUs9peh5cxD9rc5Im3qqkBlSUnDQY4RpuA7iosMDMst8AUjDOZNOQ5G797_0Vtx10b9qFORe_OdBCmIpY466B1pl9GGPSad_flpWFcIYKqW_J_rpZFYTiqtHofzdZIanjgpsaIIfODQtql_SmFa_hlFwNK2n1sF-954UbD3aJ7Mn6GAZQa1g56DGG12NvLv2ZefR6N-juMjzo_i2E6xbUBJ-gWLXBkmAqCUKIlLLM4QiKSLmhAqFKcsIk54LOOXydDPCmZJRhxEqJkRCC8fkbTTe3dw?type=png)

But because this is work in progress I wanted to be able to easily go back to the live preview and tweak if necessary and so I included...

<!-- https://mermaid.live/edit#pako:eNqVkTtrwzAUhf-KuWDcgh30sPVa29KlW7fiRZHkWKS2gitDU-P_XjshJUNKqab7-M65gjOBCdaBgjSdfO-jSqYstq5zmUqyrf5wWZ5kOx-fB31os3U7hKijewhd5-OL3rr3ZRqH0c11n1zeUs9peh5cxD9rc5Im3qqkBlSUnDQY4RpuA7iosMDMst8AUjDOZNOQ5G797_0Vtx10b9qFORe_OdBCmIpY466B1pl9GGPSad_flpWFcIYKqW_J_rpZFYTiqtHofzdZIanjgpsaIIfODQtql_SmFa_hlFwNK2n1sF-954UbD3aJ7Mn6GAZQa1g56DGG12NvLv2ZefR6N-juMjzo_i2E6xbUBJ-gWLXBkmAqCUKIlLLM4QiKSLmhAqFKcsIk54LOOXydDPCmZJRhxEqJkRCC8fkbTTe3dw
-->

Which looks very similar to what caused the problem previously and using the reprex from #130 I tested under R-4.3.2 and R-4.3.3

R-4.3.2 - No Error

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

> tmp <- withr::local_tempfile()
Setting global deferred event(s).
i These will be run:
  * Automatically, when the R session ends.
  * On demand, if you call `withr::deferred_run()`.
i Use `withr::deferred_clear()` to clear them without executing.
> txt <- r"{<!-- https://mermaid.live/edit#pako:eNqtkk9v2yAYxr-KhRS5k4wH2Pyxr2u1y07bbfKFAE5Qa5NiXK21_N0HaVNlUhpN2jjB8_54gId3AcppA1qw2Sx2tKHNljzszWDyNsu3cjJ5keU7G756edjnqepdkMF8ccNgwze5NQ9RDX42azdmpxHn62bzKpw2v5fVcWtmdZt1AMGakx4j3IHLAIYUC8w0-wggkHHW9D3JbtJ9P51xWy9HtY_MOEE_mc8YvhjvoLZPdrJuPHfcG3Xv5vBX7PnpFRSKEq3M_zCjkFSY9hJdMhukHd_VwfidueL_ZsjhVtVVk9LNgtwl6QmVuLyQ9lv5u0khXsmQwOlxlt5A71y4-ugPyfMn11AYVYlG_rsVg01luODqBIACxJxibjr295K0Dhx7uwOJ19LfJ3SN3HzQsanvtA3Ogza1cwHkHNyP51Gd1q_MrZU7LwfQ9vJhiupBjj-d-2MN2gX8Ai3hdUkJokyImjPKCC3Ac5RFXXJEKoQRofFv2FqAl6MDKgXlAomG4grFAiHrb-1-Ets -->
+ }"
> writeLines(txt, tmp)
> pegboard::Episode$new(tmp)$validate_links()
> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux

Matrix products: default
BLAS:   /usr/lib/libblas.so.3.12.0 
LAPACK: /usr/lib/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

time zone: Europe/London
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.3.2   magrittr_2.0.3   R6_2.5.1         cli_3.6.2       
 [5] pegboard_0.7.3   fs_1.6.3         withr_3.0.0      glue_1.7.0      
 [9] tinkr_0.2.0      xml2_1.3.6       vctrs_0.6.5      lifecycle_1.0.4 
[13] commonmark_1.9.1 rlang_1.1.2      purrr_1.0.2     

R-4.3.3 - Errors during validation

R

R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Matrix)
>  tmp <- withr::local_tempfile()
Setting global deferred event(s).
i These will be run:
  * Automatically, when the R session ends.
  * On demand, if you call `withr::deferred_run()`.
i Use `withr::deferred_clear()` to clear them without executing.
> txt <- r"{<!-- https://mermaid.live/edit#pako:eNqtkk9v2yAYxr-KhRS5k4wH2Pyxr2u1y07bbfKFAE5Qa5NiXK21_N0HaVNlUhpN2jjB8_54gId3AcppA1qw2Sx2tKHNljzszWDyNsu3cjJ5keU7G756edjnqepdkMF8ccNgwze5NQ9RDX42azdmpxHn62bzKpw2v5fVcWtmdZt1AMGakx4j3IHLAIYUC8w0-wggkHHW9D3JbtJ9P51xWy9HtY_MOEE_mc8YvhjvoLZPdrJuPHfcG3Xv5vBX7PnpFRSKEq3M_zCjkFSY9hJdMhukHd_VwfidueL_ZsjhVtVVk9LNgtwl6QmVuLyQ9lv5u0khXsmQwOlxlt5A71y4-ugPyfMn11AYVYlG_rsVg01luODqBIACxJxibjr295K0Dhx7uwOJ19LfJ3SN3HzQsanvtA3Ogza1cwHkHNyP51Gd1q_MrZU7LwfQ9vJhiupBjj-d-2MN2gX8Ai3hdUkJokyImjPKCC3Ac5RFXXJEKoQRofFv2FqAl6MDKgXlAomG4grFAiHrb-1-Ets -->
+ }"
> writeLines(txt, tmp)
> pegboard::Episode$new(tmp)$validate_links()
Error in eval(call("force", as.symbol(paste0("..", x)))) : 
  argument "..2" is missing, with no default
> sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux

Matrix products: default
BLAS:   /usr/lib/libblas.so.3.12.0 
LAPACK: /usr/lib/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

time zone: Europe/London
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Matrix_1.6-5   devtools_2.4.5 usethis_2.2.3 

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1    compiler_4.3.3    promises_1.2.1    Rcpp_1.0.12      
 [5] xml2_1.3.6        tinkr_0.2.0       stringr_1.5.1     later_1.3.2      
 [9] fastmap_1.1.1     mime_0.12         lattice_0.22-5    R6_2.5.1         
[13] commonmark_1.9.1  pegboard_0.7.3    htmlwidgets_1.6.4 profvis_0.3.8    
[17] shiny_1.8.0       rlang_1.1.3       cachem_1.0.8      stringi_1.8.3    
[21] httpuv_1.6.14     fs_1.6.3          pkgload_1.3.4     memoise_2.0.1    
[25] cli_3.6.2         withr_3.0.0       magrittr_2.0.3    digest_0.6.34    
[29] grid_4.3.3        xtable_1.8-4      remotes_2.4.2.1   lifecycle_1.0.4  
[33] vctrs_0.6.5       glue_1.7.0        urlchecker_1.0.1  sessioninfo_1.2.2
[37] pkgbuild_1.4.3    purrr_1.0.2       tools_4.3.3       ellipsis_0.3.2   
[41] htmltools_0.5.7  

When it first cropped up the following traceback was recorded and it still seems to traceback to the issue with {xml2} that was identified.

> rlang::last_trace(drop =FALSE)
<error/purrr_error_indexed>
Error in `purrr::map()` at carpentries-pegboard-1bc5753/R/utils.R:136:3:In index: 1.With name: introduction.md.
Caused by error:
! argument "..2" is missing, with no default
---
Backtrace:1. ├─sandpaper::serve()
  2. │ └─sandpaper (local) rend(this_path) at sandpaper/R/serve.R:103:3
  3. │   └─sandpaper::build_lesson(f, preview = FALSE, quiet = quiet) at sandpaper/R/serve.R:81:7
  4. │     └─sandpaper::validate_lesson(path, quiet = quiet) at sandpaper/R/build_lesson.R:88:3
  5. │       └─sandpaper:::this_lesson(path) at sandpaper/R/validate_lesson.R:40:3
  6. │         └─.store$set(path) at sandpaper/R/utils-store.R:61:3
  7. │           └─pegboard::Lesson$new(path, jekyll = FALSE) at sandpaper/R/utils-store.R:192:7
  8. │             └─pegboard (local) initialize(...)
  9. │               └─pegboard:::read_sandpaper_lesson(path, ...) at carpentries-pegboard-1bc5753/R/Lesson.R:82:9
 10. │                 └─pegboard:::read_markdown_files(...) at carpentries-pegboard-1bc5753/R/read_sandpaper_lesson.R:33:3
 11. │                   └─purrr::map(.x = the_files, .f = Episode$new, ...) at carpentries-pegboard-1bc5753/R/utils.R:136:3
 12. │                     └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
 13. │                       ├─purrr:::with_indexed_errors(...)
 14. │                       │ └─base::withCallingHandlers(...)
 15. │                       ├─purrr:::call_with_cleanup(...)
 16. │                       └─R6 (local) .f(.x[[i]], ...)
 17. │                         └─pegboard (local) initialize(...)
 18. │                           └─pegboard:::fix_links(ep$body) at carpentries-pegboard-1bc5753/R/Episode.R:101:9
 19. │                             └─pegboard:::find_broken_links(body) at carpentries-pegboard-1bc5753/R/fix_links.R:77:3
 20. │                               ├─xml2::xml_find_all(body, make_link_patterns(), ns = get_ns()) at carpentries-pegboard-1bc5753/R/fix_links.R:94:3
 21. │                               ├─xml2:::xml_find_all.xml_node(body, make_link_patterns(), ns = get_ns())
 22. │                               └─pegboard:::make_link_patterns() at carpentries-pegboard-1bc5753/R/fix_links.R:94:3
 23. │                                 └─glue::glue(...) at carpentries-pegboard-1bc5753/R/fix_links.R:119:3
 24. │                                   └─glue::glue_data(...)
 25. │                                     └─base::lapply(...)
 26. │                                       └─glue (local) FUN(X[[i]], ...)
 27. │                                         ├─eval(call("force", as.symbol(paste0("..", x)))) %||% .null
 28. │                                         ├─base::eval(call("force", as.symbol(paste0("..", x))))
 29. │                                         │ └─base::eval(call("force", as.symbol(paste0("..", x))))
 30. │                                         └─base::force(..2)
 31. └─base::.handleSimpleError(...)
 32.   └─purrr (local) h(simpleError(msg, call))
 33.     └─cli::cli_abort(...)
 34.       └─rlang::abort(...)
> sandpaper::serve()
@froggleston
Copy link
Contributor

Many thanks for reporting this @ns-rse ! I'll try to work through a fix in the next few days.

Bisaloo added a commit to Bisaloo/pegboard that referenced this issue Mar 5, 2024
This trailing comma has no functional role and seems to be at the origin of carpentries#149, as reported in tidyverse/glue#320.
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 a pull request may close this issue.

2 participants