quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.77k stars 308 forks source link

Quarto fails to detect knitr capabilities on Aarch64 Windows #8730

Open kevinushey opened 7 months ago

kevinushey commented 7 months ago

Bug description

I am fairly certain that this issue is specific to Aarch64 builds of Windows. To wit, I'm experiencing this with:

Device name KEVINUSHEY8387
Processor   Apple Silicon   3.20 GHz  (8 processors)
Installed RAM   8.00 GB
Device ID   22727451-E184-4C09-B32B-D2BF5E2E7365
Product ID  00330-80835-98449-AA654
System type 64-bit operating system, ARM-based processor
Pen and touch   Pen support

and

Edition Windows 11 Pro
Version 24H2
Installed on    ‎2/‎10/‎2024
OS build    26052.1000
Experience  Windows Feature Experience Pack 1000.26052.1000.0

Here's the log I see:

==> quarto preview qqqq.qmd --to pdf --no-watch-inputs --no-browse

Quarto version: 1.4.549
[NotebookContext]: Starting Cleanup
-- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: C:/R/R-4.3.2
Looking for 'Rscript' in PATH.
[execProcess] CMD /C where Rscript
[execProcess] Success: true, code: 0
Found in PATH at C:\R\R-4.3.2\bin\x64\Rscript.exe
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe C:\PROGRA~1\RStudio\RESOUR~1\app\bin\quarto\share\rmd\rmd.R

processing file: qqqq.qmd
1/5                  
2/5 [unnamed-chunk-1]
3/5                  
4/5 [unnamed-chunk-2]
5/5                  
output file: qqqq.knit.md

[execProcess] Success: false, code: -1073741819
-- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: C:/R/R-4.3.2
Looking for 'Rscript' in PATH.
[execProcess] CMD /C where Rscript
[execProcess] Success: true, code: 0
Found in PATH at C:\R\R-4.3.2\bin\x64\Rscript.exe
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe --version
[execProcess] Success: true, code: 0

++R found at C:\R\R-4.3.2\bin\x64\Rscript.exe is working.
-- Checking knitr engine capabilities --
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe C:\PROGRA~1\RStudio\RESOUR~1\app\bin\quarto\share\capabilities\knitr.R
[execProcess] Success: false, code: -1073741819

++ Problem with results of knitr capabilities check.
    Return Code: -1073741819 (success is false)
    with stdout from R:
--- YAML_START ---
versionMajor: 4 
versionMinor: 3 
versionPatch: 2 
home: C:/R/R-4.3.2 
libPaths:
  - "C:/Users/kevin/AppData/Local/R/win-library/4.3" 
  - "C:/R/R-4.3.2/library" 
packages:
  knitr: "1.43"
  rmarkdown: "2.22"
--- YAML_END ---

Problem with running R found at C:\R\R-4.3.2\bin\x64\Rscript.exe to check environment configurations.
Please check your installation of R.

[NotebookContext]: Starting Cleanup

In other words, even though Quarto seemingly successfully interrogates R, because R doesn't shut down cleanly, it's inferred to be a non-functional build of R.

This is almost surely a Windows bug, but as far as I can tell there's no way for me to get out of this hole. 😞

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Your environment

RStudio 2024.04.0-daily+440 "Chocolate Cosmos" Daily (017994e650caa386966773e1208a338354b62074, 2024-02-12) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.0-daily+440 Chrome/120.0.6099.276 Electron/28.2.2 Safari/537.36

Quarto check output

> system("quarto check")
Quarto version: 1.4.549
Quarto 1.4.549
[>] Checking versions of quarto binary dependencies...
[execProcess] C:\PROGRA~1\RStudio\RESOUR~1\app\bin\quarto\bin\tools\pandoc --version
[execProcess] Success: true, code: 0
      Pandoc version 3.1.11: OK
