def fix_symlinks(): # Ensure the third_party directory exists. try: os.makedirs(third_party_path) except: pass # Make symlinks to Yarn metadata living in the root repo. remove_and_symlink("../package.json", tp("package.json")) # TODO(ry) Is it possible to remove these symlinks? remove_and_symlink("v8/third_party/googletest", tp("googletest"), True) remove_and_symlink("v8/third_party/jinja2", tp("jinja2"), True) remove_and_symlink("v8/third_party/llvm-build", tp("llvm-build"), True) remove_and_symlink("v8/third_party/markupsafe", tp("markupsafe"), True) # On Windows, git doesn't create the right type of symlink if the symlink # and it's target are in different repos. Here we fix the symlinks that exist # in the root repo while their target is in the third_party repo. remove_and_symlink("third_party/node_modules", root("node_modules"), True) remove_and_symlink("third_party/v8/build", root("build"), True) remove_and_symlink("third_party/v8/buildtools", root("buildtools"), True) remove_and_symlink("third_party/v8/build_overrides", root("build_overrides"), True) remove_and_symlink("third_party/v8/testing", root("testing"), True) remove_and_symlink("../third_party/v8/tools/clang", root("tools/clang"), True)
#!/usr/bin/env python # Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. """ gn can only run python scripts. This launches a subprocess Node process. The working dir of this program is out/Debug/ (AKA root_build_dir) Before running node, we symlink js/node_modules to out/Debug/node_modules. """ import subprocess import sys import os import util root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) tools_path = os.path.join(root_path, "tools") third_party_path = os.path.join(root_path, "third_party") target_abs = os.path.join(third_party_path, "node_modules") target_rel = os.path.relpath(target_abs) util.remove_and_symlink(target_rel, "node_modules", True) util.run(["node"] + sys.argv[1:], quiet=True)
import os from os.path import join from util import run, remove_and_symlink root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) third_party_path = join(root_path, "third_party") try: os.makedirs(third_party_path) except: pass os.chdir(third_party_path) # Run yarn to install JavaScript dependencies. remove_and_symlink("../package.json", "package.json") remove_and_symlink("../yarn.lock", "yarn.lock") run(["yarn"]) # 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", True) remove_and_symlink("v8/third_party/jinja2", "jinja2", True) remove_and_symlink("v8/third_party/llvm-build", "llvm-build", True) remove_and_symlink("v8/third_party/markupsafe", "markupsafe", True) # To update the deno_third_party git repo after running this, try the following:
def fix_symlinks(): # Ensure the third_party directory exists. try: os.makedirs(third_party_path) except OSError: pass # Make symlinks to Yarn metadata living in the root repo. remove_and_symlink("../package.json", tp("package.json")) # TODO(ry) Is it possible to remove these symlinks? remove_and_symlink("v8/third_party/googletest", tp("googletest"), True) remove_and_symlink("v8/third_party/jinja2", tp("jinja2"), True) remove_and_symlink("v8/third_party/llvm-build", tp("llvm-build"), True) remove_and_symlink("v8/third_party/markupsafe", tp("markupsafe"), True) remove_and_symlink("../../build", tp("v8/build"), True) # On Windows, git doesn't create the right type of symlink if the symlink # and it's target are in different repos. Here we fix the symlinks that # exist in the root repo while their target is in the third_party repo. remove_and_symlink("third_party/node_modules", root("node_modules"), True) remove_and_symlink("third_party/v8/buildtools", root("buildtools"), True) remove_and_symlink("third_party/v8/build_overrides", root("build_overrides"), True) remove_and_symlink("third_party/v8/testing", root("testing"), True) remove_and_symlink("../third_party/v8/tools/clang", root("tools/clang"), True)
# 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. 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__))) third_party_path = join(root_path, "third_party") try: os.makedirs(third_party_path) 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", "--no-history"]) run(["yarn"])
#!/usr/bin/env python """ gn can only run python scripts. This launches a subprocess Node process. The working dir of this program is out/Debug/ (AKA root_build_dir) Before running node, we symlink js/node_modules to out/Debug/node_modules. """ import subprocess import sys import os import util root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) tools_path = os.path.join(root_path, "tools") third_party_path = os.path.join(root_path, "third_party") target_abs = os.path.join(third_party_path, "node_modules") target_rel = os.path.relpath(target_abs) util.remove_and_symlink(target_rel, "node_modules", True) util.run(["node"] + sys.argv[1:])