Skip to content

Commit

Permalink
Move GN root into //core/libdeno (denoland#2943)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmoritz authored and piscisaureus committed Sep 15, 2019
1 parent 40a6d83 commit 9c282d6
Show file tree
Hide file tree
Showing 31 changed files with 81 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Tell git which symlinks point to files, and which ones point to directories.
# This is relevant for Windows only, and requires git >= 2.19.2 to work.
/* symlink=dir
/website/* symlink=dir
/tools/clang symlink=dir
/core/libdeno/* symlink=dir
/node_modules symlink=dir
/tools/memory symlink=dir
/website/* symlink=dir
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = third_party
url = https://github.com/denoland/deno_third_party.git
[submodule "build"]
path = build
path = core/libdeno/build
url = https://github.com/denoland/chromium_build.git
[submodule "js/deps/https/deno.land/x/std"]
path = js/deps/https/deno.land/std
Expand Down
6 changes: 0 additions & 6 deletions BUILD.gn

This file was deleted.

1 change: 0 additions & 1 deletion build_overrides

This file was deleted.

1 change: 0 additions & 1 deletion buildtools

This file was deleted.

7 changes: 2 additions & 5 deletions core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
fn main() {
let build = gn::Build::setup();

println!(
"cargo:rustc-link-search=native={}/obj/core/libdeno",
build.gn_out_dir
);
println!("cargo:rustc-link-search=native={}/obj", build.gn_out_dir);

build.run("core/libdeno:default");
build.run("default");
}

mod gn {
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions core/libdeno/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import("//third_party/v8/gni/v8.gni")
import("//v8/gni/v8.gni")

group("default") {
testonly = true
Expand All @@ -11,8 +11,8 @@ group("default") {
}

config("deno_config") {
include_dirs = [ "//third_party/v8" ] # This allows us to v8/src/base/ libraries.
configs = [ "//third_party/v8:external_config" ]
include_dirs = [ "//v8" ] # This allows us to v8/src/base/ libraries.
configs = [ "//v8:external_config" ]
cflags = []

if (is_debug) {
Expand All @@ -39,10 +39,10 @@ config("deno_config") {

v8_source_set("v8") {
deps = [
"//third_party/v8:v8",
"//third_party/v8:v8_libbase",
"//third_party/v8:v8_libplatform",
"//third_party/v8:v8_libsampler",
"//v8:v8",
"//v8:v8_libbase",
"//v8:v8_libplatform",
"//v8:v8_libsampler",
]
configs = [ ":deno_config" ]
}
Expand Down
6 changes: 3 additions & 3 deletions core/libdeno/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include <iostream>
#include <string>

#include "third_party/v8/include/libplatform/libplatform.h"
#include "third_party/v8/include/v8.h"
#include "third_party/v8/src/base/logging.h"
#include "v8/include/libplatform/libplatform.h"
#include "v8/include/v8.h"
#include "v8/src/base/logging.h"

#include "deno.h"
#include "exceptions.h"
Expand Down
4 changes: 2 additions & 2 deletions core/libdeno/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <windows.h>
#endif // _WIN32

#include "third_party/v8/include/v8.h"
#include "third_party/v8/src/base/logging.h"
#include "v8/include/v8.h"
#include "v8/src/base/logging.h"

#include "deno.h"
#include "exceptions.h"
Expand Down
4 changes: 2 additions & 2 deletions core/libdeno/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <unordered_map>
#include <utility>

#include "third_party/v8/include/v8.h"
#include "third_party/v8/src/base/logging.h"
#include "v8/include/v8.h"
#include "v8/src/base/logging.h"

namespace deno {

Expand Down
1 change: 1 addition & 0 deletions core/libdeno/build_overrides
1 change: 1 addition & 0 deletions core/libdeno/buildtools
2 changes: 1 addition & 1 deletion core/libdeno/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define EXCEPTIONS_H_

#include <string>
#include "third_party/v8/include/v8.h"
#include "v8/include/v8.h"

namespace deno {

Expand Down
4 changes: 2 additions & 2 deletions core/libdeno/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "buffer.h"
#include "deno.h"
#include "third_party/v8/include/v8.h"
#include "third_party/v8/src/base/logging.h"
#include "v8/include/v8.h"
#include "v8/src/base/logging.h"

namespace deno {

Expand Down
1 change: 1 addition & 0 deletions core/libdeno/testing
1 change: 1 addition & 0 deletions core/libdeno/third_party
1 change: 1 addition & 0 deletions core/libdeno/tools
1 change: 1 addition & 0 deletions core/libdeno/v8
24 changes: 12 additions & 12 deletions js/stat_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ testPerm({ read: true }, async function statSyncSuccess(): Promise<void> {
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());

const testingInfo = Deno.statSync("testing");
assert(testingInfo.isDirectory());
assert(!testingInfo.isSymlink());
const modulesInfo = Deno.statSync("node_modules");
assert(modulesInfo.isDirectory());
assert(!modulesInfo.isSymlink());

const testsInfo = Deno.statSync("tests");
assert(testsInfo.isDirectory());
Expand Down Expand Up @@ -50,9 +50,9 @@ testPerm({ read: true }, async function lstatSyncSuccess(): Promise<void> {
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());

const testingInfo = Deno.lstatSync("testing");
assert(!testingInfo.isDirectory());
assert(testingInfo.isSymlink());
const modulesInfo = Deno.lstatSync("node_modules");
assert(!modulesInfo.isDirectory());
assert(modulesInfo.isSymlink());

const testsInfo = Deno.lstatSync("tests");
assert(testsInfo.isDirectory());
Expand Down Expand Up @@ -92,9 +92,9 @@ testPerm({ read: true }, async function statSuccess(): Promise<void> {
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());

const testingInfo = await Deno.stat("testing");
assert(testingInfo.isDirectory());
assert(!testingInfo.isSymlink());
const modulesInfo = await Deno.stat("node_modules");
assert(modulesInfo.isDirectory());
assert(!modulesInfo.isSymlink());

const testsInfo = await Deno.stat("tests");
assert(testsInfo.isDirectory());
Expand Down Expand Up @@ -134,9 +134,9 @@ testPerm({ read: true }, async function lstatSuccess(): Promise<void> {
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());

const testingInfo = await Deno.lstat("testing");
assert(!testingInfo.isDirectory());
assert(testingInfo.isSymlink());
const modulesInfo = await Deno.lstat("node_modules");
assert(!modulesInfo.isDirectory());
assert(modulesInfo.isSymlink());

const testsInfo = await Deno.lstat("tests");
assert(testsInfo.isDirectory());
Expand Down
1 change: 0 additions & 1 deletion testing

This file was deleted.

2 changes: 1 addition & 1 deletion third_party
Submodule third_party updated 5 files
+0 −2 .gitattributes
+0 −1 googletest
+0 −1 jinja2
+0 −1 llvm-build
+0 −1 markupsafe
2 changes: 1 addition & 1 deletion tools/cargo_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
else:
assert (False)

lib_name = os.path.join(root_path, "target/release/obj/core/libdeno",
lib_name = os.path.join(root_path, "target", "release", "obj",
"libdeno" + static_lib_suffix)


Expand Down
1 change: 0 additions & 1 deletion tools/clang

This file was deleted.

8 changes: 4 additions & 4 deletions tools/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import sys
import argparse
from third_party import google_env, python_env
from third_party import get_buildtools_tool_path, google_env, python_env
from util import git_ls_files, third_party_path, root_path, run


Expand Down Expand Up @@ -44,8 +44,8 @@ def main():


def clang_format():
print "clang_format"
exe = os.path.join(third_party_path, "depot_tools", "clang-format")
print "clang-format"
exe = get_buildtools_tool_path("clang-format")
source_files = git_ls_files(root_path, ["*.cc", "*.h"])
run([exe, "-i", "-style", "Google", "--"] + source_files,
env=google_env(),
Expand All @@ -54,7 +54,7 @@ def clang_format():

def gn_format():
print "gn format"
exe = os.path.join(third_party_path, "depot_tools", "gn")
exe = get_buildtools_tool_path("gn")
source_files = git_ls_files(root_path, ["*.gn", "*.gni"])
run([exe, "format", "--"] + source_files, env=google_env(), quiet=True)

Expand Down
7 changes: 3 additions & 4 deletions tools/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import sys
from util import enable_ansi_colors, git_ls_files, root_path, run
from util import enable_ansi_colors, git_ls_files, libdeno_path, root_path, run
from util import third_party_path
from third_party import python_env

Expand All @@ -20,14 +20,13 @@ def main():
def cpplint():
print "cpplint"
script = os.path.join(third_party_path, "cpplint", "cpplint.py")
libdeno_dir = os.path.join(root_path, "core", "libdeno")
source_files = git_ls_files(libdeno_dir, ["*.cc", "*.h"])
source_files = git_ls_files(libdeno_path, ["*.cc", "*.h"])
run([
sys.executable,
script,
"--quiet",
"--filter=-build/include_subdir",
"--repository=" + libdeno_dir,
"--repository=" + libdeno_path,
"--",
] + source_files,
env=python_env(),
Expand Down
20 changes: 12 additions & 8 deletions tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from distutils.spawn import find_executable
import argparse
import third_party
from util import build_mode, build_path, enable_ansi_colors, run, shell_quote
from util import root_path, third_party_path
from util import build_mode, build_path, enable_ansi_colors, libdeno_path
from util import shell_quote, root_path, run, third_party_path

parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down Expand Up @@ -49,15 +49,17 @@ def write_if_not_exists(filename, contents):


def write_lastchange():
lastchange_file = os.path.join(libdeno_path, "build", "util", "LASTCHANGE")
committime_file = lastchange_file + ".committime"
write_if_not_exists(
"build/util/LASTCHANGE",
lastchange_file,
"LASTCHANGE=c42e4ddbb7973bfb0c57a49ab6bf6dc432baad7e-\n")
write_if_not_exists("build/util/LASTCHANGE.committime", "1535518087")
write_if_not_exists(committime_file, "1535518087")
# TODO Properly we should call the following script, but it seems to cause
# a rebuild on every commit.
# run([
# sys.executable, "build/util/lastchange.py", "-o",
# "build/util/LASTCHANGE", "--source-dir", root_path, "--filter="
# sys.executable, "build/util/lastchange.py", "-o", lastchange_file,
# "--source-dir", root_path, "--filter="
# ])


Expand Down Expand Up @@ -146,7 +148,7 @@ def gn_exe():
if "DENO_GN_PATH" in os.environ:
return os.environ["DENO_GN_PATH"]
else:
return os.path.join(third_party_path, "depot_tools", "gn")
return third_party.get_buildtools_tool_path("gn")


# gn gen.
Expand Down Expand Up @@ -175,7 +177,9 @@ def gn_gen(mode):
for line in gn_args:
print " " + line

run([gn_exe(), "gen", build_path()], env=third_party.google_env())
run([gn_exe(), "gen", build_path()],
cwd=libdeno_path,
env=third_party.google_env())


if __name__ == '__main__':
Expand Down
Loading

0 comments on commit 9c282d6

Please sign in to comment.