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

RStudio latest preview can not knit on Apple silicon MacBook - Bad CPU #12280

Closed
3 of 4 tasks
gsgxnet opened this issue Nov 2, 2022 · 17 comments
Closed
3 of 4 tasks

RStudio latest preview can not knit on Apple silicon MacBook - Bad CPU #12280

gsgxnet opened this issue Nov 2, 2022 · 17 comments
Labels
bug macos qa repro stale Issues which have been closed automatically due to inactivitiy.

Comments

@gsgxnet
Copy link

gsgxnet commented Nov 2, 2022

System details

RStudio Edition :  Desktop
RStudio Version :  Version 2022.12.0-preview+308 (2022.12.0-preview+308)
OS Version      :  macOS Monterey 12.6 on M2 MacBook Air
R Version       :  4.2.1

Steps to reproduce the problem

  • open RStudio,
  • create a new R Mark-down file with deafault content
  • knit it (preview button)

Describe the problem in detail

render fails at start:

sh: /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc: Bad CPU type in executable
Error in strsplit(info, "\n")[[1]] : subscript out of bounds
Calls: <Anonymous> ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version
In addition: Warning message:
In system(paste(shQuote(path), "--version"), intern = TRUE) :
  running command ''/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc' --version' had status 126
Execution halted

verification in shell:
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc --version
zsh: bad CPU type in executable: /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc

Describe the behavior you expected

render should produce a html document

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@gsgxnet gsgxnet added bug new New incoming issues, ready for initial review. labels Nov 2, 2022
@gsgxnet gsgxnet changed the title RStudio latest preview can not knit on Apple silicon MacBook RStudio latest preview can not knit on Apple silicon MacBook - Bad CPU Nov 2, 2022
@ronblum
Copy link
Contributor

ronblum commented Nov 3, 2022

@gsgxnet Thank you for raising this! Do you know if this worked with earlier versions of the 2022.12.0 builds?

@jonvanausdeln Can you check if this works on the silicon MacOS? Though if it works on the M1, I'm concerned that a difference might be M1 vs. M2 (though I'd be surprised).

@ronblum ronblum added macos qa repro and removed new New incoming issues, ready for initial review. labels Nov 3, 2022
@gsgxnet
Copy link
Author

gsgxnet commented Nov 3, 2022

@gsgxnet Thank you for raising this! Do you know if this worked with earlier versions of the 2022.12.0 builds?

@ronblum I had the same issue with the 2022.12.0 273 daily, dtd October, 18th. Before stating this issue I first wanted to make sure, it is still in the most current daily. Therefore I had installed the newer 308 preview.
Any other daily you would suggest to try?

@jonvanausdeln
Copy link

jonvanausdeln commented Nov 3, 2022

@ronblum , works fine on my M1 machine. 2022.12.0-307

@jonvanausdeln jonvanausdeln removed their assignment Nov 3, 2022
@gsgxnet
Copy link
Author

gsgxnet commented Nov 3, 2022

May be my system behaves as it does because I do not have Rosetta installed here, pure arm64 Monterey.

Another probably connected issue - I can not create any quarto document on the same system:
image
Reproducible, just File -> New File -> Quarto Document

@ronblum
Copy link
Contributor

ronblum commented Nov 4, 2022

@gsgxnet Did you by chance install a version of Quarto from https://quarto.org? If so, it takes precedence over the version that comes bundled with RStudio. If so, either

  • download a new version from https://quarto.org, or
  • remove /usr/local/bin/quarto which will allow RStudio to rely on its bundled version.

@gsgxnet
Copy link
Author

gsgxnet commented Nov 4, 2022

@ronblum There is no quarto on this system from https://quarto.org/.
I had installed the R quarto package after the problems I have reported here to find out if it might help. It does not, so removed that package again.
Only quarto is the one contained in the RStudio:

