servo / mozangle

Mozilla’s fork of Google ANGLE, repackaged as a Rust crate
Other
42 stars 23 forks source link

Shared object for macos and linux #71

Closed atbrakhi closed 10 months ago

atbrakhi commented 11 months ago

This PR produces shared objects for macOS and Linux. It was successfully tested on macOS. See https://github.com/servo/servo/issues/30593

TODO:

Co-authored-by: Mukilan Thiyagarajan [mukilan@igalia.com]

atbrakhi commented 11 months ago

I'm opening as draft to get some early feedback

sagudev commented 11 months ago

I think this should be behind cargo feature.

CI isn't happy about change, but that might not be PR issue.

atbrakhi commented 11 months ago

ok, so both macos and linux is passing on CI after 2bc03f1. There was an issue with linking libs that was causing test failure in both system. I was expecting to see some errors on windows! ~on it now~

atbrakhi commented 11 months ago

Okay, so now we have everything behind a feature flag. This won't break the current behavior anymore.

I plan to send a separate PR for Windows, as it might take some time for me to get my hands on a Windows system. Meanwhile, we can review this PR.

cc @sagudev

atbrakhi commented 11 months ago

If I understand this PR correctly, it only introduces dylib building but not reusing it right?

Indeed, this PR introduces the building of dylib, providing the option to use dylib in other projects if wanted.

By reusing, do you mean within mozangle or in Servo?

sagudev commented 11 months ago

By reusing, do you mean within mozangle or in Servo?

Both.

atbrakhi commented 11 months ago

By reusing, do you mean within mozangle or in Servo?

Both.

okey, we are not reusing it anywhere, at least not in this PR.

maybe i am missing something, but specifically for macos and linux, I did not come across a case where we would want to reuse the shared object. I noticed that, It is different for mozjs, where i am having to use shared object within mozjs

sagudev commented 11 months ago

On linux and mac we only use translator from angle which is very small, but on windows we actually build the real stuff (dx9 backend) which is big, there we already have build_dlls feature which is needed for GL support in other parts of servo on windows.

I thought the whole point of creating shared objects was to reuse them to have faster compilation on servo. What is point of shared objects if not this (on linux and mac)?

atbrakhi commented 11 months ago

@sagudev i think we are on same page.

so this is how i was planning to go with it:

atbrakhi commented 11 months ago

@sagudev, would you like me to change anything in this PR?

sagudev commented 11 months ago

@sagudev, would you like me to change anything in this PR?

It needs rebase because #69 landed, which changes how build.rs works, so I will review it again after rebase, but generally looks good.

sagudev commented 10 months ago
* Create shared object for all system (windows is missing in this PR)

* afterwards reuse them in servo

I think reusing should be done as part of mozangle (but this is could be done as follow up).

sagudev commented 10 months ago

I do not have write access to this repo, so somebody else will need to merge this.

jdm commented 10 months ago

I do not have write access to this repo, so somebody else will need to merge this.

Are you sure? You're part of the Developers team, which has write access.

sagudev commented 10 months ago

I do not have write access to this repo, so somebody else will need to merge this.

Are you sure? You're part of the Developers team, which has write access.

no access