Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwd attribute on nodejs_binary, nodejs_test, npm_package_bin #2323

Closed
alexeagle opened this issue Dec 1, 2020 · 0 comments · Fixed by #2409
Closed

cwd attribute on nodejs_binary, nodejs_test, npm_package_bin #2323

alexeagle opened this issue Dec 1, 2020 · 0 comments · Fixed by #2409

Comments

@alexeagle
Copy link
Collaborator

Followup to #1840

That issue was resolved by documenting a workaround with --require
https://github.com/bazelbuild/rules_nodejs/blob/stable/internal/node/test/chdir/BUILD.bazel
but that's not really nice.

Ideally users could pass sth like cwd = "$(RULEDIR)" to run the tool in the output directory under the current package, though they still may need copy_to_bin so that the tool sees other InputArtifacts relative to the cwd.

Or they could pass cwd = native.package_name() to run in the input directory under the current package

In both cases we also need a big warning on the documentation that says that other paths you get from bazel, like arguments passed to your tool, or paramfiles with paths, are still going to be workspace-relative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant