build: don't use deprecated $(location) pre-declared variable (#36308)

$(location) is not recommended in the bazel docs as depending on context it will either return the value of $(execpath) or $(rootpath). rules_nodejs now supports $(rootpath) and $(execpath) in templated_args of nodejs_binary.

PR Close #36308
This commit is contained in:
Greg Magolan
2020-03-29 13:29:50 -07:00
committed by Alex Rickabaugh
parent 61e5ab4703
commit c58e6ba13a
8 changed files with 16 additions and 14 deletions

View File

@ -181,7 +181,7 @@ def npm_integration_test(name, **kwargs):
name = name,
data = data + npm_deps + [":%s.config" % name, ":%s.config.js" % name],
tags = tags,
templated_args = ["$(location :%s.config.js)" % name],
templated_args = ["$(rootpath :%s.config.js)" % name],
entry_point = "//tools/npm_integration_test:test_runner.js",
**kwargs
)
@ -192,7 +192,7 @@ def npm_integration_test(name, **kwargs):
name = name + ".debug",
data = data + npm_deps + [":%s.debug.config" % name, ":%s.debug.config.js" % name],
tags = tags + ["manual", "local"],
templated_args = ["$(location :%s.debug.config.js)" % name],
templated_args = ["$(rootpath :%s.debug.config.js)" % name],
entry_point = "//tools/npm_integration_test:test_runner.js",
**kwargs
)

View File

@ -340,7 +340,7 @@ class TestRunner {
}
}
const config = require(process.argv[2]);
const config = require(runfiles.resolveWorkspaceRelative(process.argv[2]));
// set env vars passed from --define
for (const k of Object.keys(config.envVars)) {