Skip to content

Conversation

@randoentity
Copy link
Contributor

I figured it was time for an update to the ebuild.
ANGLE was added as a dependency and I didn't want to use gclient so the angle ebuild is a mess.
Hence this is a work in progress but I'm not sure if I'll continue working on it.
angle installs with a bunch of warnings. I am still learning how to properly get the libraries to link so Ladybird failed the last time I tried to build it. I'll see if it's fixed tomorrow.

@Norbiros
Copy link

Maybe related: LadybirdBrowser/ladybird@c60e3fb

@CastixGitHub
Copy link
Owner

Keep it up :3

If you're struggling finding the right deps for the angle ebuild, once it builds,
here's a little dumb script of mine https://bpa.st/YLIQ (1 month expiry), hope it helps
(if you get lots of empty "depends on:" then try uncommenting the 'skipped' print)

@randoentity
Copy link
Contributor Author

@Norbiros I don't think It's related to that. I'm not even sure if vcpkg is used here (it seems to be for Windows?).

@CastixGitHub Thanks for the script! I was almost going to set up a chroot env (or a vm with the new-ish qcow2 images) and trial-and-erroring it. It's been a fun/frustrating trip learning about cmake. I'm still having some issue linking the libraries but I think I'm almost there.

@Norbiros
Copy link

vcpkg is used to manage libraries within the codebase, ensuring consistency across development environments. My concern was that they use version 7258, while you used 7287, which might cause minor incompatibilities, fe. all the WPT tests use the version specified in vcpkg

@randoentity randoentity force-pushed the update-20250714 branch 2 times, most recently from 7498b1f to b301aa1 Compare July 17, 2025 08:06
@randoentity
Copy link
Contributor Author

@Norbiros Aaaaah I see, thanks! I this is the first time I'm working on ebuilds (other than my last PR here) and with cmake so your input is very helpful. It seems like it runs "fine" (I have no frame of reference, I should probably be running a test suite?*) with the newer version of Angle.
*And those are the WPT tests, right? I don't really have time to dive into that anymore so I suppose it's best if I just pin this build to 7258?

@Norbiros
Copy link

Yeah, it's better to use the same versions that Ladybird uses in vcpkg to ensure compatibility and avoid unexpected issues during build or runtime.

And those are the WPT tests, right?

Their CI also uses versions from vcpkg, so it's well tested. Using slightly different versions might cause problems. It's just better practice.

@randoentity randoentity marked this pull request as ready for review July 17, 2025 09:32
@randoentity
Copy link
Contributor Author

Okay I've pinned it to 7258.
I just did another build and ran Ladybird and it's "working for me". I've hit a skill/time/motivation wall to clean up the rest of the ebuild, so I'll probably leave it like this.

@robclancy
Copy link

For the record I got this PR to build. I still seg fault (same error I have always gotten when I try again though).

@CastixGitHub
Copy link
Owner

CastixGitHub commented Aug 1, 2025

