bazelbuild / buildtools

A bazel BUILD file formatter and editor
Apache License 2.0
1.01k stars 415 forks source link

Error: 'NoneType' value has no field or method 'workspace_name' #1220

Closed sgowroji closed 8 months ago

sgowroji commented 9 months ago

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3519#018c569d-f66f-4877-8574-1b306b051c9d

Platform :  Windows, Ubuntu

Logs:

ERROR: Traceback (most recent call last):
    File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/9651ebde5e3bedd80f0b852198d342e3/external/io_bazel_rules_go/go/private/rules/transition.bzl", line 126, column 47, in _go_transition_impl
        platform = platform_from_crosstool(crosstool_top, cpu)
    File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/9651ebde5e3bedd80f0b852198d342e3/external/io_bazel_rules_go/go/platform/crosstool.bzl", line 57, column 27, in platform_from_crosstool
        platform = matcher(crosstool_top, cpu)
    File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/9651ebde5e3bedd80f0b852198d342e3/external/io_bazel_rules_go/go/platform/crosstool.bzl", line 38, column 21, in _match_android
        crosstool_top.workspace_name == "androidndk":
Error: 'NoneType' value has no field or method 'workspace_name'
(02:04:42) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/9651ebde5e3bedd80f0b852198d342e3/external/io_bazel_rules_go/go/tools/builders/BUILD.bazel:135:10: On dependency edge @@io_bazel_rules_go//go/tools/builders:go-protoc-bin (46a5c98) -|$go_context_data|-> @@io_bazel_rules_go//:go_context_data: Errors encountered while applying Starlark transition
(02:04:42) ERROR: Analysis of target '//extra_actions_base_proto:extra_actions_base.gen.pb.go_checkshtest' failed; build aborted: Analysis failed

Steps:

git clone https://github.com/bazelbuild/buildtools.git 
git reset d4c9dccdfbb18472cfd10d5d5cb6dc65de76e3af --hard
export USE_BAZEL_VERSION=591d1257c51c2f997e067964878e3a9c7ee1f89c
bazel build --enable_runfiles  -- //:tests

CC Greenteam @comius

mai93 commented 9 months ago

I think we need to update rules_go, io_bazel_rules_go/go/platform/crosstool.bzl does not exist in the latest version.

vladmos commented 8 months ago

Should be fixed by #1234, I'll verify tomorrow after the next run of downstream.

sgowroji commented 8 months ago

Thanks, CI is green now. Closing this issue now.