1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Add deno_third_party as git submodule.

This commit is contained in:
Ryan Dahl 2018-07-13 03:24:07 -04:00
parent 3563638693
commit 5d1cb54261
8 changed files with 85 additions and 47 deletions

5
.gitignore vendored
View file

@ -1,12 +1,9 @@
# build
/out/
*.pyc
gclient_config.py_entries
# npm deps
node_modules
# third party deps
/third_party/
# RLS generated files
/target/

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "third_party"]
path = third_party
url = https://github.com/ry/deno_third_party.git

View file

@ -5,7 +5,6 @@ branches:
cache:
ccache: true
directories:
- third_party/node_modules/
- $DEPOT_TOOLS_PATH
- $BUILD_PATH
env:
@ -28,7 +27,10 @@ install:
- curl -sSf https://sh.rustup.rs | sh -s -- -y
- export PATH=$HOME/.cargo/bin:$PATH
- rustc --version
- ./tools/build_third_party.py
# TODO(ry) Do not depend on run_hooks because it calls
# //third_party/depot_tools/download_from_google_storage.py
# Use git lfs and combine run_hooks with build_third_party?
- ./tools/run_hooks.py
# ccache needs the custom LLVM to be in PATH and other variables.
- export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH
- export CCACHE_CPP2=yes

View file

@ -56,41 +56,40 @@ Roadmap is [here](https://github.com/ry/deno/blob/master/Roadmap.md).
Also see this presentation: http://tinyclouds.org/jsconf2018.pdf
### Github Noise
I am excited about all the interest in this project. However, do understand that this
is very much a non-functional prototype. There's a huge amount of heavy lifting to do.
Unless you are participating in that, please maintain radio silence on github. This
includes submitting trivial PRs (like improving README build instructions).
## Compile instructions
## Build instructions
Get [Depot Tools](http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up) and make sure it's in your path.
To ensure reproducable builds, Deno has most of its dependencies in a git
submodule. However, you need
[rustc](https://www.rust-lang.org/en-US/install.html) installed separately.
You need [yarn](https://yarnpkg.com/lang/en/docs/install/) installed.
You probably want
[ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache)
installed too.
You need [rust](https://www.rust-lang.org/en-US/install.html) installed.
To build:
You might want [ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache) installed.
# Fetch deps.
git clone --recurse-submodules https://github.com/ry/deno.git
cd deno
./tools/run_hooks.py
Fetch the third party dependencies.
# Configure
./third_party/depot_tools/gn gen out/default
./third_party/depot_tools/gn gen out/release --args='cc_wrapper="ccache" is_official_build=true'
./third_party/depot_tools/gn gen out/debug --args='cc_wrapper="ccache" is_debug=true '
./tools/build_third_party.py
Generate ninja files.
gn gen out/Default
gn gen out/Release --args='cc_wrapper="ccache" is_official_build=true'
gn gen out/Debug --args='cc_wrapper="ccache" is_debug=true '
Then build with ninja (will take a while to complete):
ninja -C out/Debug/ deno
# Build
./third_party/depot_tools/ninja -C out/default/ deno
Other useful commands:
gn args out/Debug/ --list
gn args out/Debug/
gn desc out/Debug/ :deno
gn help
./third_party/depot_tools/gn args out/default/ --list
./third_party/depot_tools/gn args out/default/
./third_party/depot_tools/gn desc out/default/ :deno
./third_party/depot_tools/gn help

View file

@ -17,6 +17,11 @@ solutions = [{
'v8/test/test262/harness': None,
'v8/tools/luci-go': None
}
}, {
'url':
'https://chromium.googlesource.com/chromium/tools/depot_tools@40bacee96a94600ad2179d69a8025469d119960f',
'name':
'depot_tools'
}, {
'url':
'https://chromium.googlesource.com/chromium/src/third_party/zlib@39b4a6260702da4c089eca57136abf40a39667e9',

1
third_party Submodule

@ -0,0 +1 @@
Subproject commit 2dde8457b037a399f07106ccfc34382a80c469bb

View file

@ -1,15 +1,8 @@
#!/usr/bin/env python
# This script generates the third party dependencies of deno.
# - Get Depot Tools and make sure it's in your path.
# http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
# - You need yarn installed as well.
# https://yarnpkg.com/lang/en/docs/install/
# Use //gclient_config.py to modify the git deps.
# Use //js/package.json to modify the npm deps.
# Only run this script if you are changing Deno's dependencies.
import os
from os.path import join
import subprocess
from util import run, remove_and_symlink
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
@ -20,14 +13,23 @@ try:
except:
pass
os.chdir(third_party_path)
remove_and_symlink(join("..", "gclient_config.py"), ".gclient")
remove_and_symlink(join("..", "package.json"), "package.json")
remove_and_symlink(join("..", "yarn.lock"), "yarn.lock")
remove_and_symlink(join("v8", "third_party", "googletest"), "googletest")
remove_and_symlink(join("v8", "third_party", "jinja2"), "jinja2")
remove_and_symlink(join("v8", "third_party", "llvm-build"), "llvm-build")
remove_and_symlink(join("v8", "third_party", "markupsafe"), "markupsafe")
run(["gclient", "sync", "--shallow", "--no-history"])
# Run yarn to install JavaScript dependencies.
remove_and_symlink("../package.json", "package.json")
remove_and_symlink("../yarn.lock", "yarn.lock")
run(["yarn"])
run(["cargo", "fetch", "--manifest-path=../Cargo.toml"],
# Run cargo to install Rust dependencies.
run(["cargo", "fetch", "--manifest-path=" + root_path + "/Cargo.toml"],
envs={'CARGO_HOME': third_party_path + '/rust_crates'})
# Run gclient to install other dependencies.
run(["gclient", "sync", "--reset", "--shallow", "--no-history", "--nohooks"],
envs={'GCLIENT_FILE': root_path + "/gclient_config.py"})
# TODO(ry) Is it possible to remove these symlinks?
remove_and_symlink("v8/third_party/googletest", "googletest")
remove_and_symlink("v8/third_party/jinja2", "jinja2")
remove_and_symlink("v8/third_party/llvm-build", "llvm-build")
remove_and_symlink("v8/third_party/markupsafe", "markupsafe")
# To update the deno_third_party git repo after running this, try the following:
# cd third_party
# find . -type f | grep -v "\.git" | xargs -I% git add -f --no-warn-embedded-repo "%"

29
tools/run_hooks.py Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env python
import os
import sys
from util import run
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
third_party_path = os.path.join(root_path, "third_party")
depot_tools_path = os.path.join(third_party_path, "depot_tools")
os.chdir(root_path)
def download(fn):
run([
os.path.join(depot_tools_path + '/download_from_google_storage.py'),
'--no_resume', '--platform=' + sys.platform, '--no_auth', '--bucket',
'chromium-gn', '-s',
os.path.join(root_path, fn)
],
quiet=True)
if sys.platform == 'win32':
download("third_party/v8/buildtools/win/gn.exe.sha1")
elif sys.platform == 'darwin':
download("third_party/v8/buildtools/mac/gn.sha1")
elif sys.platform.startswith('linux'):
download("third_party/v8/buildtools/linux64/gn.sha1")
run(['python', 'third_party/v8/tools/clang/scripts/update.py', '--if-needed'],
quiet=True)