Skip to content

Commit 494eafc

Browse files
authored
Merge pull request #13 from pubref/dont_symlink_root
Fixes workspace name conflict warning.
2 parents e0d15c4 + 9ddffe4 commit 494eafc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

examples/foo/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ node_binary(
1414
mocha_test(
1515
name = "foo_test",
1616
main = "foo_test.js",
17+
size = "small",
1718
modules = ["@npm_underscore//:modules"],
1819
deps = [
1920
"//examples/baz",

node/internal/node_repositories.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ filegroup(
1414
)
1515
"""
1616

17+
def _mirror_path(ctx, workspace_root, path):
18+
src = '/'.join([workspace_root, path])
19+
dst = '/'.join([ctx.path('.'), path])
20+
ctx.symlink(src, dst)
21+
22+
1723
def _node_toolchain_impl(ctx):
1824
os = ctx.os.name
1925
if os == 'linux':
@@ -23,7 +29,10 @@ def _node_toolchain_impl(ctx):
2329
else:
2430
fail("Unsupported operating system: " + os)
2531

26-
ctx.symlink(noderoot, ctx.path(''))
32+
_mirror_path(ctx, noderoot, "bin")
33+
_mirror_path(ctx, noderoot, "include")
34+
_mirror_path(ctx, noderoot, "lib")
35+
_mirror_path(ctx, noderoot, "share")
2736

2837
ctx.file("WORKSPACE", "workspace(name = '%s')" % ctx.name)
2938
ctx.file("BUILD", NODE_TOOLCHAIN_BUILD_FILE)

0 commit comments

Comments
 (0)