Rename and invert skip_unit_tests to build_native_rust_unit_tests [chromium/src : main]

1 view
Skip to first unread message

danakj (Gerrit)

unread,
Mar 9, 2022, 10:27:53 AM3/9/22
to rust...@chromium.org, Chromium LUCI CQ, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

Attention is currently required from: Łukasz Anforowicz.

View Change

    To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
    Gerrit-Change-Number: 3513974
    Gerrit-PatchSet: 1
    Gerrit-Owner: danakj <dan...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-CC: Adrian Taylor <adet...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-Comment-Date: Wed, 09 Mar 2022 15:27:39 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    danakj (Gerrit)

    unread,
    Mar 9, 2022, 10:42:43 AM3/9/22
    to rust...@chromium.org

    Attention is currently required from: Łukasz Anforowicz.

    danakj uploaded patch set #2 to this change.

    View Change

    Rename and invert skip_unit_tests to build_native_rust_unit_tests

    Since skip_unit_tests was defaulting to true now, instead we rename it
    to build_native_rust_unit_tests which defaults to false.

    R=luk...@chromium.org

    Bug: 1296156
    Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
    Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,android-rust-arm-rel
    ---
    M build/config/rust.gni
    M build/rust/cargo_crate.gni
    M build/rust/mixed_target.gni
    M build/rust/rust_executable.gni
    M build/rust/rust_static_library.gni
    M build/rust/rust_target.gni
    M build/rust/rust_unit_test.gni
    M build/rust/tests/BUILD.gn
    M build/rust/tests/test_mixed_component/BUILD.gn
    M build/rust/tests/test_mixed_executable/BUILD.gn
    M build/rust/tests/test_mixed_shared_library/BUILD.gn
    M build/rust/tests/test_mixed_static_library/BUILD.gn
    M build/rust/tests/test_mixed_testonly_executable/BUILD.gn
    M build/rust/tests/test_rust_multiple_dep_versions_exe/v1/BUILD.gn
    M build/rust/tests/test_rust_multiple_dep_versions_exe/v2/BUILD.gn
    M build/rust/tests/test_variable_static_library/BUILD.gn
    M mojo/public/rust/BUILD.gn
    M testing/buildbot/waterfalls.pyl
    M third_party/rust/aho_corasick/v0_7/BUILD.gn
    M third_party/rust/ansi_term/v0_11/BUILD.gn
    M third_party/rust/aquamarine/v0_1/BUILD.gn
    M third_party/rust/atty/v0_2/BUILD.gn
    M third_party/rust/autocxx/v0_16/BUILD.gn
    M third_party/rust/autocxx_bindgen/v0_59/BUILD.gn
    M third_party/rust/autocxx_engine/v0_16/BUILD.gn
    M third_party/rust/autocxx_macro/v0_16/BUILD.gn
    M third_party/rust/autocxx_parser/v0_16/BUILD.gn
    M third_party/rust/bindgen/v0_59/BUILD.gn
    M third_party/rust/bitflags/v1/BUILD.gn
    M third_party/rust/cexpr/v0_6/BUILD.gn
    M third_party/rust/cfg_if/v1/BUILD.gn
    M third_party/rust/clang_sys/v1/BUILD.gn
    M third_party/rust/clap/v2/BUILD.gn
    M third_party/rust/codespan_reporting/v0_11/BUILD.gn
    M third_party/rust/cxx/v1/BUILD.gn
    M third_party/rust/cxx_gen/v0_7/BUILD.gn
    M third_party/rust/cxxbridge_cmd/v1/BUILD.gn
    M third_party/rust/cxxbridge_macro/v1/BUILD.gn
    M third_party/rust/either/v1/BUILD.gn
    M third_party/rust/env_logger/v0_9/BUILD.gn
    M third_party/rust/fastrand/v1/BUILD.gn
    M third_party/rust/glob/v0_3/BUILD.gn
    M third_party/rust/heck/v0_3/BUILD.gn
    M third_party/rust/humantime/v2/BUILD.gn
    M third_party/rust/indoc/v1/BUILD.gn
    M third_party/rust/itertools/v0_10/BUILD.gn
    M third_party/rust/itertools/v0_9/BUILD.gn
    M third_party/rust/itoa/v0_4/BUILD.gn
    M third_party/rust/itoa/v1/BUILD.gn
    M third_party/rust/lazy_static/v1/BUILD.gn
    M third_party/rust/lazycell/v1/BUILD.gn
    M third_party/rust/libc/v0_2/BUILD.gn
    M third_party/rust/libloading/v0_7/BUILD.gn
    M third_party/rust/link_cplusplus/v1/BUILD.gn
    M third_party/rust/log/v0_4/BUILD.gn
    M third_party/rust/memchr/v2/BUILD.gn
    M third_party/rust/minimal_lexical/v0_2/BUILD.gn
    M third_party/rust/moveit/v0_4/BUILD.gn
    M third_party/rust/nom/v7/BUILD.gn
    M third_party/rust/once_cell/v1/BUILD.gn
    M third_party/rust/peeking_take_while/v0_1/BUILD.gn
    M third_party/rust/proc_macro2/v1/BUILD.gn
    M third_party/rust/proc_macro_error/v1/BUILD.gn
    M third_party/rust/proc_macro_error_attr/v1/BUILD.gn
    M third_party/rust/quote/v1/BUILD.gn
    M third_party/rust/regex/v1/BUILD.gn
    M third_party/rust/regex_syntax/v0_6/BUILD.gn
    M third_party/rust/remove_dir_all/v0_5/BUILD.gn
    M third_party/rust/rstest/v0_12/BUILD.gn
    M third_party/rust/rustc_hash/v1/BUILD.gn
    M third_party/rust/rustc_version/v0_4/BUILD.gn
    M third_party/rust/rustversion/v1/BUILD.gn
    M third_party/rust/ryu/v1/BUILD.gn
    M third_party/rust/semver/v1/BUILD.gn
    M third_party/rust/serde/v1/BUILD.gn
    M third_party/rust/serde_derive/v1/BUILD.gn
    M third_party/rust/serde_json/v1/BUILD.gn
    M third_party/rust/serde_jsonrc/v0_1/BUILD.gn
    M third_party/rust/shlex/v1/BUILD.gn
    M third_party/rust/small_ctor/v0_1/BUILD.gn
    M third_party/rust/strsim/v0_8/BUILD.gn
    M third_party/rust/strum_macros/v0_23/BUILD.gn
    M third_party/rust/syn/v1/BUILD.gn
    M third_party/rust/tempfile/v3/BUILD.gn
    M third_party/rust/termcolor/v1/BUILD.gn
    M third_party/rust/textwrap/v0_11/BUILD.gn
    M third_party/rust/unicode_segmentation/v1/BUILD.gn
    M third_party/rust/unicode_width/v0_1/BUILD.gn
    M third_party/rust/unicode_xid/v0_2/BUILD.gn
    M third_party/rust/unindent/v0_1/BUILD.gn
    M third_party/rust/unzip_n/v0_1/BUILD.gn
    M third_party/rust/vec_map/v0_8/BUILD.gn
    M third_party/rust/version_check/v0_9/BUILD.gn
    M third_party/rust/which/v4/BUILD.gn
    M third_party/rust/winapi/v0_3/BUILD.gn
    M third_party/rust/winapi_util/v0_1/BUILD.gn
    M tools/crates/lib/build_rule.py
    M tools/crates/lib/consts.py
    98 files changed, 146 insertions(+), 124 deletions(-)

    To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
    Gerrit-Change-Number: 3513974
    Gerrit-PatchSet: 2
    Gerrit-Owner: danakj <dan...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-CC: Adrian Taylor <adet...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-MessageType: newpatchset

    Łukasz Anforowicz (Gerrit)

    unread,
    Mar 9, 2022, 12:05:17 PM3/9/22
    to danakj, rust...@chromium.org, Chromium LUCI CQ, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

    Attention is currently required from: danakj.

    Patch set 3:Code-Review +1

    View Change

    5 comments:

    • Patchset:

      • Patch Set #3:

        Thanks! LGTM - PTAL at my comments below but none of them are blocking.

    • File build/rust/rust_executable.gni:

      • Patch Set #3, Line 23: .

        nit: Is this a good place to mention: 1) first-party Chromium code should typically avoid setting this GN variable, because it's tests should use #[gtest(...)] attribute instead and/or 2) for discussion on when to use #[test] vs #[gtest(...)] please see some-link-to-md-docs-here? WDYT?

    • File build/rust/tests/test_mixed_component/BUILD.gn:

      • Patch Set #3, Line 16: rs_build_native_rust_unit_tests = true

        Optional / just an idea: Do we want to prevent copy&paste (i.e. prevent others from assuming that `#[test]` should be used instead of `#[gtest(...)]`) by adding a comment here (and in other similar BUILD.gn) files saying:

            # Tests under //build/rust/tests are too low-level to depend on
        # `#[gtest(...)]` attribute that should be used for most of the
        # other first-party tests in Chromium. To build tests using
        # `#[test]` attribute we need to explicitly opt-in by setting the
        # `rs_build_native_rust_unit_tests` here.

        Too long? Feel free to word-smith (or abandon altogether).
    • File build/rust/tests/test_rust_multiple_dep_versions_exe/v2/BUILD.gn:

      • Patch Set #3, Line 14: false

        Fascinating. Thanks for catching this and filing a bug.

        I guess `rust_unit_tests_group` [1] will be useful for providing a more human-friendly name for the tests (without auto-generated version parts, etc. - e.g. we'll probably end up defining "third_party_crate_tests" test group, right?)

    • File third_party/rust/aho_corasick/v0_7/BUILD.gn:

      • Patch Set #3, Line 18: build_native_rust_unit_tests = false

        In the long-term we plan to run third-party crate tests on bots, right? (e.g. to ensure test coverage on all Chromium-supported platforms) QUESTION: Is there a bug to track this work?

        Also - I wonder if this particular bit (`build_native_rust_unit_tests`) is per-crate VS global. It seems like a global knob to me (?). Maybe with a way to override in rare circumstances for individual crates if their tests don't work in Chromium for some reason. QUESTION: If this is global, then do we want to deduplicate this somehow? QUESTION2: How do we configure `rustc` warnings/errors policy (and do we want a unified policy for all 3rd party crates)?

    To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
    Gerrit-Change-Number: 3513974
    Gerrit-PatchSet: 3
    Gerrit-Owner: danakj <dan...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-CC: Adrian Taylor <adet...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Attention: danakj <dan...@chromium.org>
    Gerrit-Comment-Date: Wed, 09 Mar 2022 17:05:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    danakj (Gerrit)

    unread,
    Mar 9, 2022, 12:34:23 PM3/9/22
    to rust...@chromium.org, Łukasz Anforowicz, Chromium LUCI CQ, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

    View Change

    4 comments:

    • File build/rust/rust_executable.gni:

      • nit: Is this a good place to mention: 1) first-party Chromium code should typically avoid setting th […]

        Done

    • File build/rust/tests/test_mixed_component/BUILD.gn:

      • Optional / just an idea: Do we want to prevent copy&paste (i.e. […]

        Done, in mixed_target.gni. Also a TODO here.

    • File build/rust/tests/test_rust_multiple_dep_versions_exe/v2/BUILD.gn:

      • Fascinating. Thanks for catching this and filing a bug. […]

        Yeah, we should do that I think.

    • File third_party/rust/aho_corasick/v0_7/BUILD.gn:

    To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
    Gerrit-Change-Number: 3513974
    Gerrit-PatchSet: 4
    Gerrit-Owner: danakj <dan...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-CC: Adrian Taylor <adet...@chromium.org>
    Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
    Gerrit-Comment-Date: Wed, 09 Mar 2022 17:34:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-MessageType: comment

    danakj (Gerrit)

    unread,
    Mar 9, 2022, 1:53:36 PM3/9/22
    to rust...@chromium.org, Łukasz Anforowicz, Chromium LUCI CQ, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

    Patch set 5:Commit-Queue +2

    View Change

      To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
      Gerrit-Change-Number: 3513974
      Gerrit-PatchSet: 5
      Gerrit-Owner: danakj <dan...@chromium.org>
      Gerrit-Reviewer: danakj <dan...@chromium.org>
      Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
      Gerrit-CC: Adrian Taylor <adet...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Comment-Date: Wed, 09 Mar 2022 18:53:25 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      danakj (Gerrit)

      unread,
      Mar 9, 2022, 1:56:33 PM3/9/22
      to rust...@chromium.org, Łukasz Anforowicz, Chromium LUCI CQ, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

      Patch set 5:Owners-Override +1Commit-Queue +2

      View Change

      1 comment:

      To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
      Gerrit-Change-Number: 3513974
      Gerrit-PatchSet: 5
      Gerrit-Owner: danakj <dan...@chromium.org>
      Gerrit-Reviewer: danakj <dan...@chromium.org>
      Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
      Gerrit-CC: Adrian Taylor <adet...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-Comment-Date: Wed, 09 Mar 2022 18:56:20 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 9, 2022, 2:02:56 PM3/9/22
      to danakj, rust...@chromium.org, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org, Sadrul Chowdhury

      Chromium LUCI CQ submitted this change.

      View Change



      3 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: build/rust/rust_executable.gni
      Insertions: 3, Deletions: 0.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_mixed_component/BUILD.gn
      Insertions: 3, Deletions: 0.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_rust_static_library_non_standard_arrangement/BUILD.gn
      Insertions: 3, Deletions: 0.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_mixed_executable/BUILD.gn
      Insertions: 0, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/mixed_target.gni
      Insertions: 5, Deletions: 11.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_mixed_testonly_executable/BUILD.gn
      Insertions: 0, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_mixed_static_library/BUILD.gn
      Insertions: 3, Deletions: 0.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: build/rust/tests/test_mixed_shared_library/BUILD.gn
      Insertions: 3, Deletions: 0.

      The diff is too large to show. Please review the diff.
      ```

      Approvals: Łukasz Anforowicz: Looks good to me danakj: Commit; Looks good to me
      Rename and invert skip_unit_tests to build_native_rust_unit_tests

      Since skip_unit_tests was defaulting to true now, instead we rename it
      to build_native_rust_unit_tests which defaults to false.

      R=luk...@chromium.org

      Bug: 1296156
      Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
      Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,android-rust-arm-rel
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3513974
      Reviewed-by: Łukasz Anforowicz <luk...@chromium.org>
      Commit-Queue: danakj <dan...@chromium.org>
      Owners-Override: danakj <dan...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#979351}

      ---
      M build/config/rust.gni
      M build/rust/cargo_crate.gni
      M build/rust/mixed_target.gni
      M build/rust/rust_executable.gni
      M build/rust/rust_static_library.gni
      M build/rust/rust_target.gni
      M build/rust/rust_unit_test.gni
      M build/rust/tests/BUILD.gn
      M build/rust/tests/test_mixed_component/BUILD.gn
      M build/rust/tests/test_mixed_executable/BUILD.gn
      M build/rust/tests/test_mixed_shared_library/BUILD.gn
      M build/rust/tests/test_mixed_static_library/BUILD.gn
      M build/rust/tests/test_mixed_testonly_executable/BUILD.gn
      M build/rust/tests/test_rust_exe/BUILD.gn
      M build/rust/tests/test_rust_multiple_dep_versions_exe/v1/BUILD.gn
      M build/rust/tests/test_rust_multiple_dep_versions_exe/v2/BUILD.gn
      M build/rust/tests/test_rust_shared_library/BUILD.gn
      M build/rust/tests/test_rust_static_library/BUILD.gn
      M build/rust/tests/test_rust_static_library_non_standard_arrangement/BUILD.gn
      102 files changed, 181 insertions(+), 134 deletions(-)


      To view, visit change 3513974. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I299e53185e2733d44fdd720d720e7b6840bc596f
      Gerrit-Change-Number: 3513974
      Gerrit-PatchSet: 6
      Gerrit-Owner: danakj <dan...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: danakj <dan...@chromium.org>
      Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
      Gerrit-CC: Adrian Taylor <adet...@chromium.org>
      Gerrit-CC: Sadrul Chowdhury <sad...@chromium.org>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages