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

[6.0.0rc1] cc_proto_library analysis failure #16577

Closed
Yannic opened this issue Oct 26, 2022 · 15 comments
Closed

[6.0.0rc1] cc_proto_library analysis failure #16577

Yannic opened this issue Oct 26, 2022 · 15 comments
Labels
awaiting-user-response Awaiting a response from the author P1 I'll work on this now. (Assignee required) team-Rules-CPP Issues for C++ rules type: bug

Comments

@Yannic
Copy link
Contributor

Yannic commented Oct 26, 2022

Description of the bug:

in @_builtins//:common/cc/cc_proto_library.bzl%_cc_proto_aspect aspect on proto_library rule @bazel//src/main/protobuf:execution_statistics_proto: 
Traceback (most recent call last):
	File "/virtual_builtins_bzl/common/cc/cc_proto_library.bzl", line 99, column 48, in _aspect_impl
	File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 191, column 17, in _find_cpp_toolchain
Error in fail: In order to use find_cpp_toolchain, you must include the '//tools/cpp:toolchain_type' in the toolchains argument to your rule.

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

No response

Which operating system are you running Bazel on?

Linux, macOS

What is the output of bazel info release?

6.0.0rc1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

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

Relevant commits: c8b7ed3

@Yannic
Copy link
Contributor Author

Yannic commented Oct 26, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Oct 26, 2022
@Yannic
Copy link
Contributor Author

Yannic commented Oct 26, 2022

INFO: Writing tracer profile to '/private/var/tmp/_bazel_ec2-user/a3fd1e83c84cae2e0d3dfb1700a941e6/command.profile.gz'
INFO: Invocation ID: 570f963f-61b0-4d38-bc44-7bb1c0931683
INFO: Streaming build results to: https://glass.cluster.engflow.com/invocation/570f963f-61b0-4d38-bc44-7bb1c0931683
INFO: Options provided by the client:5  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'test' from /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc:7  Inherited 'common' options: --enable_platform_specific_config --experimental_announce_profile_path
INFO: Reading rc options for 'test' from /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc:9  Inherited 'build' options: --explicit_java_test_deps --nostamp --incompatible_strict_action_env --verbose_failures --incompatible_enable_cc_toolchain_resolution --features=-supports_dynamic_linker --custom_malloc=//lang/cpp:runtime --java_language_version=11 --java_runtime_version=11 --tool_java_language_version=11 --tool_java_runtime_version=11 --build_tag_filters=-ci-only --test_tag_filters=-ci-only,-ci-only-test --instrumentation_filter=<redacted>
INFO: Reading rc options for 'test' from /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc:11  'test' options: --test_summary=testcase --test_output=errors1
INFO: Found applicable config definition build:ci in file /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc: --config=release --color=yes --curses=yes --show_timestamps --announce_rc --test_output=summary --show_progress_rate_limit=2.01
INFO: Found applicable config definition build:release in file /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc: --compilation_mode=opt1
INFO: Found applicable config definition build:macos in file /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc: --config=clang --experimental_one_version_enforcement=ERROR --workspace_status_command=infra/get_workspace_status
INFO: Found applicable config definition build:clang in file /private/var/lib/github-actions/_work/engflow/engflow/.bazelrc: --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --cxxopt=-fno-exceptions --host_cxxopt=-fno-exceptions --cxxopt=-fvisibility=hidden --host_cxxopt=-fvisibility=hidden --cxxopt=-Werror=reorder --host_cxxopt=-Werror=reorder --cxxopt=-Werror=unused-function --host_cxxopt=-Werror=unused-function --cxxopt=-Werror=return-type --host_cxxopt=-Werror=return-type1
INFO: Current date is 2022-10-26

@meteorcloudy
Copy link
Member

/cc @buildbreaker2021

@buildbreaker2021
Copy link
Contributor

Will take a look

@Wyverald Wyverald added this to the 6.0.0 release blockers milestone Oct 27, 2022
@Wyverald Wyverald removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Oct 27, 2022
Yannic added a commit to EngFlow/bazel that referenced this issue Oct 27, 2022
@Yannic
Copy link
Contributor Author

Yannic commented Oct 27, 2022

Seems to be missing the toolchain: #16585

@buildbreaker2021
Copy link
Contributor

f571117
Should fix it.
However I could not reproduce the failure since it was not specified how I could do so - please close the issue if the commit fixes it.

@Wyverald Wyverald removed this from the 6.0.0 release blockers milestone Oct 28, 2022
@Wyverald
Copy link
Member

@bazel-io fork 6.0.0

@fmeum
Copy link
Collaborator

fmeum commented Oct 28, 2022

@buildbreaker2021 @Yannic I think that neither of your changes fix this issue:

  1. [cc] Add cc toolchain to starlark cc_proto_library #16585 would need to move the toolchains definition from the rule to the aspect definition. It comes with a test that indeed fails because of this.
  2. f571117 adds the toolchain type as a label attribute rather than to toolchains. Grepping for _cc_toolchain_type in Bazel turns up a similar attribute in cc_binary, but it isn't used elsewhere. I don't think find_cpp_toolchain would pick it up, it even hardcodes the same label.

@buildbreaker2021 You can use the integration test @Yannic added in https://github.com/bazelbuild/bazel/pull/16585/files#diff-6991d88c914706dc4238fc5d870e151d40411e1c9f2163d5b9da6cce9488132e to verify the fix.

@buildbreaker2021
Copy link
Contributor

Thanks for your input @fmeum

I will defer to the author of the issue to answer if the fix works or not - as for the test #16585 seems to have some failures I did not have a good look into it, but I assumed that I could not use it until it was green.

@buildbreaker2021 buildbreaker2021 added the awaiting-user-response Awaiting a response from the author label Oct 28, 2022
@meteorcloudy
Copy link
Member

I believe the test failure in #16585 is exactly the integration test that reproduces this error, which we want to fix. You can patch that test based on HEAD and check if it passes. If not, we probably need further fix.

@Yannic
Copy link
Contributor Author

Yannic commented Oct 28, 2022

Rebasing #16585 to master and removing my fix still reproduces the issue: https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/12978#01841fd2-6d67-4003-b75a-c6e1d6c2f289

@meteorcloudy meteorcloudy added P1 I'll work on this now. (Assignee required) and removed untriaged labels Nov 2, 2022
@meteorcloudy
Copy link
Member

meteorcloudy commented Nov 4, 2022

To fix this issue, should we cherry-pick 6c1e4b7 only, or f571117 is also needed?

FYI @kshyanashree

@Yannic
Copy link
Contributor Author

Yannic commented Nov 4, 2022

6c1e4b7 is sufficient because it reverts f571117.

@meteorcloudy
Copy link
Member

@Yannic Thanks! @kshyanashree please cherry pick 6c1e4b7 for #16600

@ShreeM01
Copy link
Contributor

ShreeM01 commented Nov 4, 2022

Sure @meteorcloudy, I will do it. Thanks!

ShreeM01 added a commit that referenced this issue Nov 4, 2022
Fixes #16577

Closes #16585.

PiperOrigin-RevId: 485600476
Change-Id: I3c2985731ff800a2c6136f401ed3c7e5e89518ad

Co-authored-by: Yannic <contact@yannic-bonenberger.com>
lripoche pushed a commit to lripoche/bazel that referenced this issue Jun 13, 2023
Fixes bazelbuild#16577

Closes bazelbuild#16585.

PiperOrigin-RevId: 485600476
Change-Id: I3c2985731ff800a2c6136f401ed3c7e5e89518ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-user-response Awaiting a response from the author P1 I'll work on this now. (Assignee required) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants