From 18f7bb7c0cd8ffeea198a46b581f3dd4dcc7d1ba Mon Sep 17 00:00:00 2001 From: Tzikas Date: Mon, 5 Aug 2019 18:00:45 -0400 Subject: [PATCH] Remove Deno.build.args feature (#2728) This is a minor feature which complicates the build signifigantly. Removing to ease refactoring the build system: https://github.com/denoland/deno/issues/2608 --- cli/BUILD.gn | 8 -------- js/build.ts | 6 +----- js/build_test.ts | 4 ---- rollup.config.js | 4 +--- tools/write_gn_args.py | 18 ------------------ 5 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 tools/write_gn_args.py diff --git a/cli/BUILD.gn b/cli/BUILD.gn index 9a3cad2..0a6c987 100644 --- a/cli/BUILD.gn +++ b/cli/BUILD.gn @@ -247,10 +247,6 @@ bundle("main_bundle") { deps = [ ":deno_runtime_declaration", ":msg_ts", - ":write_gn_args", - ] - data = [ - "$target_gen_dir/gn_args.txt", ] } @@ -260,10 +256,6 @@ bundle("compiler_bundle") { deps = [ ":deno_runtime_declaration", ":msg_ts", - ":write_gn_args", - ] - data = [ - "$target_gen_dir/gn_args.txt", ] } diff --git a/js/build.ts b/js/build.ts index 6866e42..1b02e78 100644 --- a/js/build.ts +++ b/js/build.ts @@ -12,9 +12,6 @@ export interface BuildInfo { /** The operating system. */ os: OperatingSystem; - - /** The arguments passed to GN during build. See `gn help buildargs`. */ - args: string; } // 'build' is injected by rollup.config.js at compile time. @@ -23,8 +20,7 @@ export const build: BuildInfo = { /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ arch: `ROLLUP_REPLACE_ARCH` as any, /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - os: `ROLLUP_REPLACE_OS` as any, - args: `ROLLUP_REPLACE_GN_ARGS` + os: `ROLLUP_REPLACE_OS` as any }; // TODO(kevinkassimo): deprecate Deno.platform diff --git a/js/build_test.ts b/js/build_test.ts index 4a254e7..4423de3 100644 --- a/js/build_test.ts +++ b/js/build_test.ts @@ -8,7 +8,3 @@ test(function buildInfo(): void { assert(arch === "x64"); assert(os === "mac" || os === "win" || os === "linux"); }); - -test(function buildGnArgs(): void { - assert(Deno.build.args.length > 100); -}); diff --git a/rollup.config.js b/rollup.config.js index 41f738b..95f06f2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -18,7 +18,6 @@ const typescriptPath = path.resolve( __dirname, "third_party/node_modules/typescript/lib/typescript.js" ); -const gnArgs = fs.readFileSync("gen/cli/gn_args.txt", "utf-8").trim(); // We will allow generated modules to be resolvable by TypeScript based on // the current build path @@ -190,8 +189,7 @@ export default function makeConfig(commandOptions) { replace({ ROLLUP_REPLACE_TS_VERSION: typescript.version, ROLLUP_REPLACE_ARCH: archNodeToDeno[process.arch], - ROLLUP_REPLACE_OS: osNodeToDeno[process.platform], - ROLLUP_REPLACE_GN_ARGS: gnArgs + ROLLUP_REPLACE_OS: osNodeToDeno[process.platform] }), // would prefer to use `rollup-plugin-virtual` to inject the empty module, but there diff --git a/tools/write_gn_args.py b/tools/write_gn_args.py deleted file mode 100644 index 145de4f..0000000 --- a/tools/write_gn_args.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import os -import sys -import third_party -from util import run_output, build_path - -out_filename = sys.argv[1] - -args_list = run_output([ - third_party.gn_path, "args", - build_path(), "--list", "--short", "--overrides-only" -], - quiet=True, - env=third_party.google_env(), - exit_on_fail=True).out - -with open(out_filename, "w") as f: - f.write(args_list)