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

Automate upgrading v8 binaries #165

Closed
genevieve opened this issue Sep 7, 2021 · 7 comments
Closed

Automate upgrading v8 binaries #165

genevieve opened this issue Sep 7, 2021 · 7 comments

Comments

@genevieve
Copy link
Collaborator

https://github.com/rogchap/v8go#upgrading-the-v8-binaries

This process is non-trivial, and hopefully we can automate more of this in the future.

We should automate the workflow described above so that it can be at least manually run to upgrade v8 to the latest release that chrome uses. This workflow can be used to keep v8 up-to-date as well as ready for when a CVE is detected.

@tmc
Copy link
Collaborator

tmc commented Sep 7, 2021

100% in agreement, a github action that carries out these steps would be a great addition.

@GustavoCaso
Copy link
Contributor

@genevieve I have been toying on how we could automate this process.

We could create a GitHub action that runs using the on.schedule trigger. We can configure based on the release cycle of v8.

The workflow would take care of doing all the steps outlined in the guide reference above and ultimately it would create a pull request with a special name, which would trigger the already existing build workflow

We would need to change the build workflow from on: workflow_dispatch to:

on:
  pull_request:
    # Sequence of patterns matched against refs/heads
    branches:    
      - 'v8_new_release' # for example

So the fully automated process would involve two different workflows.

@genevieve what do you think about this solution? Is there anything that you would like to change?

@dylanahsmith
Copy link
Collaborator

It seems like the V8 patches (in deps/windows_x86_64) used to build on windows are going to frequently break on V8 upgrades.

@genevieve
Copy link
Collaborator Author

@GustavoCaso Yeah the approach sounds good. Last week I was going on the upgrade to v9.3 and wrote a script for the steps described in the readme for building the binaries which looks to also be somewhat covered in the build workflow you linked to.

@GustavoCaso
Copy link
Contributor

@genevieve @dylanahsmith I've made some progress towards automating the v8 binary upgrade and build.

I was able to create a GH workflow that pulls the latest code from the stable version and updates the deps/include as well the submodule commits, similar to the script that @genevieve wrote.

I've done all the testing in my fork, so I wouldn't create too much noise for people.

You can check the workflow for upgrading the v8 binaries here

And here is an example PR that the workflow opens.

Next week I'm going to try to fix the issues with the window compilation process and try replacing MINGW with GN which would allow having consistent builds for windows.

After that, we can update the workflows as mentioned here

@dylanahsmith
Copy link
Collaborator

Next week I'm going to try to fix the issues with the window compilation process and try replacing MINGW with GN which would allow having consistent builds for windows.

build.py is already using gn to build v8 on windows. That is just a meta build system, where MinGW is the port of the GNU Compiler Collection (GCC) to compile for windows.

If we can't fully automate the v8 upgrade, perhaps it could at least be partially automated into a v8-next branch, omitting the windows build until it has been fixed for the next version of v8.

GustavoCaso added a commit to GustavoCaso/v8go that referenced this issue Sep 27, 2021
- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.
GustavoCaso added a commit to GustavoCaso/v8go that referenced this issue Sep 27, 2021
- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.
GustavoCaso added a commit to GustavoCaso/v8go that referenced this issue Sep 28, 2021
- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.
GustavoCaso added a commit to GustavoCaso/v8go that referenced this issue Oct 14, 2021
- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.
dylanahsmith pushed a commit that referenced this issue Oct 22, 2021
* Create v8 upgrade workflow

* Work related to #165

- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.

* Remove custom worflow for building macos and linux builds and use Github actions strategy.fail-fast attribute

* Use custom pythin script to update the deps/include folder during the upgrade workflow

* Change workflow to run everyday and check the current v8 version with the latest v8 version

* move all the logic to the upgrade.py script

* set python version in the GH action

* do not modify cgo.go file

* Trigger upgrade and build workflow using dispatch

* Update README

* Apply feedback on README and script function names

Co-authored-by: Genevieve <genevieve.lesperance@shopify.com>
@genevieve
Copy link
Collaborator Author

Considering this issue closed since Gustavo's PRs have been merged and we have automatic PRs for upgrading v8 that build the binaries across platform and open a PR back to the main upgrade PR for each one. When all the binaries are updated/merged, the tests can be run and the upgrade merged.

mehmetaligok pushed a commit to mehmetaligok/v8go-private that referenced this issue Nov 15, 2024
* Create v8 upgrade workflow

* Work related to rogchap/v8go#165

- Created an scheduled workflow that runs every month, which
automated the steps to upgrade the v8 binaries from source
https://github.com/rogchap/v8go#upgrading-the-v8-binaries

- Created a new workflow that is triggered by a pull_request
which build the v8 binaries for MacOs and Linux. Window
is excluded until we figured out a way to solve the compiler
issues.

* Remove custom worflow for building macos and linux builds and use Github actions strategy.fail-fast attribute

* Use custom pythin script to update the deps/include folder during the upgrade workflow

* Change workflow to run everyday and check the current v8 version with the latest v8 version

* move all the logic to the upgrade.py script

* set python version in the GH action

* do not modify cgo.go file

* Trigger upgrade and build workflow using dispatch

* Update README

* Apply feedback on README and script function names

Co-authored-by: Genevieve <genevieve.lesperance@shopify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants