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

Disable cache on non-v8 versions of Node #5

Closed
wants to merge 2 commits into from

Conversation

EdwardDrapkin
Copy link
Contributor

Recently I was playing around with ChakraCore's implementation of Node (https://github.com/nodejs/node-chakracore) and noticed that v8-compile-cache fails since process.version.v8 is not set. I did some experimentation and it seems that running the cache in Chakra causes segmentation faults on version 8.3 and nightlies, so I just made sure that the cache only initializes for v8. I'm not even sure if, philosophically, a package called v8-compiler-cache should enable a cache for other implementations of Node, but I will do my best to watch Chakra's development and get another PR to enable the cache if support comes.

@jdalton
Copy link

jdalton commented Jan 23, 2018

Yes, please 😋

As more tools adopt v8-compile-cache you're essentially blocking other engines, like chakracore, from running. @zertosh could you review this?

@zertosh
Copy link
Owner

zertosh commented Jan 23, 2018

Looking

@zertosh zertosh closed this in f8b0388 Jan 23, 2018
@jdalton
Copy link

jdalton commented Jan 23, 2018

Rock! On the current stable release I see chakracore erroring out in the getCacheDir() function because process.versions.v8 is undefined and path.join chokes on non-string values in
path.join(os.tmpdir(), dirname, process.versions.v8).

I believe this PR will resolve the issue since it just bypasses the entire thing.

Update:

Too fast 🚤 🎉

@zertosh
Copy link
Owner

zertosh commented Jan 23, 2018

Just published v8-compile-cache@1.1.1... sorry about the delay - totally missed this PR

@jdalton
Copy link

jdalton commented Jan 23, 2018

NP!

I'll ping back after investigating to see if other engines produce the buffer. As with chakracore I think the buffer was being produced it's just they don't have a v8 version, since it's not v8, so the directory was the bug point. If it turns out they do work I'll prep a PR for a more generic cache folder naming scheme or one that crawls all versions data.

@zertosh
Copy link
Owner

zertosh commented Jan 23, 2018

Oh wait, process.versions.v8 missing is the problem itself? Let me see if chakracore supports produceCachedData - if so, then push another update with just a fix to path.join.

zertosh added a commit that referenced this pull request Jan 23, 2018
Fixes #5 such that it doesn't preclude future support in different engines
@zertosh
Copy link
Owner

zertosh commented Jan 23, 2018

chakracore doesn't support cached data, but a027ea3 leaves the possibility open to use it if it ever works

@jdalton
Copy link

jdalton commented Jan 23, 2018

Nice! If you want to test in chakra core here is my appveyor.yml for reference.

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 this pull request may close these issues.

None yet

3 participants