-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
incompatible_string_join_requires_strings: string.join(list) accepts invalid (non-string) list elements #7802
Comments
#7802 RELNOTES: A new flag `--incompatible_string_join_requires_strings` is introduced. The sequence argument of `string.join` must contain only string elements. PiperOrigin-RevId: 240775005
@laurentlb, is the migration window 1 release? I added the breaking-change-0.26 label if it is, but if it's not, that needs to be updated |
The default will change in Starlark interpreter. This line allows Copybara to do the migration separately. See bazelbuild/bazel#7802 for details PiperOrigin-RevId: 249818361 Change-Id: I45b316121083ee5c5895230858c584cb4b2b74f6
Bazel 0.27 is going to flip incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Bug: Issue 10930 Change-Id: I058ba29a006e0af665830f3408e82cef4cbb1660
Bazel 0.27 is going to flip incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Bug: Issue 10998 Change-Id: Ibd6c77af8ed1ce5dc86ce88996003f7cf695aa08
Fixes bazelbuild#7802 RELNOTES: --incompatible_string_join_requires_strings is now enabled by default PiperOrigin-RevId: 250159837
Bazel 0.27 flipped incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Bug: Issue 10998 Change-Id: I7972d15d914c11689f1808df56a0eb79e0075e73
@laurentlb Is this expected that we see "Internal error thrown during build."?
|
Bazel 0.27 flipped incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Change-Id: I639948584a65decfbe873c214c027290d9401c56
Bazel 0.27 flipped incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Change-Id: I7c0649a7cca6139c49f13c2f67cae857096b5cf5
Internal errors or Java stack traces are never expected. I've filed a separate bug for it. This shouldn't block you though: the error still contains the important information about the bzl file. |
Bazel 0.27 flipped incompatible Starlark flag: --incompatible_string_join_requires_strings, see: [1] for more details. [1] bazelbuild/bazel#7802 Change-Id: Id8588f65ba34a084d82f282da180fb8b35ef48ac
Fixes bazelbuild#7802 RELNOTES: --incompatible_string_join_requires_strings is now enabled by default PiperOrigin-RevId: 250159837
rules_scala fails with this flag: https://travis-ci.org/bazelbuild/rules_scala/jobs/561942959 How was it flipped then? |
Also update WORKSPACE to resolve build failure. Failure had the following error: INFO: Call stack for the definition of repository 'package_bundle' which is a _dpkg_list (rule definition at /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/distroless/package_manager/dpkg.bzl:19:14): - /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/distroless/package_manager/dpkg.bzl:74:3 - /workspace/WORKSPACE:173:1 ERROR: An error occurred during the fetch of repository 'package_bundle': sequence element must be a string (got 'path'). See bazelbuild/bazel#7802 for information about --incompatible_string_join_requires_strings.
Also update WORKSPACE to resolve build failure. Failure had the following error: INFO: Call stack for the definition of repository 'package_bundle' which is a _dpkg_list (rule definition at /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/distroless/package_manager/dpkg.bzl:19:14): - /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/distroless/package_manager/dpkg.bzl:74:3 - /workspace/WORKSPACE:173:1 ERROR: An error occurred during the fetch of repository 'package_bundle': sequence element must be a string (got 'path'). See bazelbuild/bazel#7802 for information about --incompatible_string_join_requires_strings.
#7802 RELNOTES: None. PiperOrigin-RevId: 281069144
The call to `fail` itself failed with ``` File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8b8a09a5fc28e77c5514319513adb8f9/external/rules_haskell/haskell/ghc_bindist.bzl", line 197, in "{0} failed, aborting creation of GHC bindist".format " ".join(args) sequence element must be a string (got 'path'). See bazelbuild/bazel#7802 for information about --incompatible_string_join_requires_strings. ``` This change switches to a shared implementation that fixes this issue.
bazelbuild/bazel#7802 RELNOTES: None. PiperOrigin-RevId: 281069144
bazelbuild/bazel#7802 RELNOTES: A new flag `--incompatible_string_join_requires_strings` is introduced. The sequence argument of `string.join` must contain only string elements. PiperOrigin-RevId: 240775005
With
--incompatible_string_join_requires_strings=false
, this code was previously accepted by Bazel:However the argument of
string.join
should an iterable of strings. Bazel used to implicitly convert each item to a string (https://github.com/bazelbuild/starlark/blob/master/spec.md#stringjoin).Since Bazel 0.27, this is an error and the flag
--incompatible_string_join_requires_strings
is set to true. If your code relies on the old behavior, do instead an explicit conversion to string withstr
:A temporary workaround is to use
--incompatible_string_join_requires_strings=false
. This flag will be removed in the future.Error message
If you see an error message similar to this (with a call to string.join in the stack trace), your code is likely affected by this change:
The text was updated successfully, but these errors were encountered: