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

BSD Support #603

Open
anoduck opened this issue Oct 3, 2023 · 2 comments
Open

BSD Support #603

anoduck opened this issue Oct 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@anoduck
Copy link

anoduck commented Oct 3, 2023

Is your feature request related to a problem? Please describe.
Mermaid-Cli does not work under BSD, this is because it uses puppeteer as a dependency. The developer of Puppeteer refuses to support BSD, and he isn't even nice about it.

Describe the solution you'd like
I am not sure what feature puppeteer is used for, but it would nice if either a different library could be used, or the feature using puppeteer could be disabled during the build process to provide support.

@aloisklink
Copy link
Member

Unfortunately, Mermaid currently only works in a browser environment (see mermaid-js/mermaid#3650), so we need a library like puppeteer to automatically run a browser.

We could replace puppeteer with a library like Playwright, but:

  • Playwright is designed for E2E testing, so is much heavier than Puppeteer,
  • We'd need to do a separate pre-setup step, which would be a breaking change,
  • Playwright might not work in corporate environments, which limit browser usage
  • I don't think Playwright supports FreeBSD/OpenBSD either (or even non-Debian-based Linux distros!).

From doing a quick search, it might be possible to run Puppeteer on any already downloaded version of Chromium compiled for FreeBSD/OpenBSD. You should just be able to install with the PUPPETEER_SKIP_DOWNLOAD=1 environment variable set, then start puppeteer (or mermaid-cli), setting the executablePath option, see puppeteer/puppeteer#5034 (comment)

This is essentially what we do on Alpine Linux, which doesn't use glibc.

To be honest, I don't really blame puppeteer developers for not officially supporting BSD. With Cirrus CI limiting free usage, there isn't really a free CI service that has any BSD hosts (unless you count MacOS as BSD).

@aloisklink aloisklink added the enhancement New feature or request label Oct 4, 2023
@anoduck
Copy link
Author

anoduck commented Oct 20, 2023

@aloisklink I see, this is complex due to Mermaid's requirement to generate output in a browser environment. OpenBSD does provide chromedriver in it's ports tree, if this is any help. Also, pyppeteer works fine, just not puppeteer.

As mentioned previously, I personally reached out to the puppeteer development team upon receiving the dreaded, 'unsupported OS system' error message. To which I inquired if OpenBSD was at any way supported at all? The head developer immediately closed the issue out with the comment, "Isn't that what the message says? Unsupported.", without providing any explanation, insight as to why, or opportunity for further dialogue. So, I tried.

If you need someone to run tests or look into anything further let me know, but as for now, I am satisfied with explanation and support received.

Cheers.

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

No branches or pull requests

2 participants