Hi @robclancy thanks for the report, can you provide more info? (like running it with gdb and sending the backtrace) (edit: ok, please update #11 if you can (so it worked for you with simdutf 7.0.0 but not 7.3.3))


Keeping me from merging this:
I think gentoo is about USE(r flags/choices) and being a community

  • Angle's ebuild doesn't yet have them, sure it should always work as dependencies are always in-sync, but still, gentoo authors packaged libraries for reasons, and by using git submodules we are effectively bypassing gentoo.
  • I think angle should work even without vulkan. But you can't just toggle a flag and build with gn.
  • Angle's gn does a lot of "$angle_root/third_party/thing/src" and I wonder if it needs the dependency's source code rather than the installed headers or whatnot

So, as long as angle isn't a meta-program that needs that much source code as it's input,

I see three paths:

  • Keep using gn and hack that until we can select system-wide deps/features
  • Write an ad-hoc ninja generator || use another build tool to paranoically review their gn
  • Actually contribute to angle's gn
    • skia has a bunch of skia_use_system_thing, that's the best option, all of the distros and chromium could get the benefits…

Thanks

@CastixGitHub CastixGitHub added help wanted Extra attention is needed HEAD Didn't merge yet, help wanted labels Aug 9, 2025
@uis246
Copy link
Contributor

uis246 commented Aug 9, 2025

I'm trying to wrap my head around.

Why ANGLE is here?
Why there is patch for using it instead of system GLES?
What graphics driver(or at least translation layer) is doing in browser overlay?

find_package(PkgConfig)
pkg_check_modules(angle REQUIRED IMPORTED_TARGET angle)
- set(ANGLE_TARGETS PkgConfig::angle)
+ pkg_check_modules(GL REQUIRED IMPORTED_TARGET angle_glesv2=0.0.0)
Copy link
Owner

@CastixGitHub CastixGitHub Aug 9, 2025

Choose a reason for hiding this comment

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

@uis246 pointed out (no, I didn't understand) Seems like you're not using vulkan, but depend on it

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be upstream already

set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
else()
- set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
+ set(CMAKE_INSTALL_RPATH "/usr/lib64/angle:$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
Copy link
Owner

Choose a reason for hiding this comment

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

lib64 here

Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoded path? Not good. We don't know where EPREFIX is.

@CastixGitHub CastixGitHub changed the title Bump b1f1ae87ae3a459561d899dbf46e5a5595999ae ANGLE - Bump b1f1ae87ae3a459561d899dbf46e5a5595999ae Aug 9, 2025
@CastixGitHub
Copy link
Owner

CastixGitHub commented Aug 9, 2025

Why ANGLE is here?

If you wish to remove ANGLE, you're stuck with opengl (you won't get a WebGL that uses vulkan), to remove it, you need to find all the little things such as EGL_IOSURFACE_PLANE_ANGLE and so on and give them aliases to the "input" API

LadybirdBrowser/ladybird#5785

https://github.com/LadybirdBrowser/ladybird/pull/2688/files <- example commit that shows some of the angle usage

@uis246
Copy link
Contributor

uis246 commented Aug 9, 2025

(you won't get a WebGL that uses vulkan)

Zink. Does exactly same thing.

@uis246
Copy link
Contributor

uis246 commented Aug 10, 2025

you need to find all the little things such as EGL_IOSURFACE_PLANE_ANGLE

It is not used outside of MacOS only code

postrm() {
xdg_desktop_database_update
}

Copy link
Owner

Choose a reason for hiding this comment

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

Please, don't submit unreviewed LLM generated output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try not to. I do use LLMs but I think I just copied this from another ebuild and I think I even read the docs on this one, but I was pretty fatigued. I thought it was just to clean up the desktop shortcuts and pretty harmless to leave in. Sorry if this wasn't harmless. I only started with ebuilds with ladybird-ebuild, hopefully I get time to learn more later.

Copy link
Owner

Choose a reason for hiding this comment

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

No prob. sorry being harsh... It's just it didn't pull in the eclass nor copy the relevant xdg files, so like "oh you added xdg -> no you didn't"
and also some function/hook name was just incorrect

clean up the desktop shortcuts

(trying to simplify)
it's about creating and categorizing the launcher for the desktop environment, in a format backed by freedesktop
and the mime db is about "what 'apps' can open the file you double-clicked into"

@CastixGitHub
Copy link
Owner

It is not used outside of MacOS only code

Well, So I discovered
https://registry.khronos.org/webgl/extensions/ANGLE_instanced_arrays/
https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays
and similar

Removed ANGLE through patch files, let's see how quickly they become outdated
(And no, I didn't properly test WebGL after thinkering with it)

Thx

@robclancy
Copy link

Hi @robclancy thanks for the report, can you provide more info? (like running it with gdb and sending the backtrace) (edit: ok, please update #11 if you can (so it worked for you with simdutf 7.0.0 but not 7.3.3))

My segfaults are unrelated to this ebuild I'm 99% sure. It's just something wrong on my system that is hard to figure out, last time I tried debugging it I got to some issues on the ladybug repo but it wasn't clear. I just try new builds every known and again to see if it works and will try debug again when I have time.

@CastixGitHub
Copy link
Owner

@robclancy Got it, make sure you don't have a /usr/local/include/simdutf/

@uis246
Copy link
Contributor

uis246 commented Aug 12, 2025

Removed ANGLE through patch files, let's see how quickly they become outdated (And no, I didn't properly test WebGL after thinkering with it)

As I mentioned in LadybirdBrowser/ladybird#5785 (comment) edit2, there are some calls to ANGLE_robust_client_memory. They are like regular calls, but with length checks.

@CastixGitHub
Copy link
Owner

My ladybird tree is at e2b245add184445635887616cf4547976a753a6f and I can't grep ANGLE_robust_client_memory
Please open a new issue explaining this if you still encounter problems after 58630ca

@uis246
Copy link
Contributor

uis246 commented Aug 13, 2025

@CastixGitHub CastixGitHub reopened this Aug 13, 2025
@CastixGitHub CastixGitHub added rebase-needed and removed HEAD Didn't merge yet, help wanted labels Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed rebase-needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants