Commit 110e00e
committed
fix: allow "src" and "bin" module mappings to win over "runfiles"
This fixes an issue in the Angular repo where the duplicate `runfiles` mappings:
```
["runfiles", "angular/packages/compiler"] and ["bin", "angular/packages/compiler"]
```
sneaks through this nodejs_binaries:
```
nodejs_binary(
name = "ngc_bin",
data = [
"//packages/compiler-cli",
"@npm//chokidar",
"@npm//reflect-metadata",
],
entry_point = "//packages/compiler-cli:src/main.ts",
)
nodejs_binary(
name = "ng_xi18n",
data = [
"//packages/compiler-cli",
"@npm//chokidar",
"@npm//reflect-metadata",
],
entry_point = "//packages/compiler-cli:src/extract_i18n.ts",
)
```
which depends on `//packages/compiler-cli` which depends on `//packages/compiler`. So when building the ng_test target:
```
nodejs_test(
name = "integrationtest",
data = [
":ngc_bin",
":ng_xi18n",
"@nodejs//:node",
"@npm//domino",
"@npm//chokidar",
"@npm//source-map-support",
"@npm//shelljs",
"@npm//typescript",
"@npm//reflect-metadata",
"@npm//rxjs",
"@npm//tslib",
"@npm//jasmine/bin:jasmine",
"@npm//xhr2",
"@npm//@types/node",
"@npm//@types/jasmine",
# we need to reference zone.d.ts typing file from zone.js build target
# instead of npm because angular repo will not depends on npm zone.js
# any longer.
"//packages/zone.js/lib:zone_d_ts",
# we need to reference zone.js npm_package build target
# instead of npm because angular repo will not depends on npm zone.js
# any longer, so we need to build a zone.js npm release first.
"//packages/zone.js:npm_package",
"//packages/animations:npm_package",
"//packages/common:npm_package",
"//packages/compiler:npm_package",
"//packages/compiler-cli:npm_package",
"//packages/core:npm_package",
"//packages/forms:npm_package",
"//packages/http:npm_package",
"//packages/platform-browser:npm_package",
"//packages/platform-browser-dynamic:npm_package",
"//packages/platform-server:npm_package",
"//packages/router:npm_package",
] + glob(["**/*"]),
entry_point = "test.js",
tags = ["no-ivy-aot"],
)
```
it has both mappings causing the linker to error out with conflicting module mappings `["runfiles", "angular/packages/compiler"] and ["bin", "angular/packages/compiler"]`.
Fix is to just allow this and allow both "src" and "bin" to win a conflicting over "runfiles" mapping.1 parent 765914e commit 110e00e
1 file changed
Lines changed: 24 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
| |||
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| |||
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
118 | | - | |
119 | | - | |
| 126 | + | |
| 127 | + | |
120 | 128 | | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
| |||
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | | - | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| |||
0 commit comments