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

Got: Error in string: string() got unexpected keyword argument 'allow_multiple' #13064

Closed
dzdeping opened this issue Feb 19, 2021 · 1 comment

Comments

@dzdeping
Copy link

dzdeping commented Feb 19, 2021

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Add below ctx in my.bzl file

ModuleProvider = provider(fields = ['type'])
modules = ["","","",""]
def _custom_impl(ctx):
    raw_modules = ctx.build_setting_vaule
    if raw_modules not in modules:
       fail(str(ctx.label) + "build setting allowed to take value {" + ",".join(modules) + "} but was set to unallowed value " + raw_modules)
    return ModuleProvider(Type = raw_modules)

module_flag = rule(
    implementation = _custom_impl,
    build_setting = config.string(flag = True, allow_multiple = True)
)

What operating system are you running Bazel on?

Ubuntu 18.04.2 LTS \n \l

What's the output of bazel info release?

release 4.0.0

Any other information, logs, or outputs that you want to share?

when i run : bazel coverage //...

i got:

ERROR: Traceback (most recent call last): File "/opt/code/bepcloudbazel/bepcloud/bepcloud-parent/bzl/pkg_war.bzl", line 167, column 34, in <toplevel> build_setting = config.string(flag = True, allow_multiple = True) Error in string: string() got unexpected keyword argument 'allow_multiple'

@brandjon
Copy link
Member

Bazel 4.0.0's baseline was cut on Nov 18. The allow_multiple parameter to config.string() was added on Dec 10. You can use a version of Bazel closer to head if you want to experiment with this feature.

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

3 participants