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

Reset on a list type attribute with more than one value in the list is broken #64

Closed
SimonaAlina opened this issue Feb 15, 2024 · 1 comment · Fixed by #66
Closed

Reset on a list type attribute with more than one value in the list is broken #64

SimonaAlina opened this issue Feb 15, 2024 · 1 comment · Fixed by #66

Comments

@SimonaAlina
Copy link

ERROR: Traceback (most recent call last):
	File "/Users/simona/github/bazel-demos/lib2/BUILD", line 9, column 15, in <toplevel>
		opt_ts_project(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 17, column 46, in lambda
		return lambda *, name, **kwargs: _wrapper(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 129, column 48, in _wrapper
		processed_kwargs = _process_attrs_for_reset(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 211, column 42, in _process_attrs_for_reset
		first_pass_attrs[attr] = map_attr(attr_func, attrs[attr])
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/select.bzl", line 7, column 20, in map_attr
		return func(attribute)
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 204, column 50, in lambda
		attr_func = lambda dep: _replace_dep_attr(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 226, column 32, in _replace_dep_attr
		_replace_single_dep(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 276, column 21, in _replace_single_dep
		reset_target(
	File "/private/var/tmp/_bazel_simona/3099fbc7895a08f739515284f34cf219/external/with_cfg.bzl~0.2.1/with_cfg/private/wrapper.bzl", line 132, column 68, in lambda
		reset_target = lambda *, name, exports: transitioning_alias(
Error in opt_ts_project_reset: opt_ts_project_reset rule 'ts__deps_0' in package 'lib2' conflicts with existing opt_ts_project_reset rule, defined at /Users/simona/github/bazel-demos/lib2/BUILD:9:15
ERROR: Skipping '//lib2:ts': no such target '//lib2:ts': target 'ts' not declared in package 'lib2' defined by /Users/simona/github/bazel-demos/lib2/BUILD (Tip: use `query "//lib2:*"` to see all the targets in that package)
WARNING: Target pattern parsing failed.
ERROR: no such target '//lib2:ts': target 'ts' not declared in package 'lib2' defined by /Users/simona/github/bazel-demos/lib2/BUILD (Tip: use `query "//lib2:*"` to see all the targets in that package)

I want to use with_cfg with reset feature on ts_project target resetting deps attribute, but if the deps attribute contains more than one value I received the above error. This issue can be reproduced using this project: https://github.com/SimonaAlina/bazel-demos (more details in the readme file).

Thank you!

@fmeum
Copy link
Owner

fmeum commented Feb 15, 2024

Confirmed that this is fixed by #66.

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.

2 participants