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

bootstrap: unify snapshot builder and embedder entry points #48242

Closed
wants to merge 2 commits into from

Commits on May 29, 2023

  1. bootstrap: unify snapshot builder and embedder entry points

    - Run the embedder entry point directly through runEmbedderEntryPoint(),
      instead of going through another JS -> C++ trip through the
      function returned by getEmbedderEntryFunction()
    - For --build-snapshot, read the snapshot script code directly in C++
      and pass it to SnapshotBuilder::Generate(), this makes the entry point
      more explicit instead of hiding it in JS land, and also makes it
      possible to invoke SnapshotBuilder::Generate() internally to create
      a custom snapshot.
    - Previously we used process.execPath for the embedder to create
      __filename and __dirname in the snapshot builder script while using
      process.argv[1] for --build-snapshot (where it's always set) which
      results in inconsistencies. We now require the embedder to also set
      args[1] when creating the Environment if they intend to run snapshot
      scripts with a context that contains __filename and __dirname, which
      would be derived from args[1]. If they prefer not to include build-time
      paths in the snapshot, we now provide node::GetAnonymousMainPath()
      as an alternative.
    joyeecheung committed May 29, 2023
    Configuration menu
    Copy the full SHA
    d830288 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2023

  1. Configuration menu
    Copy the full SHA
    497f1f9 View commit details
    Browse the repository at this point in the history