Skip to content

Instantly share code, notes, and snippets.

@DeeDeeG
Created April 28, 2021 16:59
Show Gist options
  • Save DeeDeeG/da06373b2b62ee644c742998ecd8945a to your computer and use it in GitHub Desktop.
Save DeeDeeG/da06373b2b62ee644c742998ecd8945a to your computer and use it in GitHub Desktop.
How to get set up to contribute to Chromium's V8 JavaScript engine
# Exit the script if any individual command or command group errors out
set -e
cd ~/
if ! [ -e ~/depot_tools ]; then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo
fi
echo "Adding '~/depot_tools' to PATH..."
export PATH=~/depot_tools:"${PATH}"
echo
if ! [ -e ~/depot_tools/metrics.cfg ]; then
echo "Running 'gclient' to finish setting up depot_tools..."
gclient
echo
fi
while ! [ -e ~/.gitcookies ]; do
echo
echo "For push access to V8, you need to setup a .gitcookies file"
echo "with your authentication to Google's code repo and review infrastructure:"
echo
echo "1. Go to https://chromium.googlesource.com/new-password and log in with your"
echo " committer account (usually an @chromium.org account)."
echo " Note: creating a new password/cookie doesn’t automatically revoke"
echo " any previously-created passwords/cookies. Please make sure you use"
echo " the same email as the one set for git config user.email."
echo
echo "2. Have a look at the big, grey box containing shell commands."
echo " Paste those lines into your shell."
echo
read -p "Please follow the instructions above (in another terminal) then press [Enter]/[Return] to continue. Or to cancel, press [Ctrl] + [C]"
echo
done
if ! [ -e ~/v8/v8 ]; then
echo "Fetching V8 and its dependencies..."
mkdir ~/v8
cd ~/v8
fetch v8
echo
fi
echo "Done!"
echo
echo "Remember to add ~/depot_tools to your PATH before building or testing V8."
echo
echo "Review the following links for more information:"
echo
echo " How to get V8's source, and procedure for uploading patches:"
echo " https://v8.dev/docs/source-code"
echo
echo " How to contribute to V8, procedure for testing/uploading patches (again),"
echo " how to get a review for your submission, and where to get help"
echo " with contributing to V8:"
echo " https://v8.dev/docs/contribute"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment