Skip to content

Commit

Permalink
build(bazel): turn on preserve-symlinks (#24881)
Browse files Browse the repository at this point in the history
This change turns on preserve-symlinks in nodejs to verify hermeticity of the Angular build.

BREAKING CHANGE: Use of @angular/bazel rules now requires calling ng_setup_workspace() in your WORKSPACE file.

For example:

local_repository(
    name = "angular",
    path = "node_modules/@angular/bazel",
)

load("@angular//:index.bzl", "ng_setup_workspace")

ng_setup_workspace()

PR Close #24881
  • Loading branch information
gregmagolan authored and vicb committed Jul 20, 2018
1 parent 70b51a6 commit c438b5e
Show file tree
Hide file tree
Showing 14 changed files with 389 additions and 81 deletions.
180 changes: 180 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,197 @@ alias(
node_modules_filegroup(
name = "node_modules",
packages = [
"adm-zip",
"ajv",
"angular",
"angular-1.5",
"angular-mocks",
"angular-mocks-1.5",
"anymatch",
"arr-diff",
"arr-flatten",
"arr-union",
"array-unique",
"asn1",
"assert-plus",
"assign-symbols",
"async-each",
"asynckit",
"atob",
"aws-sign2",
"aws4",
"balanced-match",
"base",
"base64-js",
"binary-extensions",
"blocking-proxy",
"brace-expansion",
"braces",
"bytebuffer",
"cache-base",
"caseless",
"chokidar",
"class-utils",
"co",
"collection-visit",
"combined-stream",
"component-emitter",
"concat-map",
"copy-descriptor",
"core-util-is",
"debug",
"decode-uri-component",
"define-property",
"delayed-stream",
"domino",
"expand-brackets",
"expand-range",
"extend",
"extend-shallow",
"extglob",
"extsprintf",
"fast-deep-equal",
"fast-json-stable-stringify",
"filename-regex",
"fill-range",
"for-in",
"for-own",
"forever-agent",
"form-data",
"fragment-cache",
"fs.realpath",
"get-value",
"glob",
"glob-base",
"glob-parent",
"graceful-fs",
"hammerjs",
"har-schema",
"har-validator",
"has-value",
"has-values",
"http-signature",
"https-proxy-agent",
"inflight",
"inherits",
"is-accessor-descriptor",
"is-binary-path",
"is-buffer",
"is-data-descriptor",
"is-descriptor",
"is-dotfile",
"is-equal-shallow",
"is-extendable",
"is-extglob",
"is-glob",
"is-number",
"is-plain-object",
"is-posix-bracket",
"is-primitive",
"is-typedarray",
"is-windows",
"isarray",
"isobject",
"isstream",
"jasmine",
"jasmine-core",
"jasminewd2",
"json-schema",
"json-schema-traverse",
"json-stable-stringify",
"json-stringify-safe",
"jsprim",
"kind-of",
"long",
"lru-cache",
"map-cache",
"map-visit",
"math-random",
"micromatch",
"mime-db",
"mime-types",
"minimatch",
"minimist",
"mixin-deep",
"nanomatch",
"normalize-path",
"oauth-sign",
"object.omit",
"object.pick",
"object-copy",
"object-visit",
"once",
"optimist",
"options",
"os-tmpdir",
"parse-glob",
"pascalcase",
"path-dirname",
"path-is-absolute",
"performance-now",
"posix-character-classes",
"preserve",
"process-nextick-args",
"protobufjs",
"protractor",
"qs",
"randomatic",
"readable-stream",
"readdirp",
"reflect-metadata",
"regex-cache",
"regex-not",
"remove-trailing-separator",
"repeat-element",
"repeat-string",
"request",
"ret",
"rimraf",
"safe-buffer",
"safe-regex",
"sax",
"semver",
"set-immediate-shim",
"set-value",
"shelljs",
"sigmund",
"snapdragon",
"snapdragon-node",
"snapdragon-util",
"source-map",
"source-map-resolve",
"source-map-support",
"source-map-url",
"split-string",
"sshpk",
"static-extend",
"stringstream",
"tmp",
"to-object-path",
"to-regex",
"to-regex-range",
"tough-cookie",
"tsickle",
"tslib",
"tsutils",
"tunnel-agent",
"typescript",
"union-value",
"unset-value",
"upath",
"uri-js",
"urix",
"use",
"util-deprecate",
"uuid",
"verror",
"webdriver-js-extender",
"webdriver-manager",
"wordwrap",
"wrappy",
"xhr2",
"xml2js",
"xmlbuilder",
"zone.js",
"@angular-devkit/core",
"@angular-devkit/schematics",
Expand All @@ -37,6 +216,7 @@ node_modules_filegroup(
],
patterns = [
"node_modules/protractor/**",
"node_modules/@schematics/angular/**",
],
)

Expand Down
9 changes: 8 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ http_archive(
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")

check_bazel_version("0.15.0")
node_repositories(package_json = ["//:package.json"])
node_repositories(
package_json = ["//:package.json"],
preserve_symlinks = True,
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")

Expand All @@ -97,6 +100,10 @@ load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")

ts_setup_workspace()

load("//packages/bazel/src:ng_setup_workspace.bzl", "ng_setup_workspace")

ng_setup_workspace()

#
# Point Bazel to WORKSPACEs that live in subdirectories
#
Expand Down
8 changes: 8 additions & 0 deletions integration/bazel/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,11 @@ local_repository(
name = "rxjs",
path = "node_modules/rxjs/src",
)

#
# Load and install our dependencies from local repositories
#

load("@angular//:index.bzl", "ng_setup_workspace")

ng_setup_workspace()
Loading

0 comments on commit c438b5e

Please sign in to comment.