V8 Engine Documentation

website·Indexed 30 days ago

https://env.jiangshengdev.com

Guides for building V8 from source on macOS arm64, including cloning depot_tools, installing build dependencies, and project initialization for debugging with CLion.

Tokens
2.8K
Snippets
14
Records
27
Agent score
50%

What's inside V8

  1. Launch the SQL Server 2019 installer from ISO

    After downloading the ISO media, follow these steps to start the installation process:

    1. Right-click the SQLServer2019-x64-CHS-Dev.iso file and select Mount (装载) to create a virtual drive.
    2. Open the mounted drive and run setup.exe as an Administrator.
    3. Confirm any User Account Control (UAC) prompts by clicking Yes.

    If the installer fails to start or the UAC prompt does not appear, ensure the current user account has full administrative privileges and explicitly use the 'Run as administrator' option.

    # No CLI command available, manual execution of setup.exe is required
  2. Clone and install depot_tools

    v8
    To use the Chromium development tools, clone the depot_tools repository into a local directory. This provides the necessary scripts and binaries for managing Chromium and V8 source code.
    mkdir -p ~/chromium/tools
    cd ~/chromium/tools
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  3. Verify system requirements for SQL Server 2019

    To ensure a supported installation of SQL Server 2019, verify that your system meets the following minimum requirements:

    • OS Version: Windows 10 Pro or higher
    • Build Version: 22H2 or higher
    • System Type: 64-bit operating system, x64-based processor

    Users can check their system information via Start Menu > Settings > System > About or by searching for About your PC (电脑信息) in the Start menu. Installations on unsupported systems may encounter untested issues.

  4. Install and fetch V8 source code on macOS

    v8
    To set up the V8 development environment on macOS, first install Git and the depot_tools package. Once installed, update the tools using gclient and then fetch the V8 source code including all branches and dependencies into a local directory.
    # Update depot_tools
    gclient
    
    # Fetch V8 source code
    mkdir ~/v8
    cd ~/v8
    fetch v8
    cd v8
  5. Build V8 from source for macOS arm64

    v8

    To build V8 on macOS arm64, ensure you are in the V8 source directory on the main branch. Update the source and dependencies before compiling.

    Available build targets include:

    • arm64.release: Standard release build.
    • arm64.release.check: Release build that runs tests immediately.
    • arm64.debug: Debug build.

    Note: Running tests with a debug build (arm64.debug.check) is strongly discouraged due to extremely slow performance.

    # 1. Navigate to source and checkout main
    cd ~/v8/v8
    git checkout main
    
    # 2. Update source and dependencies
    git pull && gclient sync
    
    # 3. Compile (choose one)
    # Release build
    tools/dev/gm.py arm64.release
    
    # Release build with tests
    tools/dev/gm.py arm64.release.check
    
    # Debug build
    tools/dev/gm.py arm64.debug
  6. Install build dependencies for V8 on macOS arm64

    v8
    To prepare the environment for building V8 on macOS (arm64), install Xcode and accept its license agreement. If Command Line Tools for Xcode were previously installed separately, they must be uninstalled first. Once in the V8 source directory, synchronize and download all required build dependencies using the gclient sync command.
    gclient sync
  7. Manage V8 source code branches

    v8
    After fetching the V8 source, the repository is in a detached HEAD state. You can either configure Git to automatically track new branches or create a new local branch using the git new-branch command (recommended).
    # Option 1: Configure automatic tracking/rebasing
    git config branch.autosetupmerge always
    git config branch.autosetuprebase always
    
    # Option 2: Create a new local branch (Recommended)
    git new-branch fix-bug-1234
  8. Configure a JavaScript execution target for V8 debugging

    v8
    To debug V8 executing JavaScript, create a test JavaScript file (e.g., debug.js) inside the build output directory (e.g., out/arm64.debug).
    touch out/arm64.debug/debug.js

    Example content for debug.js:

    let a = 1;
    var b = 2;
    const c = 3;
    console.log(a + b + c);
  9. Download and prepare SQL Server 2019 installation media

    Follow these steps to download the SQL Server 2019 installation ISO:

    1. Download the installer: SQL2019-SSEI-Dev.exe.
    2. Run SQL2019-SSEI-Dev.exe as an Administrator.
    3. In the installation type selection, choose Download Media (下载介质).
    4. Configure the following options:
      • Language: Chinese (Simplified) / 中文(简体)
      • Package Type: ISO
    5. Select a download location (ensure at least 20GB of free disk space) and click Download.
    6. Once complete, locate the downloaded image file: SQLServer2019-x64-CHS-Dev.iso.
  10. Start SQL Server 2019 Installation

    To begin the installation of SQL Server 2019, open the Installation Center, select the 'Installation' tab on the left, and click 'New SQL Server stand-alone installation or add features to an existing installation'.