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

[WPE] Checkout a specific version of Cog instead of master #7508

Conversation

mcatanzaro
Copy link
Contributor

@mcatanzaro mcatanzaro commented Dec 12, 2022

02eb578

[WPE] Checkout a specific version of Cog instead of master
https://bugs.webkit.org/show_bug.cgi?id=249034

Reviewed by NOBODY (OOPS!).

Igalia wants to start running performance tests, but performance
test results will be inconsistent if the version of cog may be different
from one day to the next. A specific commit should be used instead.

The downside of this change is we now have to remember to update the
Cog version to use in a rather unobvious place, Tools/PlatformWPE.cmake,
which is not something that we will remember to do on a regular basis.
We need a better way to handle this, such as adding it to the Cog
release process.

* Tools/PlatformWPE.cmake:

02eb578

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ gtk-wk2
❌ πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 ❌ πŸ§ͺ api-gtk
βœ… πŸ›  tv ❌ πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  watch-sim

@mcatanzaro mcatanzaro self-assigned this Dec 12, 2022
@mcatanzaro mcatanzaro added the WPE WebKit WebKit WPE component label Dec 12, 2022
@mcatanzaro mcatanzaro requested review from clopez and a team December 12, 2022 22:20
@mcatanzaro mcatanzaro force-pushed the eng/WPE-Checkout-a-specific-version-of-Cog-instead-of-master branch from b103e74 to 87d52fd Compare December 12, 2022 22:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2022
@mcatanzaro
Copy link
Contributor Author

I finally noticed that the EWS is broken:

FAILED: core/libcogcore.so.9.1.1 
cc  -o core/libcogcore.so.9.1.1 core/libcogcore.so.9.1.1.p/cog-directory-files-handler.c.o core/libcogcore.so.9.1.1.p/cog-host-routes-handler.c.o core/libcogcore.so.9.1.1.p/cog-modules.c.o core/libcogcore.so.9.1.1.p/cog-platform.c.o core/libcogcore.so.9.1.1.p/cog-prefix-routes-handler.c.o core/libcogcore.so.9.1.1.p/cog-request-handler.c.o core/libcogcore.so.9.1.1.p/cog-shell.c.o core/libcogcore.so.9.1.1.p/cog-utils.c.o core/libcogcore.so.9.1.1.p/cog-webkit-utils.c.o core/libcogcore.so.9.1.1.p/cog-gamepad-manette.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libcogcore.so.9 -Wl,-rpath,/usr/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libsoup-3.0.so -Wl,--export-dynamic /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so -pthread /usr/lib/x86_64-linux-gnu/libglib-2.0.so /usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libgobject-2.0.so /usr/lib/x86_64-linux-gnu/libwpe-1.0.so -L/app/webkit/WebKitBuild/Release/lib -lWPEWebKit-1.1 /usr/lib/x86_64-linux-gnu/libmanette-0.2.so -Wl,--end-group
/usr/lib/gcc/x86_64-unknown-linux-gnu/12.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lWPEWebKit-1.1: No such file or directory
collect2: error: ld returned 1 exit status

So yeah, that plan is not going to work.

@clopez
Copy link
Contributor

clopez commented Dec 20, 2022

