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

Add tools/build_third_party.py #328

Merged
merged 8 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ install:
- curl -sSf https://sh.rustup.rs | sh -s -- -y
- export PATH=$HOME/.cargo/bin:$PATH
- rustc --version
- (cd js; yarn)
- (cd third_party; gclient sync -j2 --no-history)
- ./tools/build_third_party.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
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@ You need [rust](https://www.rust-lang.org/en-US/install.html) installed.

You need [ccache](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/ccache) installed.

Fetch packages and v8:
```bash
(cd third_party; gclient sync --no-history)
```
Fetch the third party dependencies.

Install the javascript deps.
./tools/build_third_party.py

(cd js; yarn install)
Generate ninja files.

gn gen out/Debug --args='cc_wrapper="ccache" is_debug=true '

Expand Down
1 change: 1 addition & 0 deletions js/node_modules
1 change: 1 addition & 0 deletions third_party/package.json
File renamed without changes.
35 changes: 35 additions & 0 deletions tools/build_third_party.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python
# This script updates 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.

import os
import subprocess
import argparse

root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
third_party_path = os.path.join(root_path, "third_party")
script_name = "build_third_party.py"
Copy link
Member

@ry ry Jul 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think sync_third_party.py is a better name. What do you think?

build_third_party.py is better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. This script doesn't build things, but basically updates the deps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kt3k actually I changed my mind- it is only syncing now, but it will be doing more "build" type things later - like creating symlinks (see comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

it will be doing more "build" type things later - like creating symlinks

That's why you called this build_* first.


parser = argparse.ArgumentParser(description="""
This script updates the third party dependencies of deno.
""")
parser.parse_args()

def main():
os.chdir(third_party_path)
run(["gclient", "sync", "--no-history"])
run(["yarn"])
print "Done (" + script_name + ")"

def run(args):
print " ".join(args)
env = os.environ.copy()
subprocess.check_call(args, env=env)

if '__main__' == __name__:
main()