-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
LibWeb: allow using system skia #382
Conversation
Hello! One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the |
what are the advantages of using system's Skia? from my experience with Skia so far, API seem to change quite significantly across versions, e.g. our painter should not build with very latest Skia. so I think it's better to always link with the specific version we get from vcpkg. |
Well... the advantage is that I can actually build the project now. vcpkg doesn't work well on NixOS. This will also make it easier for distros to package ladybird, since downloading random stuff at build time like vcpkg does is not allowed in most distros. If you really need a specific skia version, I can add a version constraint, but it will have to be kept in sync with the one in vcpkg.json |
To be clear, we will need to do something like this to update ladybird in nixpkgs, as you can see from https://github.com/NixOS/nixpkgs/pull/324050/files#diff-8c404e5e6584a620c2eefd7acfd8951eb8988aeba3cfb07408eed81819c2626a. I'm hoping to upstream (a modified version of) that patch |
It's unfortunate that vcpkg does not work on NixOS yet. For now, let's always use Skia from vcpkg, as it is less likely to cause any build issues on popular Linux distributions and macOS, which are the platforms we care about most at the moment. |
If you need a specific state of Skia, please vendor it like everybody else does. (or add a fallback which works for distros, like cairo or something.) |
Hmm. I think we can accept this, as long as we specify a specific version. Keeping the versions in sync isn't that big a deal. |
I don't think it's only the version that matters, but the large variety of skia'a build configuration options -- I can't confidently say we do not rely on a specific config provided by vcpkg. |
unofficial-skia is a vcpkg-specific package. With this change ladybird can be built against skia as provided by system package managers such as guix, mingw, and (soon) nix. All those packages include a .pc file, so we use pkg-config.
I added the constraint. Feel free to direct any bug reports from users of the NixOS package to our issue tracker. That's where they should be reporting anyway, unless they verified that the issue is not caused by NixOS. Most distros follow the same policy. Also note that skia from vcpkg takes priority, so this doesn't affect at all the ladybird.sh build process. |
This way we only have to update it in one place.
In the second commit I solved the duplication problem, at the cost of complexity in the cmake file. I kept it separate so you can choose to merge both or just the first one. |
FWIW, using vcpkg only would prevent building / packaging on OpenBSD (probably other BSDs as well). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, let's go with these. If anyone using PkgConfig to find skia has troubles, we'll point them to their downstream packager.
We'll probably eventually(?) end up vendoring skia, but downstream packagers will want to supply their own version anyway so 🤷
unofficial-skia is a vcpkg-specific package. With this change ladybird can be built against skia as provided by system package managers such as guix, mingw, and (soon) nix. All those packages include a .pc file, so we use pkg-config.
I made it check for unofficial-skia first. I can do the opposite if preferred.
Originally written for the downstream NixOS package https://github.com/NixOS/nixpkgs/pull/324050/files#diff-8c404e5e6584a620c2eefd7acfd8951eb8988aeba3cfb07408eed81819c2626a