It seems the build failure is because you used as version 0.15.1, which is a commit previous to Igalia/cog@be29794 (API changes after #3886)

So, instead of using a tagged version I think we should use a git hash of the last version on master, and update this periodically as needed (the build breaks or someone remembers to update it).

So try using 7eae03e instead of 0.15.1

@mcatanzaro
Copy link
Contributor Author

Secondary goal here is to use a version of cog that can build #5944, so using anything on the cog master branch will not be possible unless we're willing to make cog depend on WebKit pull request branches. So I'll prepare a cog side branch and switch WebKit to use that for now. Not sure how soon I'll get to this, though.

@clopez
Copy link
Contributor

clopez commented Dec 20, 2022

Maybe an idea is to patch the Cog Meson build system to allow manually selecting which API to use and pass the desired parameter to Cog/Meson from WebKit/CMake

@mcatanzaro
Copy link
Contributor Author

Maybe an idea is to patch the Cog Meson build system to allow manually selecting which API to use and pass the desired parameter to Cog/Meson from WebKit/CMake

That won't work either. If we use the wpe-webkit-2.0 API then we have a circular dependency between cog and WebKit when making API changes. If we use the wpe-webkit-1.1 API, like I tried to do above, then the build will fail because it doesn't exist anymore in WebKit.

I see two workable options:

  1. WebKit must depend on side branches of cog, where cog is modified to account for WebKit API changes that have not yet landed in WebKit
  2. Simply turn off ENABLE_COG for now, and reenable right before releasing 2.39.90 when the API stabilizes

My preference is option 2 because that would be easier for WebKit development, but it risks that we forget to keep cog in good shape.

@mcatanzaro
Copy link
Contributor Author

So for this pull request, let me switch to using the latest release of cog.

I'll open a separate pull request to temporarily disable cog. I think perf tests can use MiniBrowser instead, at least for the next two months, right?

https://bugs.webkit.org/show_bug.cgi?id=249034

Reviewed by NOBODY (OOPS!).

Igalia wants to start running performance tests, but performance
test results will be inconsistent if the version of cog may be different
from one day to the next. A specific commit should be used instead.

The downside of this change is we now have to remember to update the
Cog version to use in a rather unobvious place, Tools/PlatformWPE.cmake,
which is not something that we will remember to do on a regular basis.
We need a better way to handle this, such as adding it to the Cog
release process.

* Tools/PlatformWPE.cmake:
@mcatanzaro mcatanzaro removed the merging-blocked Applied to prevent a change from being merged label Dec 22, 2022
@mcatanzaro mcatanzaro force-pushed the eng/WPE-Checkout-a-specific-version-of-Cog-instead-of-master branch from 87d52fd to 02eb578 Compare December 22, 2022 19:39
@mcatanzaro
Copy link
Contributor Author

So for this pull request, let me switch to using the latest release of cog.

Switched to 0.16.1. Hopefully the EWS will like this.

I'll open a separate pull request to temporarily disable cog. I think perf tests can use MiniBrowser instead, at least for the next two months, right?

#8011

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 22, 2022
@clopez
Copy link
Contributor

clopez commented Dec 22, 2022

I'll open a separate pull request to temporarily disable cog. I think perf tests can use MiniBrowser instead, at least for the next two months, right?

Not really. Using cog is a must.
Also many developers rely on the Cog build.
I don't think we should stop building Cog with WPE. Also I'm not really understanding what is really the problem here.
Why can't you add an optional configuration option parameter inside Cog to make it use one API or the other? I'm a bit lost

@mcatanzaro
Copy link
Contributor Author

Why can't you add an optional configuration option parameter inside Cog to make it use one API or the other? I'm a bit lost

See #7508 (comment)

@clopez
Copy link
Contributor

clopez commented Dec 26, 2022

I see.
The issue is mainly that we should be able to modify Cog to use the new modified API that we are modifying in the same WebKit patch, but we can't have this changes in Cog main branch until the new WebKit API goes into the stable releases.

I see three possible solutions to this:

  1. Use cog side branches as you propose: first we commit the needed changes to use the new API on a branch of the repo Cog and then we implement the WebKit patch changing the API and also modifying the commit to fetch from Cog to be the one of this side branch of the repo Cog.
  2. Modify the cmake code that checkouts the Cog repository to be able to apply a patch to it after fetching it. So we can have a patch that applies over Cog with the modified API. That way when you upload the patch for WebKit with the new changes to the API you also update this new-api-cog.patch patch file that will be applied to Cog before building it. We can add on the release notes of WPE a note saying that this patch should be synced with Cog upstream on the moment of the release.
  3. Import the Cog source code into Source/ThirdParty to be able to modify it directly and then sync it with upstream periodically as needed (e.g.: when we do a new release of WPE).

I can see pros&cons for each solution. But given that modifying the API is not something usual maybe the less bad option for now is to use cog side branches. Perhaps we can name the branch in Cog something like: api-next.

WDYT?

@mcatanzaro
Copy link
Contributor Author

I'm fine with any of the three options, but I suspect option 1 will be easiest.

Option 3 (import into Source/ThirdParty) would require resurrecting cog's CMake build system. Surely that's doable, but this is a temporary problem and it makes sense to go with the simplest solution.

@mcatanzaro
Copy link
Contributor Author

Closing this. I will do this directly in #5944 instead.

@mcatanzaro mcatanzaro closed this Jan 6, 2023
@mcatanzaro mcatanzaro deleted the eng/WPE-Checkout-a-specific-version-of-Cog-instead-of-master branch January 6, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged WPE WebKit WebKit WPE component
Projects
None yet
4 participants