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

Remove Node.js dependency from the build system and upgrade to a recent V8 version #477

Closed
ahmadov opened this issue Sep 27, 2019 · 10 comments · Fixed by #482
Closed

Remove Node.js dependency from the build system and upgrade to a recent V8 version #477

ahmadov opened this issue Sep 27, 2019 · 10 comments · Fixed by #482
Assignees

Comments

@ahmadov
Copy link
Contributor

ahmadov commented Sep 27, 2019

The J2V8 project currently has a dependency on the old Node.js (7.x) build system to build and produce all necessary V8 static libraries. In recent years, the upstream V8 build system has been improved and we could use it directly instead of using the Node.js build system.

Switching from Node.js to a recent upstream V8 provides the possibility to simplify the build as well as moving to J2V8 to V8 7.x code base at the same time.

@ahmadov ahmadov self-assigned this Sep 27, 2019
@michaeltheory
Copy link

This is something that is quite important to my organization and what appears to be many other individuals posting issues on this repo over the past few years.

I wonder, is there a way to sponsor this project as I've seen popping up on other GH repos, in order to facilitate more activity like this?

@irbull
Copy link
Member

irbull commented Oct 2, 2019

Upgrading to a newer V8 will mean the existing Debug API won't work. There is a new API (see #478). It's not clear if the APIs are compatible.

My suggestion would be to move to the new version of V8 and update the J2V8 Major version (maybe even move to 7 to indicate V8 version 7). Then add the debug API as a second step. I think the new version is more important to most people, and the debug can be looked at separately.

ahmadov pushed a commit that referenced this issue Oct 4, 2019
- Increase J2V8 version to 7.0.0, the major version now matches the V8
version
- Upgrade to V8 version 7.4.288

Fixes #477 for the Linux x64 target platform
@ahmadov
Copy link
Contributor Author

ahmadov commented Oct 4, 2019

I enabled Github Actions to build J2V8. If you follow the commit above you should find green check mark next to issue's title. This leads you to the build output. There you can find the build the artifact (zip file containing .jar file) in the Artifacts dropdown box in the upper right corner.

@Cretezy
Copy link

Cretezy commented Oct 4, 2019

Are Windows/Mac builds possible to be added to Actions?

Also, where are the latest current builds published? I only see 4.6/4.8 available in Maven central for the platforms.

@ahmadov
Copy link
Contributor Author

ahmadov commented Oct 4, 2019

The builds are currently not published to Maven central. The publishing stage can be added later.

@irbull decided to reduce the scope of the J2V8 project, you can find more information here: #441. Currently, the Windows/Mac builds are not a priority, but it'd be easy to build with Github Actions. Adding the Windows/Mac builds back using Github Actions might be a good community contribution.

@Cretezy
Copy link

Cretezy commented Oct 4, 2019

How well does the new V8 work with J2V8? Is it beta-ready? I'm currently not running production software with this and am ready to build myself.

Great work!

Edit: Can't seem to be able to build (using python build.py -t linux -a x64 --docker --keep-native-libs all, same as workflow):

Warnings:
Conflicting directory /v8build/v8 moved to /v8build/_bad_scm/v8gIcXbA.
...
IOError: [Errno 2] No such file or directory: '/v8build/v8'
Running: gclient root
Running: gclient config --spec 'solutions = [
  {
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "managed": False,
    "name": "v8",
    "deps_file": "DEPS",
    "custom_deps": {},
  },
]
'
Running: gclient sync --with_branch_heads
Subprocess failed with return code 1.
The command '/bin/sh -c fetch v8' returned a non-zero code: 1

@ahmadov
Copy link
Contributor Author

ahmadov commented Oct 4, 2019

Currently, I disabled the Node.js and V8-debug support (and corresponding unit tests) on the branch v8-7.4.288-build. Except for these unit tests, all others are passed and green. At EclipseSource we use J2V8 in our eclipsesource/tabris-js project but we still haven't tried the J2V8 based on the new V8 with the tabris.js. Only after that we can provide a feedback how stable it is.

If you can share your own experience using the new J2V8 this would be great.

@Cretezy
Copy link

Cretezy commented Oct 4, 2019

Building with Docker fails with the above error, and without gives:

fatal error: libplatform/libplatform.h: No such file or directory
 #include <libplatform/libplatform.h>

I tried to Actions artifact and seems to be working file. V8.getV8Version() seems to be broken, although it's broken from 4.8.0 too

@ahmadov
Copy link
Contributor Author

ahmadov commented Oct 4, 2019

This code works for me:

import com.eclipsesource.v8.V8;

public class Main {    
    public static void main(String[] args) {
        V8.createV8Runtime();
        System.out.println("V8 version " + V8.getV8Version());
    }
}

This is how I executed it:

$ javac -cp .:j2v8_linux_x86_64-7.0.0-SNAPSHOT.jar Main.java && java -cp .:j2v8_linux_x86_64-7.0.0-SNAPSHOT.jar Main
V8 version 7.4.288

@Cretezy
Copy link

Cretezy commented Oct 4, 2019

Ah I see, wasn't creating the runtime before. V8 version: 7.4.288 woohoo!

Although I still can't build, and having issues with my fork's Actions for some reason (never starting). I have the Windows/MacOS build code at https://github.com/Cretezy/J2V8/blob/v8-7.4.288-build/.github/workflows/main.yml, but can't test it

ahmadov pushed a commit that referenced this issue Oct 11, 2019
- Increase J2V8 version to 6.0.0, the major version now matches the V8
version
- Upgrade to V8 version 7.4.288

Fixes #477 for the Linux x64 target platform
irbull pushed a commit that referenced this issue Nov 13, 2019
- Increase J2V8 version to 6.0.0, the major version now matches the V8
version
- Upgrade to V8 version 7.4.288

Fixes #477 for the Linux x64 target platform
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

Successfully merging a pull request may close this issue.

4 participants