[execProcess] C:\PROGRA~1\RStudio\RESOUR~1\app\bin\quarto\bin\tools\x86_64\dart-sass\sass.bat --version
[execProcess] Success: true, code: 0
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.549
      Path: C:\PROGRA~1\RStudio\RESOUR~1\app\bin\quarto\bin
      CodePage: 1252
cscheid commented 7 months ago

That wouldn't surprise me. Can you try to run the latest from our git repo?

kevinushey commented 7 months ago

Seems the same:

==> quarto preview qqqq.qmd --to pdf --no-watch-inputs --no-browse

Quarto version: 99.9.9
[NotebookContext]: Starting Cleanup
-- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: C:/R/R-4.3.2
Looking for 'Rscript' in PATH.
[execProcess] CMD /C where Rscript
[execProcess] Success: true, code: 0
Found in PATH at C:\R\R-4.3.2\bin\x64\Rscript.exe
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe C:\Users\kevin\projects\QUARTO~1\src\resources\rmd\rmd.R

processing file: qqqq.qmd
1/5                  
2/5 [unnamed-chunk-1]
3/5                  
4/5 [unnamed-chunk-2]
5/5                  
output file: qqqq.knit.md

[execProcess] Success: false, code: -1073741819
-- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: C:/R/R-4.3.2
Looking for 'Rscript' in PATH.
[execProcess] CMD /C where Rscript
[execProcess] Success: true, code: 0
Found in PATH at C:\R\R-4.3.2\bin\x64\Rscript.exe
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe --version
[execProcess] Success: true, code: 0

++R found at C:\R\R-4.3.2\bin\x64\Rscript.exe is working.
-- Checking knitr engine capabilities --
[execProcess] C:\R\R-4.3.2\bin\x64\Rscript.exe C:\Users\kevin\projects\QUARTO~1\src\resources\capabilities\knitr.R
[execProcess] Success: false, code: -1073741819

++ Problem with results of knitr capabilities check.
    Return Code: -1073741819 (success is false)
    with stdout from R:
--- YAML_START ---
versionMajor: 4 
versionMinor: 3 
versionPatch: 2 
home: C:/R/R-4.3.2 
libPaths:
  - "C:/Users/kevin/AppData/Local/R/win-library/4.3" 
  - "C:/R/R-4.3.2/library" 
packages:
  knitr: "1.43"
  rmarkdown: "2.22"
--- YAML_END ---

Problem with running R found at C:\R\R-4.3.2\bin\x64\Rscript.exe to check environment configurations.
Please check your installation of R.

[NotebookContext]: Starting Cleanup
ERROR: Error
    at renderFiles (file:///C:/Users/kevin/projects/QUARTO~1/src/command/render/render-files.ts:354:23)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async render (file:///C:/Users/kevin/projects/QUARTO~1/src/command/render/render-shared.ts:99:18)
    at async renderForPreview (file:///C:/Users/kevin/projects/QUARTO~1/src/command/preview/preview.ts:419:24)
    at async render (file:///C:/Users/kevin/projects/QUARTO~1/src/command/preview/preview.ts:165:22)
    at async preview (file:///C:/Users/kevin/projects/QUARTO~1/src/command/preview/preview.ts:182:18)
    at async Command.fn (file:///C:/Users/kevin/projects/QUARTO~1/src/command/preview/cmd.ts:415:7)
    at async Command.execute (file:///C:/Users/kevin/projects/quarto-cli/src/vendor/deno.land/x/cliffy@v0.25.4/command/command.ts:1790:7)
    at async quarto (file:///C:/Users/kevin/projects/QUARTO~1/src/quarto.ts:155:3)
    at async file:///C:/Users/kevin/projects/QUARTO~1/src/quarto.ts:186:5
cscheid commented 7 months ago

Thanks - I wanted to check the stack trace to see if that could help.

If you want to try to brute force your way through this to see if that's the only problem, you could change line 277 of src/execute/rmd.ts to check for (result.success || result.status === -1073741819) (or something like that)