Generate Rust crate roots for test() targets. [chromium/src : main]

2 views
Skip to first unread message

danakj (Gerrit)

unread,
Mar 9, 2022, 1:53:04 PM3/9/22
to rust...@chromium.org, vmpstr...@chromium.org, Chromium LUCI CQ, Tricium, John Chen, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org

Attention is currently required from: Łukasz Anforowicz, John Chen.

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
    Gerrit-Change-Number: 3513336
    Gerrit-PatchSet: 4
    Gerrit-Owner: danakj <dan...@chromium.org>
    Gerrit-Reviewer: John Chen <john...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-CC: Adrian Taylor <adet...@chromium.org>
    Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
    Gerrit-Attention: John Chen <john...@chromium.org>
    Gerrit-Comment-Date: Wed, 09 Mar 2022 18:52:53 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    John Chen (Gerrit)

    unread,
    Mar 9, 2022, 1:56:07 PM3/9/22
    to danakj, rust...@chromium.org, vmpstr...@chromium.org, Chromium LUCI CQ, Tricium, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org

    Attention is currently required from: danakj, Łukasz Anforowicz.

    Patch set 4:Code-Review +1

    View Change

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
      Gerrit-Change-Number: 3513336
      Gerrit-PatchSet: 4
      Gerrit-Owner: danakj <dan...@chromium.org>
      Gerrit-Reviewer: John Chen <john...@chromium.org>
      Gerrit-Reviewer: danakj <dan...@chromium.org>
      Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
      Gerrit-CC: Adrian Taylor <adet...@chromium.org>
      Gerrit-Attention: danakj <dan...@chromium.org>
      Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
      Gerrit-Comment-Date: Wed, 09 Mar 2022 18:55:57 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      danakj (Gerrit)

      unread,
      Mar 9, 2022, 2:13:40 PM3/9/22
      to rust...@chromium.org, vmpstr...@chromium.org, John Chen, Chromium LUCI CQ, Tricium, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org

      Attention is currently required from: Łukasz Anforowicz.

      Patch set 5:Commit-Queue +2

      View Change

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

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
        Gerrit-Change-Number: 3513336
        Gerrit-PatchSet: 5
        Gerrit-Owner: danakj <dan...@chromium.org>
        Gerrit-Reviewer: John Chen <john...@chromium.org>
        Gerrit-Reviewer: danakj <dan...@chromium.org>
        Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
        Gerrit-CC: Adrian Taylor <adet...@chromium.org>
        Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
        Gerrit-Comment-Date: Wed, 09 Mar 2022 19:13:25 +0000

        danakj (Gerrit)

        unread,
        Mar 9, 2022, 2:14:40 PM3/9/22
        to rust...@chromium.org, vmpstr...@chromium.org, John Chen, Chromium LUCI CQ, Tricium, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org

        Attention is currently required from: Łukasz Anforowicz.

        Patch set 5:Commit-Queue +1

        View Change

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Gerrit-Change-Number: 3513336
          Gerrit-PatchSet: 5
          Gerrit-Owner: danakj <dan...@chromium.org>
          Gerrit-Reviewer: John Chen <john...@chromium.org>
          Gerrit-Reviewer: danakj <dan...@chromium.org>
          Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-CC: Adrian Taylor <adet...@chromium.org>
          Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-Comment-Date: Wed, 09 Mar 2022 19:14:26 +0000

          danakj (Gerrit)

          unread,
          Mar 9, 2022, 6:11:05 PM3/9/22
          to rust...@chromium.org, vmpstr...@chromium.org

          Attention is currently required from: danakj, Łukasz Anforowicz.

          danakj uploaded patch set #7 to this change.

          View Change

          Generate Rust crate roots for test() targets.

          Test targets don't have a public interface and are simply a collection
          of independent test files. Instead of requiring devs to write a crate
          root pointing to each of those files (and introducing a chance for
          mistakenly forgetting a file which would then exclude its tests
          silently), generate the crate root from the set of rust files in
          `sources`.

          The module name encodes the full path to each file in sources, so that
          foo/bar.rs and baz/bar.rs do not collide as both being `mod bar;`.
          Instead they would be `mod foo_bar;` and `mod baz_bar;`

          Example generated file for base_unittests (which has a base_unittests_rs
          Rust target):

          % cat out_desktop/Release/gen/base/base_unittests_rs_crate_root.rs
          // Generated crate root for base_unittests_rs.
          #[path = "../../../../base/json/json_parser_unittest.rs"]
          mod json_json_parser_unittest.rs;
          #[path = "../../../../base/values_unittest.rs"]
          mod values_unittest.rs;

          R=john...@chromium.org, luk...@chromium.org

          Bug: 1293979
          Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,android-rust-arm-rel
          ---
          M base/BUILD.gn
          M build/rust/mixed_target.gni
          M build/rust/rust_target.gni
          M testing/rust_gtest_interop/BUILD.gn
          M testing/rust_gtest_interop/README.md
          M testing/test.gni
          6 files changed, 73 insertions(+), 26 deletions(-)

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Gerrit-Change-Number: 3513336
          Gerrit-PatchSet: 7
          Gerrit-Owner: danakj <dan...@chromium.org>
          Gerrit-Reviewer: John Chen <john...@chromium.org>
          Gerrit-Reviewer: danakj <dan...@chromium.org>
          Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-CC: Adrian Taylor <adet...@chromium.org>
          Gerrit-Attention: danakj <dan...@chromium.org>
          Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-MessageType: newpatchset

          danakj (Gerrit)

          unread,
          Mar 9, 2022, 6:11:53 PM3/9/22
          to rust...@chromium.org, vmpstr...@chromium.org, John Chen, Chromium LUCI CQ, Tricium, Łukasz Anforowicz, Adrian Taylor, chromium...@chromium.org

          Attention is currently required from: Łukasz Anforowicz.

          View Change

          1 comment:

          • Patchset:

            • Patch Set #7:

              PTAL lukasza. I've made sure we don't have module name collisions (unless you used underscores to carefully construct one, in which case we can go further in generating the module name).

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Gerrit-Change-Number: 3513336
          Gerrit-PatchSet: 7
          Gerrit-Owner: danakj <dan...@chromium.org>
          Gerrit-Reviewer: John Chen <john...@chromium.org>
          Gerrit-Reviewer: danakj <dan...@chromium.org>
          Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-CC: Adrian Taylor <adet...@chromium.org>
          Gerrit-Attention: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-Comment-Date: Wed, 09 Mar 2022 23:11:42 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Gerrit-MessageType: comment

          Łukasz Anforowicz (Gerrit)

          unread,
          Mar 10, 2022, 9:50:34 AM3/10/22
          to danakj, rust...@chromium.org, vmpstr...@chromium.org, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

          Attention is currently required from: danakj.

          Patch set 7:Code-Review +1

          View Change

          3 comments:

          • Patchset:

            • Patch Set #7:

              Thanks! LGTM if you think that my concerns about "foo_test_support" module are sufficiently under control.

          • File build/rust/rust_target.gni:

            • Patch Set #7, Line 58: Generated

              nit: s/ Generated / @generated /

              See https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#format_generated_files (I hear that other tools can also recognize this marker).

            • Patch Set #7, Line 62: "/", "_")

              This works if test sources only contain individual modules that do not refer to each other. This is usually the case, but sometimes there may be some shared helper functions. I guess you are saying that they should be put into a separate `foo_test_support` target/crate?

              I wonder what the error looks like in this case? And what `mod` statements can be put into the test support helper module A) itself and B) it's users, to fix the errors.

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Gerrit-Change-Number: 3513336
          Gerrit-PatchSet: 7
          Gerrit-Owner: danakj <dan...@chromium.org>
          Gerrit-Reviewer: John Chen <john...@chromium.org>
          Gerrit-Reviewer: danakj <dan...@chromium.org>
          Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-CC: Adrian Taylor <adet...@chromium.org>
          Gerrit-Attention: danakj <dan...@chromium.org>
          Gerrit-Comment-Date: Thu, 10 Mar 2022 14:50:25 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Gerrit-MessageType: comment

          danakj (Gerrit)

          unread,
          Mar 10, 2022, 11:26:37 AM3/10/22
          to rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

          View Change

          2 comments:

          • File build/rust/rust_target.gni:

            • nit: s/ Generated / @generated / […]

              Oh interesting, thanks!

            • I guess you are saying that they should be put into a separate foo_test_support target/crate?

              Precisely.

              There would be no error if you did this directly, but you'd have to figure out the crate path to it. You'd have to like use like `crate::the_generated_path::Helper`.

              I will call this out in the README as well.

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
          Gerrit-Change-Number: 3513336
          Gerrit-PatchSet: 7
          Gerrit-Owner: danakj <dan...@chromium.org>
          Gerrit-Reviewer: John Chen <john...@chromium.org>
          Gerrit-Reviewer: danakj <dan...@chromium.org>
          Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-CC: Adrian Taylor <adet...@chromium.org>
          Gerrit-Comment-Date: Thu, 10 Mar 2022 16:26:27 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Łukasz Anforowicz <luk...@chromium.org>
          Gerrit-MessageType: comment

          danakj (Gerrit)

          unread,
          Mar 10, 2022, 11:27:14 AM3/10/22
          to rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

          Patch set 8:Commit-Queue +2

          View Change

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

            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
            Gerrit-Change-Number: 3513336
            Gerrit-PatchSet: 8
            Gerrit-Owner: danakj <dan...@chromium.org>
            Gerrit-Reviewer: John Chen <john...@chromium.org>
            Gerrit-Reviewer: danakj <dan...@chromium.org>
            Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
            Gerrit-CC: Adrian Taylor <adet...@chromium.org>
            Gerrit-Comment-Date: Thu, 10 Mar 2022 16:27:04 +0000

            danakj (Gerrit)

            unread,
            Mar 10, 2022, 11:58:48 AM3/10/22
            to rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

            Patch set 9:Commit-Queue +2

            View Change

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

              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
              Gerrit-Change-Number: 3513336
              Gerrit-PatchSet: 9
              Gerrit-Owner: danakj <dan...@chromium.org>
              Gerrit-Reviewer: John Chen <john...@chromium.org>
              Gerrit-Reviewer: danakj <dan...@chromium.org>
              Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
              Gerrit-CC: Adrian Taylor <adet...@chromium.org>
              Gerrit-Comment-Date: Thu, 10 Mar 2022 16:58:38 +0000

              danakj (Gerrit)

              unread,
              Mar 10, 2022, 1:01:01 PM3/10/22
              to rust...@chromium.org, vmpstr...@chromium.org

              Attention is currently required from: danakj.

              danakj uploaded patch set #10 to this change.

              View Change

              Generate Rust crate roots for test() targets.

              Test targets don't have a public interface and are simply a collection
              of independent test files. Instead of requiring devs to write a crate
              root pointing to each of those files (and introducing a chance for
              mistakenly forgetting a file which would then exclude its tests
              silently), generate the crate root from the set of rust files in
              `sources`.

              The module name encodes the full path to each file in sources, so that
              foo/bar.rs and baz/bar.rs do not collide as both being `mod bar;`.
              Instead they would be `mod foo_bar;` and `mod baz_bar;`

              Example generated file for base_unittests (which has a base_unittests_rs
              Rust target):

              % cat out_desktop/Release/gen/base/base_unittests_rs_crate_root.rs
              // Generated crate root for base_unittests_rs.
              #[path = "../../../../base/json/json_parser_unittest.rs"]
              mod json_json_parser_unittest.rs;
              #[path = "../../../../base/values_unittest.rs"]
              mod values_unittest.rs;

              R=john...@chromium.org, luk...@chromium.org

              Bug: 1293979
              Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
              Cq-Include-Trybots: android-rust-arm-rel

              ---
              M base/BUILD.gn
              M build/rust/mixed_target.gni
              M build/rust/rust_target.gni
              M testing/rust_gtest_interop/BUILD.gn
              M testing/rust_gtest_interop/README.md
              M testing/test.gni
              6 files changed, 101 insertions(+), 26 deletions(-)

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

              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
              Gerrit-Change-Number: 3513336
              Gerrit-PatchSet: 10
              Gerrit-Owner: danakj <dan...@chromium.org>
              Gerrit-Reviewer: John Chen <john...@chromium.org>
              Gerrit-Reviewer: danakj <dan...@chromium.org>
              Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
              Gerrit-CC: Adrian Taylor <adet...@chromium.org>
              Gerrit-Attention: danakj <dan...@chromium.org>
              Gerrit-MessageType: newpatchset

              danakj (Gerrit)

              unread,
              Mar 10, 2022, 1:01:38 PM3/10/22
              to rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

              Patch set 10:Commit-Queue +2

              View Change

              1 comment:

              • Patchset:

                • Patch Set #10:

                  Linux rust trybot broke when clang rolled and the set of libs in the clang dir changed. So skipping that one for now. Ade is working to fix it.

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

              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
              Gerrit-Change-Number: 3513336
              Gerrit-PatchSet: 10
              Gerrit-Owner: danakj <dan...@chromium.org>
              Gerrit-Reviewer: John Chen <john...@chromium.org>
              Gerrit-Reviewer: danakj <dan...@chromium.org>
              Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
              Gerrit-CC: Adrian Taylor <adet...@chromium.org>
              Gerrit-Comment-Date: Thu, 10 Mar 2022 18:01:30 +0000

              Chromium LUCI CQ (Gerrit)

              unread,
              Mar 10, 2022, 1:01:50 PM3/10/22
              to danakj, rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Tricium, Adrian Taylor, chromium...@chromium.org
              CQ can't continue processing your CL:
              * Failed to parse additional builders: project/bucket and builders must be separated by : in `android-rust-arm-rel`. Canonical syntax is "Cq-Include-Trybots: project/bucket:builder1,builder2;another/bucket:b3". Multiple lines are allowed.

              View Change

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

                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
                Gerrit-Change-Number: 3513336
                Gerrit-PatchSet: 10
                Gerrit-Owner: danakj <dan...@chromium.org>
                Gerrit-Reviewer: John Chen <john...@chromium.org>
                Gerrit-Reviewer: danakj <dan...@chromium.org>
                Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
                Gerrit-CC: Adrian Taylor <adet...@chromium.org>
                Gerrit-Comment-Date: Thu, 10 Mar 2022 18:01:47 +0000

                danakj (Gerrit)

                unread,
                Mar 10, 2022, 1:01:59 PM3/10/22
                to rust...@chromium.org, vmpstr...@chromium.org

                danakj uploaded patch set #11 to this change.

                View Change

                Generate Rust crate roots for test() targets.

                Test targets don't have a public interface and are simply a collection
                of independent test files. Instead of requiring devs to write a crate
                root pointing to each of those files (and introducing a chance for
                mistakenly forgetting a file which would then exclude its tests
                silently), generate the crate root from the set of rust files in
                `sources`.

                The module name encodes the full path to each file in sources, so that
                foo/bar.rs and baz/bar.rs do not collide as both being `mod bar;`.
                Instead they would be `mod foo_bar;` and `mod baz_bar;`

                Example generated file for base_unittests (which has a base_unittests_rs
                Rust target):

                % cat out_desktop/Release/gen/base/base_unittests_rs_crate_root.rs
                // Generated crate root for base_unittests_rs.
                #[path = "../../../../base/json/json_parser_unittest.rs"]
                mod json_json_parser_unittest.rs;
                #[path = "../../../../base/values_unittest.rs"]
                mod values_unittest.rs;

                R=john...@chromium.org, luk...@chromium.org

                Bug: 1293979
                Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
                Cq-Include-Trybots: luci.chromium.try:android-rust-arm-rel

                ---
                M base/BUILD.gn
                M build/rust/mixed_target.gni
                M build/rust/rust_target.gni
                M testing/rust_gtest_interop/BUILD.gn
                M testing/rust_gtest_interop/README.md
                M testing/test.gni
                6 files changed, 101 insertions(+), 26 deletions(-)

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

                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
                Gerrit-Change-Number: 3513336
                Gerrit-PatchSet: 11
                Gerrit-Owner: danakj <dan...@chromium.org>
                Gerrit-Reviewer: John Chen <john...@chromium.org>
                Gerrit-Reviewer: danakj <dan...@chromium.org>
                Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
                Gerrit-CC: Adrian Taylor <adet...@chromium.org>
                Gerrit-MessageType: newpatchset

                danakj (Gerrit)

                unread,
                Mar 10, 2022, 1:02:19 PM3/10/22
                to rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Chromium LUCI CQ, Tricium, Adrian Taylor, chromium...@chromium.org

                Attention is currently required from: danakj.

                Patch set 11:Commit-Queue +2

                View Change

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

                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
                  Gerrit-Change-Number: 3513336
                  Gerrit-PatchSet: 11
                  Gerrit-Owner: danakj <dan...@chromium.org>
                  Gerrit-Reviewer: John Chen <john...@chromium.org>
                  Gerrit-Reviewer: danakj <dan...@chromium.org>
                  Gerrit-Reviewer: Łukasz Anforowicz <luk...@chromium.org>
                  Gerrit-CC: Adrian Taylor <adet...@chromium.org>
                  Gerrit-Attention: danakj <dan...@chromium.org>
                  Gerrit-Comment-Date: Thu, 10 Mar 2022 18:02:09 +0000

                  Chromium LUCI CQ (Gerrit)

                  unread,
                  Mar 10, 2022, 1:45:32 PM3/10/22
                  to danakj, rust...@chromium.org, vmpstr...@chromium.org, Łukasz Anforowicz, John Chen, Tricium, Adrian Taylor, chromium...@chromium.org

                  Chromium LUCI CQ submitted this change.

                  View Change



                  7 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_target.gni
                  Insertions: 12, Deletions: 5.

                  The diff is too large to show. Please review the diff.
                  ```
                  ```
                  The name of the file: testing/rust_gtest_interop/README.md
                  Insertions: 21, Deletions: 0.

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

                  Approvals: Łukasz Anforowicz: Looks good to me John Chen: Looks good to me danakj: Commit
                  Generate Rust crate roots for test() targets.

                  Test targets don't have a public interface and are simply a collection
                  of independent test files. Instead of requiring devs to write a crate
                  root pointing to each of those files (and introducing a chance for
                  mistakenly forgetting a file which would then exclude its tests
                  silently), generate the crate root from the set of rust files in
                  `sources`.

                  The module name encodes the full path to each file in sources, so that
                  foo/bar.rs and baz/bar.rs do not collide as both being `mod bar;`.
                  Instead they would be `mod foo_bar;` and `mod baz_bar;`

                  Example generated file for base_unittests (which has a base_unittests_rs
                  Rust target):

                  % cat out_desktop/Release/gen/base/base_unittests_rs_crate_root.rs
                  // Generated crate root for base_unittests_rs.
                  #[path = "../../../../base/json/json_parser_unittest.rs"]
                  mod json_json_parser_unittest.rs;
                  #[path = "../../../../base/values_unittest.rs"]
                  mod values_unittest.rs;

                  R=john...@chromium.org, luk...@chromium.org

                  Bug: 1293979
                  Change-Id: I33c28a181340fbf75beb0a01dc851b268805a80e
                  Cq-Include-Trybots: luci.chromium.try:android-rust-arm-rel
                  Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3513336
                  Reviewed-by: John Chen <john...@chromium.org>
                  Reviewed-by: Łukasz Anforowicz <luk...@chromium.org>
                  Commit-Queue: danakj <dan...@chromium.org>
                  Cr-Commit-Position: refs/heads/main@{#979869}

                  ---
                  M base/BUILD.gn
                  M build/rust/mixed_target.gni
                  M build/rust/rust_target.gni
                  M testing/rust_gtest_interop/BUILD.gn
                  M testing/rust_gtest_interop/README.md
                  M testing/test.gni
                  6 files changed, 106 insertions(+), 26 deletions(-)


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

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