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

Quarto deos not find chromium if installed through flatpak #2980

Closed
4 tasks done
Tracked by #10170
ralmond opened this issue Oct 22, 2022 · 6 comments · Fixed by #11187
Closed
4 tasks done
Tracked by #10170

Quarto deos not find chromium if installed through flatpak #2980

ralmond opened this issue Oct 22, 2022 · 6 comments · Fixed by #11187
Assignees
Labels
chromium enhancement New feature or request
Milestone

Comments

@ralmond
Copy link

ralmond commented Oct 22, 2022

Bug description

Quarto apparently requires Chrome or Chromium to render graphviz documents, but on Pop_OS 22.04, chromium is only available through flatpak. The search method in puppeteer.ts#findChrome don't find the flatpak installation.

Steps to reproduce (Debian Linux assumed):

  1. Uninstall Chrome/Chromium installed through deb package or quarto tools install chromium (this should remove chromium-browser from the path.
  2. Install chromium using flatpak install org.chromium.Chromium (note, run this as user, not root).
  3. Verify that chromium runs by executing flatpak run org.chromium.Chromium
  4. Attempt to use quarto to render foo.qmd (attached). This will generate the error.

foo.qmd.txt

I'm getting this error with RStudio 2022.07.0+548 "Spotted Wakerobin" Release (34ea3031089fa4e38738a9256d6fa6d70629c822, 2022-07-06) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36 and quarto version 1.0.37

Some quick tests with my machine verify that the command flatpak info org.chromium.Chromium can be used to test that chromium is installed using flatpak (and which flatpak can be used to test for flatpak. The info command will return an error if chromium is not installed.
If it is installed, it can be launched using flatpak run org.chromium.Chromium ... where ... are the usual command line arguments.

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
@ralmond ralmond added the bug Something isn't working label Oct 22, 2022
@ralmond
Copy link
Author

ralmond commented Oct 22, 2022

I just verified that I can work around this issue by adding the following command:

$ cat >chromium-browser <<EOF
#!/bin/sh
flatpak run org.chromium.Chromium $*
EOF
$ chmod +x chromium-browser
$ mv chromium-browser $HOME/.local/bin

It would be better, however, to fix the findChrome function to search for flatpak (and probably snap as well) installations.

@cscheid cscheid added enhancement New feature or request and removed bug Something isn't working labels Oct 24, 2022
@cscheid cscheid added this to the Future milestone Oct 24, 2022
@cscheid
Copy link
Collaborator

cscheid commented Oct 24, 2022

Thanks for the report, and I'm glad the workaround is there for you. If flatpak installations are such that chromium is not on the path, I'm not sure how the quarto codebase should respond. I'm personally relatively conservative wrt non-standard approaches like flatpak and snap (I'm aware of their popularity because of Ubuntu. They still don't appear to use the standard unix way of advertising binaries through PATH).

@Newbytee
Copy link

Flatpak does put "fake binaries" that can be executed in /var/lib/flatpak/exports/bin, but this is not added to path by default in most distributions. Additionally, they use the app ID of the Flatpak as name rather than just the binary name. So, for example Chromium has the executable name org.chromium.Chromium in that path.

@ralmond
Copy link
Author

ralmond commented Feb 27, 2023

That directory is not available on my setup (this is the fairly standard Pop_OS).

My suggestion is that quarto tool install chromium should check for a version of Chromium installed via flatpack or snap, and if necessary add a shell script to launch the browser rather than install a second version of Chromium.

@Newbytee
Copy link

That directory is not available on my setup (this is the fairly standard Pop_OS).

Ubuntu is notorious for shipping outdated versions of Flatpak. Is this the case for Pop!_OS too?

@cderv
Copy link
Collaborator

cderv commented Jun 28, 2024

I have opened an macro issue to track a proper solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants