neurogenomics / EpiCompare

Comparison, benchmarking & QC of epigenetic datasets
https://doi.org/doi:10.18129/B9.bioc.EpiCompare
12 stars 3 forks source link

GHA Windows: `Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 1, column 45` #146

Closed bschilder closed 8 months ago

bschilder commented 1 year ago

1. Bug description

Error occurs on GHA Windows: https://github.com/neurogenomics/EpiCompare/actions/runs/4195716011/jobs/7275652659

Quitting from lines 193-210 (EpiCompare.Rmd) 
Error: Error: processing vignette 'EpiCompare.Rmd' failed with diagnostics:
Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 1, column 45

I'm noticing "***" at line 193 (Which i think @serachoi1230 may have been using for Rmarkdown styling?). Perhaps Windows gets confused by these.

Screenshot 2023-02-16 at 16 38 16

Console output

Loading required package: rcmdcheck
── R CMD build ─────────────────────────────────────────────────────────────────
* checking for file 'D:\a\EpiCompare\EpiCompare/DESCRIPTION' ... OK
* preparing 'EpiCompare':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Error: --- re-building 'EpiCompare.Rmd' using rmarkdown
Quitting from lines 193-210 (EpiCompare.Rmd) 
Error: Error: processing vignette 'EpiCompare.Rmd' failed with diagnostics:
Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 1, column 45
--- failed re-building 'EpiCompare.Rmd'
--- re-building 'docker.Rmd' using rmarkdown
--- finished re-building 'docker.Rmd'
--- re-building 'example_report.Rmd' using rmarkdown
--- finished re-building 'example_report.Rmd'
SUMMARY: processing the following file failed:
  'EpiCompare.Rmd'
Error: Error: Vignette re-building failed.
Execution halted
Error: Error in proc$get_built_file() : Build process failed
Calls: <Anonymous> ... build_package -> with_envvar -> force -> <Anonymous>
Execution halted
Error: Process completed with exit code 1.
Run actions/upload-artifact@v3
Warning: No files were found with the provided path: check. No artifacts will be uploaded.

Expected behaviour

Rmarkdown renders on all platforms.

2. Reproducible example

https://github.com/neurogenomics/EpiCompare/actions/runs/4195716011/jobs/7275652659

bschilder commented 1 year ago

Confirmed that "***" is simply for aesthetics, as rmarkdown interprets it as "horizontal rule (or slide break)" https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf

Just tried deleting the "***" and pushing

bschilder commented 1 year ago

Just tried deleting the "***" and pushing

This didn't seem to do anything. In fact, the error is still indicating line 193.

I noticed this also happens to be be just before the first header with {.tabset}. Possibly related? https://github.com/neurogenomics/EpiCompare/actions/runs/4196426270/jobs/7277384263

More generally, might be a pandoc versioning issue, in which case I may need to add some lines to the system dep setup steps in rworkflows

bschilder commented 1 year ago

Possibly related errors regarding YAML header syntax: https://github.com/rstudio/shiny/issues/1626

And/or Rmd file location: https://github.com/rstudio/rmarkdown/issues/1005

Tomrrr1 commented 8 months ago

I managed to narrow the error down to several shQuote() commands in report_header.R. shQuote() is used to quote strings in a way that is safe to pass to the command line. This function has a type argument which specifies the type of shell quoting. The default on Mac and Linux is "sh", whereas the Windows default is "cmd". Interestingly, shQuote() produces an error on Windows when using "cmd" despite this being the default. Even more interesting is that hard-coding the Mac and Linux default (type = "sh") fixes the Windows error! I have pushed this change to Bioconductor, and EpiCompare is now building on all systems.

Summary: Problem with the shQuote() command in report_header.R. Manually specifying type = "sh" resolves the Windows bug.

Image

NathanSkene commented 8 months ago

Well done! Good to have this solved

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Tomrrr1 @.> Sent: Thursday, February 15, 2024 10:23:59 AM To: neurogenomics/EpiCompare @.> Cc: Subscribed @.***> Subject: Re: [neurogenomics/EpiCompare] GHA Windows: Parser error: while parsing a block mapping at line 1, column 1 did not find expected key at line 1, column 45 (Issue #146)

This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.

Closed #146https://github.com/neurogenomics/EpiCompare/issues/146 as completed.

— Reply to this email directly, view it on GitHubhttps://github.com/neurogenomics/EpiCompare/issues/146#event-11813380522, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AH5ZPE46WA33JTJKR3CEHELYTXO37AVCNFSM6AAAAAAU6M3IDSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHAYTGMZYGA2TEMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

bschilder commented 8 months ago

Amazing, thanks so much for figuring this out @Tomrrr1