Skip to content

rules_rust is broken with Bazel@HEAD on Bazel CI  #1938

Closed

Description

@sgowroji

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2975#0187b105-64ac-489a-9669-5422ef5841ae

Platform : rules_rust (Bzlmod Examples on :ubuntu: 20.04 LTS (OpenJDK 11, gcc 9.4.0))

(02:23:04) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/b66e34ecd9a320ebfcd56259c6d4c4ba/external/rules_rust~override/util/process_wrapper/BUILD.bazel:6:36: in rust_binary_without_process_wrapper rule @rules_rust~override//util/process_wrapper:process_wrapper:
--
  | Traceback (most recent call last):
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/b66e34ecd9a320ebfcd56259c6d4c4ba/external/rules_rust~override/rust/private/rust.bzl", line 338, column 32, in _rust_binary_impl
  | return rustc_compile_action(
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/b66e34ecd9a320ebfcd56259c6d4c4ba/external/rules_rust~override/rust/private/rustc.bzl", line 1075, column 52, in rustc_compile_action
  | dep_info, build_info, linkstamps = collect_deps(
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/b66e34ecd9a320ebfcd56259c6d4c4ba/external/rules_rust~override/rust/private/rustc.bzl", line 232, column 65, in collect_deps
  | linkstamps.append(cc_info.linking_context.linkstamps())
  | Error in linkstamps: Rule in 'rust/private' cannot use private API

Steps followed

  1. git clone -v https://github.com/bazelbuild/rules_rust.git
  2. git reset f0e12c7 --hard
  3. export USE_BAZEL_VERSION=bbf78a2cec27bf42bcbba59d3f84c857dff3aa15
  4. bazel build //...

CC @meteorcloudy

Activity

  1. scentini commented on Apr 25, 2023

    @scentini
    Collaborator

    @meteorcloudy I don't quite understand the culprit commit, but if it's of any help, rules_rust is exempted from the private API checks here https://github.com/bazelbuild/bazel/blob/3e140f374580f0f0eb5416872e9e421126920222/src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java#L150. This does seem like something that needs to be fixed on the Bazel side, so I will not do further investigation.

  2. sgowroji commented on Apr 25, 2023

    @sgowroji
    MemberAuthor

    Please ignore the above commit added in culprit. Edited and removed now. Thanks!

  3. scentini commented on Apr 25, 2023

    @scentini
    Collaborator

    Thanks @sgowroji !
    In that case, @buildbreaker2021, @oquenchil , could one of you PTAL?

  4. buildbreaker2021 commented on Apr 25, 2023

    @buildbreaker2021
    Contributor

    I will take a look

  5. buildbreaker2021 commented on Apr 25, 2023

    @buildbreaker2021
    Contributor

    I could not reproduce this with neither currently released Bazel or with the one built at head. I fixed one bug internally earlier related to CopyBara transformation, which was causing the same failure so I am assuming this version of Bazel was built at a bad change.

  6. meteorcloudy commented on Apr 26, 2023

    @meteorcloudy
    Member

    @buildbreaker2021
    https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2982#0187bbbc-a5b6-4b00-b654-1987518b944b
    still seeing the failure

    Traceback (most recent call last):
    	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/084f02f8944fe1c067dd3922f4639434/external/rules_rust~override/rust/private/rust.bzl", line 338, column 32, in _rust_binary_impl
    		return rustc_compile_action(
    	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/084f02f8944fe1c067dd3922f4639434/external/rules_rust~override/rust/private/rustc.bzl", line 1075, column 52, in rustc_compile_action
    		dep_info, build_info, linkstamps = collect_deps(
    	File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/084f02f8944fe1c067dd3922f4639434/external/rules_rust~override/rust/private/rustc.bzl", line 232, column 65, in collect_deps
    		linkstamps.append(cc_info.linking_context.linkstamps())
    Error in linkstamps: Rule in 'rust/private' cannot use private API
    

    in last night's downstream build.

    Note that, this is failing with Bzlmod enabled, where the canonical name of rules_rust changed to rules_rust~override, I guess this is why the allowlist doesn't work? Is it possible to match rules_rust* instead?

  7. meteorcloudy commented on Apr 26, 2023

    @meteorcloudy
    Member

    From the code, it looks like it cannot match a pattern, however, is it possible to pass repo-mapping when creating the label from the allowlist here:
    https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java;l=2039
    /cc @Wyverald

  8. buildbreaker2021 commented on Apr 26, 2023

    @buildbreaker2021
    Contributor

    Will take another look.

    Note that, this is failing with Bzlmod enabled

    I missed this thanks!

  9. buildbreaker2021 commented on Apr 26, 2023

    @buildbreaker2021
    Contributor

    Should be fixed by bazelbuild/bazel@c06fe5c

  10. meteorcloudy commented on Apr 27, 2023

    @meteorcloudy
    Member

    This failure has been fixed in https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2983, but there are other failures with rules_rust, @sgowroji can you help file an new issue to track that breakage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions