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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

cypress_web_test cannot expand locations in env as documented #3239

Open
djmarcin opened this issue Jan 13, 2022 · 1 comment
Open

cypress_web_test cannot expand locations in env as documented #3239

djmarcin opened this issue Jan 13, 2022 · 1 comment
Assignees

Comments

@djmarcin
Copy link
Contributor

馃悶 bug report

Affected Rule

cypress_web_test

Is this a regression?

Not sure, but it does not match the documented behavior.

Description

Attempting to use any location expansion in cypress_web_test results in an error. This is because of this code, which creates a list with an embedded list that is eventually passed to ctx.expand_location which rejects this format.

馃敩 Minimal Reproduction

Any cypress_web_test rule with an env expansion like: env = { "FOO": "//:foo" }

馃敟 Exception or Error


Traceback (most recent call last):
        File "/home/david/.cache/bazel/_bazel_david/7d1037d21a52700832f2c490bcd1c89d/external/npm/@bazel/cypress/internal/cypress_web_test.bzl", line 113, column 48, in _cypress_web_test_impl
                return nodejs_test_kwargs["implementation"](
        File "/home/david/.cache/bazel/_bazel_david/7d1037d21a52700832f2c490bcd1c89d/external/build_bazel_rules_nodejs/internal/node/node.bzl", line 206, column 75, in _nodejs_binary_impl
                env_vars += "export %s=%s\n" % (key, expand_location_into_runfiles(ctx, value, data))
        File "/home/david/.cache/bazel/_bazel_david/7d1037d21a52700832f2c490bcd1c89d/external/build_bazel_rules_nodejs/internal/common/expand_into_runfiles.bzl", line 111, column 40, in expand_location_into_runfiles
                path += ctx.expand_location(input[i:j], targets)
Error in expand_location: at index 0 of targets, got element of type list, want Target

馃實 Your Environment

Operating System:

  
Ubuntu Linux 20.04
  

Output of bazel version:

  
Bazelisk version: v1.11.0
Build label: 6.0.0-pre.20211215.3
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Dec 21 19:45:47 2021 (1640115947)
Build timestamp: 1640115947
Build timestamp as int: 1640115947
  

Also reproduces on 
  
Bazelisk version: v1.11.0
Build label: 4.2.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 2 18:15:58 2021 (1638468958)
Build timestamp: 1638468958
Build timestamp as int: 1638468958
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
4.6.0
  

Anything else relevant?

@anagrius
Copy link

doing env: {"X": "$(execpath :my-file)"} crashes Bazel completely

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

No branches or pull requests

4 participants