-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
use-snapshots
build option for cross compile support.
#1852
Conversation
…erate snapshots at runtime for cross compiled builds.
…o do nothing if run a second time.
This is great - I'd love to land this. Am I reading this right that deno would generate a snapshot every time it starts up? This is should be changed to just startup without snapshots. We actually need this feature for warming up V8 before snapshotting to retain optimized code - so I would be happy to do the preliminary work. It would be cool to get this building in CI so that we can retain compatibility and potentially ship a binary. |
I still need to add some code to cache snapshots in the .deno directory so that after the first run we can use snapshots for each subsequent run on cross compiled builds. |
It would need to startup an emulator, I guess. I would need to research what V8 does with mksnapshot. Presumably they have a buildbot for cross compilation. I'm not into the idea of caching the snapshot in the deno_dir - this is inefficient and adds complexity. I'm ok if we side step the snapshot completely for arm for now, until we can figure out how to generate the snapshot at compile time. We need this functionality in other places. |
That should work fine, but for some reason I the |
use-snapshots
build option for cross compile support.
Made the requested changes. This should be ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I have a few nits...
Anything else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you! this is great to have.
I'm have no idea how to accomplish cross-compiling in CI, but it would be a good thing to have eventually. Otherwise I can imagine the arm build will eventually get out of alignment with the rest.
…land#1852)" Slows down startup time denoland#1852 (comment) This reverts commit 75fe80d.
Oops. Not sure why this slow down is happening - but we must revert #1885 |
I guess I'm going to need to do some investigation on this one. |
It seems likely that the snapshot isn’t being used on x64... but I haven’t dug in |
Ok first clue here. |
You are in fact correct @ry, but for some reason this only happens when using build.py. I can tell by binary size the the ones built with |
@ry Found a fix going to create a pr now. |
For cross compiled builds it is currently impossible to generate compatible snapshots at compile time. The snapshots need to be generated on the platform they are intended to run on.
Currently it compiles fine, but fails generating the snapshot during runtime with the following error:It also still needs to be designed in a way that works for all cross builds. I used annotations like this just to test things.