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

Use chromium instead of a manual chrome download #178

Merged
merged 15 commits into from
Sep 17, 2024
Merged

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Sep 13, 2024

Advantages:

  • chromium is available on both amd64 and arm64 for most distros (chrome isn't and e.g. fails on Ubuntu)
  • Less pre_install and post_install due to direct package manager call
  • More lightweight and secure (as chromium doesn't bundle all the Google stuff)

No arch-agnostic solution for the old centos but that shouldn't matter much in practice.

FYI: Currently, {chromote} errors when being installed via pak on any arm64 Linux distribution as the download has amd64 hardcoded.

@pat-s
Copy link
Contributor Author

pat-s commented Sep 13, 2024

I think we're finally good here.

Copy link
Contributor

@glin glin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, and I assume this works fine for Chromote? cc @schloerke just to double check.

I think we actually had chromium before and then replaced it with Chrome at some point. The original issue was #86, so I wonder if chromium still has the snap issue.

{
"os": "linux",
"distribution": "ubuntu",
"versions": ["20.04", "22.04"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Ubuntu 24.04 supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good catch, I lost it in the refactoring as starting with 24.04, the key is chromium instead of chromium-browser. Added it.

@pat-s
Copy link
Contributor Author

pat-s commented Sep 13, 2024

Sounds good to me, and I assume this works fine for Chromote?

That was the initial motivation, to get all OS & their archs working for {chromote}.

Not sure if #86 is still valid/important as meanwhile one can install it through apt using chromium-browser.

@schloerke
Copy link
Contributor

Sounds good to me, and I assume this works fine for Chromote? cc @schloerke just to double check.

I looks ok to me. I have not tested it. But {chromote} should pick up a chrome devtools protocol compatible browser by default.

Thank you for the updates!

@glin
Copy link
Contributor

glin commented Sep 16, 2024

I just tested apt install chromium-browser in Ubuntu 22/24 and it does still seem to be a stub for the snap package:

docker run -it --rm ubuntu:jammy

apt update -qq && apt install -y chromium-browser

$ chromium-browser

Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:

snap install chromium

$ snap install chromium
error: cannot communicate with server: Post "http://localhost/v2/snaps/chromium": dial unix /run/snapd.socket: connect: no such file or directory

So I think we still do have the same issue from #86 where this isn't going to work well for containers.

Is there an alternative direct binary download for chromium we could use instead? Just from a quick search, https://www.chromium.org/getting-involved/download-chromium/ lists some script for Linux, but I haven't tested it and it's 8 years old 🤔

@pat-s
Copy link
Contributor Author

pat-s commented Sep 17, 2024

Ah, now I see what #86 was about.

I've found a ppa for jammy/noble: ppa:xtradeb/apps. Looks like a sophisticated project that won't go unmaintained in the near future: https://xtradeb.net/apps/chromium/.

However, it is missing support for focal.
As I couldn't find a solution for it, I kept it at the old static amd64 download. Given that focal is EOL soon anyhow, this might be okayish. The other changes are still an improvement and allow having dynamic amd64/arm64 support.

NB: please squash-merge to avoid including all the non-meaningful dummy commits in which I fixed the schema.

@glin
Copy link
Contributor

glin commented Sep 17, 2024

Aw, unfortunate that google doesn't provide any nice way of apt installing chromium. We usually avoid 3rd-party PPAs if at all possible, but this one looks fine and doesn't seem like it'll conflict with the default system libraries. Looks good.

@glin glin merged commit 32da104 into rstudio:main Sep 17, 2024
24 checks passed
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 this pull request may close these issues.

3 participants