sudo find / -name quarto -ls 2>&-                  
Password:
1518194        0 drwxr-xr-x    4 gsmaa            admin                 128 Nov  2 21:08 /System/Volumes/Data/Applications/RStudio.app/Contents/Resources/app/quarto
1518217       16 -rwxr-xr-x    1 gsmaa            admin                5556 Nov  2 14:33 /System/Volumes/Data/Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto
1520595        0 drwxr-xr-x    9 gsmaa            admin                 288 Nov  2 21:08 /System/Volumes/Data/Applications/RStudio.app/Contents/Resources/app/quarto/share/lua-types/quarto
1522588        0 drwxr-xr-x    5 gsmaa            admin                 160 Nov  2 21:08 /System/Volumes/Data/Applications/RStudio.app/Contents/Resources/app/quarto/share/extensions/quarto
1518194        0 drwxr-xr-x    4 gsmaa            admin                 128 Nov  2 21:08 /Applications/RStudio.app/Contents/Resources/app/quarto
1518217       16 -rwxr-xr-x    1 gsmaa            admin                5556 Nov  2 14:33 /Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto
1520595        0 drwxr-xr-x    9 gsmaa            admin                 288 Nov  2 21:08 /Applications/RStudio.app/Contents/Resources/app/quarto/share/lua-types/quarto
1522588        0 drwxr-xr-x    5 gsmaa            admin                 160 Nov  2 21:08 /Applications/RStudio.app/Contents/Resources/app/quarto/share/extensions/quarto

Same files are shown twice, I assume macOS sets some internal links.

I have no clue at all what is causing this.

@gsgxnet
Copy link
Author

gsgxnet commented Nov 7, 2022

I checked with the file command:
file /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc: Mach-O 64-bit executable x86_64
this is definitely an Intel app, neither Universal nor Apple chips. This is the reason for the Bad CPU error I got. Are you sure you do deliver a fully Apple silicon RStudio app?
Anyhow I will try the most current daily now, may by the problem is already solved.


Checked with 316 preview Universal from your dailies download, same:

file /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc 
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc: Mach-O 64-bit executable x86_64

So this is not an universal app.

For further info see:
https://apple.stackexchange.com/questions/429197/how-can-i-distinguish-arm-binaries-from-x86-binaries-on-macos

@kevinushey
Copy link
Contributor

May be my system behaves as it does because I do not have Rosetta installed here, pure arm64 Monterey.

Is installing Rosetta an option for you?

@gsgxnet
Copy link
Author

gsgxnet commented Nov 8, 2022

Is installing Rosetta an option for you?

@kevinushey - technically installing Rosetta could be a solution. But I prefer not to do so, because there seems to be no way to get totally rid of it later. And I prefer to avoid clutter if possible.

There is no real urgent need to get RStudio Univeral running on my new Apple Macbook. I still have an other option to use RStudio. I will patiently wait for a solution.
Creating a fully Universal app seams not to be so easy, JetBrains has some X86 only components in their apps hiding in corners as well.

@github-actions
Copy link

github-actions bot commented May 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues which have been closed automatically due to inactivitiy. label May 8, 2023
@gsgxnet
Copy link
Author

gsgxnet commented May 8, 2023

Retested on Version 2023.03.0+386. Still the same error when Rosetta is not installed.

@github-actions github-actions bot removed the stale Issues which have been closed automatically due to inactivitiy. label May 9, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues which have been closed automatically due to inactivitiy. label Nov 10, 2023
@gsgxnet
Copy link
Author

gsgxnet commented Nov 10, 2023

Rechecked with current RStudio and also looking for a local Quarto install.
Both still need Rosetta2.
I still hope in the not too distant future there will be an Apple Silicon native Quarto both from quarto.org and embedded in RStudio.
For Linux there is a ARM variant.

@github-actions github-actions bot removed the stale Issues which have been closed automatically due to inactivitiy. label Nov 11, 2023
@kevinushey
Copy link
Contributor

The next Quarto release should have arm64 builds available; hopefully that will come sometime in the new year.

@leo-maxwell
Copy link

I came across this problem and the solution is simple: you just download the latest pandoc arm64 version and overwrite the old one in the quarto folder inside the Rstudio app bundle. The knit worked just fine after this operation. Hope it will help everyone concerned about this problem. I found my laptop to have a much longer battery life after I removed Rosetta 2, and I do not want to install it again.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues which have been closed automatically due to inactivitiy. label Sep 26, 2024
Copy link

This issue has been automatically closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macos qa repro stale Issues which have been closed automatically due to inactivitiy.
Projects
None yet
Development

No branches or pull requests

5 participants