[S] Change in dart/sdk[main]: [dart2wasm] Include wasm-opt in the shipped dart-sdk.

0 views
Skip to first unread message

Jackson Gardner (Gerrit)

unread,
Feb 3, 2023, 4:38:54 PM2/3/23
to dart2wasm-t...@google.com, rev...@dartlang.org

Set Ready For Review

View Change

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

    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
    Gerrit-Change-Number: 280840
    Gerrit-PatchSet: 1
    Gerrit-Owner: Jackson Gardner <jackson...@google.com>
    Gerrit-Comment-Date: Fri, 03 Feb 2023 21:38:50 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Jackson Gardner (Gerrit)

    unread,
    Feb 3, 2023, 4:40:37 PM2/3/23
    to Aske Simon Christensen, Joshua Litt, dart2wasm-t...@google.com, rev...@dartlang.org

    Attention is currently required from: Aske Simon Christensen, Joshua Litt.

    Jackson Gardner would like Aske Simon Christensen and Joshua Litt to review this change.

    View Change

    [dart2wasm] Include wasm-opt in the shipped dart-sdk.

    Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
    ---
    M pkg/dart2wasm/tool/compile_benchmark
    M sdk/BUILD.gn
    2 files changed, 21 insertions(+), 1 deletion(-)

    diff --git a/pkg/dart2wasm/tool/compile_benchmark b/pkg/dart2wasm/tool/compile_benchmark
    index c3f213b..a88d093 100755
    --- a/pkg/dart2wasm/tool/compile_benchmark
    +++ b/pkg/dart2wasm/tool/compile_benchmark
    @@ -46,7 +46,7 @@
    fi

    "$DART2WASM" "$1" "$TEMPFILE" $COMPILE_FLAGS
    -"$BINARYEN" -all -g --closed-world -tnh -O3 --type-ssa --gufa -O3 --type-merging "$TEMPFILE" -o "$2"
    +"$BINARYEN" -all -g --closed-world -tnh -O3 --type-ssa --gufa --type-merging "$TEMPFILE" -o "$2"

    # Locate JS runtime and copy it to the same directory as "$2". We also rename it
    # using the basename of "$2".
    diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
    index 74dca42..159a977 100644
    --- a/sdk/BUILD.gn
    +++ b/sdk/BUILD.gn
    @@ -518,6 +518,16 @@
    [ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
    }

    +copy("copy_wasm_opt") {
    + visibility = [ ":create_full_sdk" ]
    + deps = [
    + ":copy_libraries",
    + "../third_party/binaryen:wasm-opt",
    + ]
    + sources = [ "$root_out_dir/wasm-opt${executable_suffix}" ]
    + outputs = [ "$root_out_dir/$dart_sdk_output/bin/utils/{{source_file_part}}" ]
    +}
    +
    # Copies DDC's SDK full and outline .dill files to lib/_internal.
    copy("copy_dev_compiler_dills") {
    visibility = [ ":copy_dev_compiler_sdk" ]
    @@ -755,6 +765,7 @@
    public_deps += [
    ":copy_dart2wasm_platform",
    ":copy_dart2wasm_snapshot",
    + ":copy_wasm_opt",
    ]
    }
    }

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

    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
    Gerrit-Change-Number: 280840
    Gerrit-PatchSet: 1
    Gerrit-Owner: Jackson Gardner <jackson...@google.com>
    Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
    Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
    Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
    Gerrit-Attention: Joshua Litt <joshu...@google.com>
    Gerrit-MessageType: newchange

    CBuild (Gerrit)

    unread,
    Feb 3, 2023, 5:10:15 PM2/3/23
    to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

    Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

    go/dart-cbuild result: SUCCESS

    Details: https://goto.google.com/dart-cbuild/find/69699fd18f7652a4ffe4bfcd5cc3b343654a86cf

    View Change

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

      Gerrit-Project: sdk
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
      Gerrit-Change-Number: 280840
      Gerrit-PatchSet: 1
      Gerrit-Owner: Jackson Gardner <jackson...@google.com>
      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
      Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
      Gerrit-Attention: Joshua Litt <joshu...@google.com>
      Gerrit-Attention: Jackson Gardner <jackson...@google.com>
      Gerrit-Comment-Date: Fri, 03 Feb 2023 22:10:09 +0000

      CBuild (Gerrit)

      unread,
      Feb 5, 2023, 1:54:08 PM2/5/23
      to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

      Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

      go/dart-cbuild result: SUCCESS

      Details: https://goto.google.com/dart-cbuild/find/fed4af629d4a7862816676153ba4859e98900ef8

      View Change

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

        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
        Gerrit-Change-Number: 280840
        Gerrit-PatchSet: 2
        Gerrit-Owner: Jackson Gardner <jackson...@google.com>
        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
        Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
        Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
        Gerrit-Attention: Joshua Litt <joshu...@google.com>
        Gerrit-Attention: Jackson Gardner <jackson...@google.com>
        Gerrit-Comment-Date: Sun, 05 Feb 2023 18:54:03 +0000

        CBuild (Gerrit)

        unread,
        Feb 5, 2023, 2:25:08 PM2/5/23
        to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

        Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

        go/dart-cbuild result: SUCCESS

        Details: https://goto.google.com/dart-cbuild/find/851607c6f95103ad77ad17397468d3c025a75f82

        View Change

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

          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
          Gerrit-Change-Number: 280840
          Gerrit-PatchSet: 4
          Gerrit-Owner: Jackson Gardner <jackson...@google.com>
          Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
          Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
          Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
          Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
          Gerrit-Attention: Joshua Litt <joshu...@google.com>
          Gerrit-Attention: Jackson Gardner <jackson...@google.com>
          Gerrit-Comment-Date: Sun, 05 Feb 2023 19:25:04 +0000

          CBuild (Gerrit)

          unread,
          Feb 5, 2023, 2:56:23 PM2/5/23
          to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

          Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

          go/dart-cbuild result: SUCCESS

          Details: https://goto.google.com/dart-cbuild/find/678e9841dd7519880c2ae5aa62c3fe085be1dee6

          View Change

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

            Gerrit-Project: sdk
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
            Gerrit-Change-Number: 280840
            Gerrit-PatchSet: 4
            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
            Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
            Gerrit-Attention: Joshua Litt <joshu...@google.com>
            Gerrit-Attention: Jackson Gardner <jackson...@google.com>
            Gerrit-Comment-Date: Sun, 05 Feb 2023 19:56:18 +0000

            Aske Simon Christensen (Gerrit)

            unread,
            Feb 6, 2023, 5:13:13 AM2/6/23
            to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, CBuild, Commit Queue, Joshua Litt

            Attention is currently required from: Jackson Gardner, Joshua Litt.

            View Change

            1 comment:

            • File pkg/dart2wasm/tool/compile_benchmark:

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

            Gerrit-Project: sdk
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
            Gerrit-Change-Number: 280840
            Gerrit-PatchSet: 4
            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
            Gerrit-Attention: Joshua Litt <joshu...@google.com>
            Gerrit-Attention: Jackson Gardner <jackson...@google.com>
            Gerrit-Comment-Date: Mon, 06 Feb 2023 10:13:08 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Gerrit-MessageType: comment

            Jackson Gardner (Gerrit)

            unread,
            Feb 6, 2023, 1:16:42 PM2/6/23
            to dart2wasm-t...@google.com, rev...@dartlang.org, CBuild, Commit Queue, Aske Simon Christensen, Joshua Litt

            Attention is currently required from: Aske Simon Christensen, Joshua Litt.

            View Change

            1 comment:

            • File pkg/dart2wasm/tool/compile_benchmark:

              • Ah, okay, I didn't think having the flag twice would actually run it twice. I'll revert this change.

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

            Gerrit-Project: sdk
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
            Gerrit-Change-Number: 280840
            Gerrit-PatchSet: 4
            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
            Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
            Gerrit-Attention: Joshua Litt <joshu...@google.com>
            Gerrit-Comment-Date: Mon, 06 Feb 2023 18:16:38 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Aske Simon Christensen <ask...@google.com>
            Gerrit-MessageType: comment

            CBuild (Gerrit)

            unread,
            Feb 6, 2023, 5:41:37 PM2/6/23
            to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

            Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

            go/dart-cbuild result: SUCCESS

            Details: https://goto.google.com/dart-cbuild/find/107e6084b459819c1beac8b2e11218783da8567c

            View Change

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

              Gerrit-Project: sdk
              Gerrit-Branch: main
              Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
              Gerrit-Change-Number: 280840
              Gerrit-PatchSet: 5
              Gerrit-Owner: Jackson Gardner <jackson...@google.com>
              Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
              Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
              Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
              Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
              Gerrit-Attention: Joshua Litt <joshu...@google.com>
              Gerrit-Attention: Jackson Gardner <jackson...@google.com>
              Gerrit-Comment-Date: Mon, 06 Feb 2023 22:41:32 +0000

              CBuild (Gerrit)

              unread,
              Feb 7, 2023, 1:03:13 PM2/7/23
              to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

              Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

              go/dart-cbuild result: SUCCESS

              Details: https://goto.google.com/dart-cbuild/find/9dbb3d54bc6b578ee3815131851ec3357a4f6628

              View Change

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

                Gerrit-Project: sdk
                Gerrit-Branch: main
                Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                Gerrit-Change-Number: 280840
                Gerrit-PatchSet: 6
                Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                Gerrit-Attention: Joshua Litt <joshu...@google.com>
                Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                Gerrit-Comment-Date: Tue, 07 Feb 2023 18:03:08 +0000

                CBuild (Gerrit)

                unread,
                Feb 7, 2023, 1:50:05 PM2/7/23
                to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

                Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

                go/dart-cbuild result: SUCCESS

                Details: https://goto.google.com/dart-cbuild/find/f1647efd976f3d35bc308f7dc05db9b1b8b433a3

                View Change

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

                  Gerrit-Project: sdk
                  Gerrit-Branch: main
                  Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                  Gerrit-Change-Number: 280840
                  Gerrit-PatchSet: 7
                  Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                  Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                  Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                  Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                  Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                  Gerrit-Attention: Joshua Litt <joshu...@google.com>
                  Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                  Gerrit-Comment-Date: Tue, 07 Feb 2023 18:49:59 +0000

                  CBuild (Gerrit)

                  unread,
                  Feb 7, 2023, 3:56:35 PM2/7/23
                  to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

                  Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

                  go/dart-cbuild result: SUCCESS

                  Details: https://goto.google.com/dart-cbuild/find/5bfbb8d17863547b7f4a9ae0690538864389fafb

                  View Change

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

                    Gerrit-Project: sdk
                    Gerrit-Branch: main
                    Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                    Gerrit-Change-Number: 280840
                    Gerrit-PatchSet: 8
                    Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                    Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                    Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                    Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                    Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                    Gerrit-Attention: Joshua Litt <joshu...@google.com>
                    Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                    Gerrit-Comment-Date: Tue, 07 Feb 2023 20:56:31 +0000

                    CBuild (Gerrit)

                    unread,
                    Feb 7, 2023, 4:59:53 PM2/7/23
                    to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Commit Queue, Aske Simon Christensen, Joshua Litt

                    Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Joshua Litt.

                    go/dart-cbuild result: SUCCESS

                    Details: https://goto.google.com/dart-cbuild/find/e6de989ef040d7393eb8baa15ea9963bb6136c87

                    View Change

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

                      Gerrit-Project: sdk
                      Gerrit-Branch: main
                      Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                      Gerrit-Change-Number: 280840
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Attention: Joshua Litt <joshu...@google.com>
                      Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                      Gerrit-Comment-Date: Tue, 07 Feb 2023 21:59:45 +0000

                      Joshua Litt (Gerrit)

                      unread,
                      Feb 7, 2023, 5:26:32 PM2/7/23
                      to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, CBuild, Commit Queue, Aske Simon Christensen

                      Attention is currently required from: Aske Simon Christensen, Jackson Gardner.

                      View Change

                      1 comment:

                      • Patchset:

                        • Patch Set #9:

                          This CL looks reasonable to me, but I really don't know enough about `build` to be able to provide reasonable feedback 😞.

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

                      Gerrit-Project: sdk
                      Gerrit-Branch: main
                      Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                      Gerrit-Change-Number: 280840
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                      Gerrit-Comment-Date: Tue, 07 Feb 2023 22:26:28 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      Gerrit-MessageType: comment

                      Nicholas Shahan (Gerrit)

                      unread,
                      Feb 7, 2023, 6:04:03 PM2/7/23
                      to dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Jackson Gardner, Aske Simon Christensen, Joshua Litt

                      Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Martin Kustermann.

                      Jackson Gardner has uploaded this change for review.

                      View Change

                      [dart2wasm] Include wasm-opt in the shipped dart-sdk.

                      Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                      ---
                      M build/config/compiler/BUILD.gn
                      M build/toolchain/win/tool_wrapper.py
                      M sdk/BUILD.gn
                      M third_party/binaryen/BUILD.gn
                      4 files changed, 56 insertions(+), 1 deletion(-)

                      diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
                      index feb13b1..be95a23 100644
                      --- a/build/config/compiler/BUILD.gn
                      +++ b/build/config/compiler/BUILD.gn
                      @@ -729,6 +729,15 @@
                      }
                      }

                      +config("enable_exceptions") {
                      + if (is_win) {
                      + cflags_cc = [ "/EHsc" ]
                      + defines = [ "_HAS_EXCEPTIONS=1" ]
                      + } else if (is_clang) {
                      + cflags_cc = [ "-fexceptions" ]
                      + }
                      +}
                      +
                      # Optimization -----------------------------------------------------------------
                      #
                      # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config"
                      diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py
                      index 652a879..3f52ee0 100644
                      --- a/build/toolchain/win/tool_wrapper.py
                      +++ b/build/toolchain/win/tool_wrapper.py
                      @@ -8,6 +8,7 @@
                      """

                      import os
                      +import pathlib
                      import re
                      import shutil
                      import subprocess
                      @@ -149,7 +150,28 @@
                      not line.startswith('Generating code') and
                      not line.startswith('Finished generating code')):
                      print(line)
                      - return link.wait()
                      + link_result = link.wait()
                      +
                      + if link_result != 0:
                      + return link_result
                      +
                      + # The toolchain configuration in gn always expects a .lib file to be
                      + # included in the output of the link step. However, this only happens
                      + # when the output has exports, and that is not always the case. In
                      + # order to satisfy the expected outputs, we create a dummy .lib file
                      + # in cases where the link step didn't actually create one.
                      + for arg in args:
                      + m = _LINK_EXE_OUT_ARG.match(arg)
                      + if m:
                      + output_filename = m.group('out')
                      + (basename, extension) = os.path.splitext(output_filename)
                      + if extension == '.exe':
                      + lib_path = pathlib.Path(basename + ".lib")
                      + if not os.path.exists(lib_path):
                      + lib_path.touch()
                      + break
                      +
                      + return link_result

                      def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl,
                      *flags):

                      diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
                      index 74dca42..159a977 100644
                      --- a/sdk/BUILD.gn
                      +++ b/sdk/BUILD.gn
                      @@ -518,6 +518,16 @@
                      [ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
                      }

                      +copy("copy_wasm_opt") {
                      + visibility = [ ":create_full_sdk" ]
                      + deps = [
                      + ":copy_libraries",
                      + "../third_party/binaryen:wasm-opt",
                      + ]
                      + sources = [ "$root_out_dir/wasm-opt${executable_suffix}" ]
                      + outputs = [ "$root_out_dir/$dart_sdk_output/bin/utils/{{source_file_part}}" ]
                      +}
                      +
                      # Copies DDC's SDK full and outline .dill files to lib/_internal.
                      copy("copy_dev_compiler_dills") {
                      visibility = [ ":copy_dev_compiler_sdk" ]
                      @@ -755,6 +765,7 @@
                      public_deps += [
                      ":copy_dart2wasm_platform",
                      ":copy_dart2wasm_snapshot",
                      + ":copy_wasm_opt",
                      ]
                      }
                      }
                      diff --git a/third_party/binaryen/BUILD.gn b/third_party/binaryen/BUILD.gn
                      index 139d9f8..f4ab1d3 100644
                      --- a/third_party/binaryen/BUILD.gn
                      +++ b/third_party/binaryen/BUILD.gn
                      @@ -59,6 +59,8 @@

                      # Ensure generated config.h file is include path.
                      include_dirs += [ "$target_gen_dir" ]
                      +
                      + configs += [ "//build/config/compiler:enable_exceptions" ]
                      }

                      template("wasm_tool") {
                      @@ -72,6 +74,8 @@
                      include_dirs = [ "src/src" ]
                      deps = [ ":binaryen_sources" ]
                      forward_variables_from(invoker, "*")
                      +
                      + configs += [ "//build/config/compiler:enable_exceptions" ]
                      }
                      }


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

                      Gerrit-Project: sdk
                      Gerrit-Branch: main
                      Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                      Gerrit-Change-Number: 280840
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                      Gerrit-CC: Martin Kustermann <kuste...@google.com>
                      Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                      Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                      Gerrit-MessageType: newchange

                      Nicholas Shahan (Gerrit)

                      unread,
                      Feb 7, 2023, 6:04:04 PM2/7/23
                      to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, CBuild, Commit Queue, Aske Simon Christensen, Joshua Litt

                      Attention is currently required from: Aske Simon Christensen, Jackson Gardner, Martin Kustermann.

                      View Change

                      1 comment:

                      • File sdk/BUILD.gn:

                        • Patch Set #9, Line 768: ":copy_wasm_opt",

                          Is this adding a new transitive dependency on ../third_party/binaryen:binaryen_sources?

                          @kuste...@google.com I just want to highlight this for you in case you think this could cause any difficulties.

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

                      Gerrit-Project: sdk
                      Gerrit-Branch: main
                      Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                      Gerrit-Change-Number: 280840
                      Gerrit-PatchSet: 9
                      Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                      Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                      Gerrit-CC: Martin Kustermann <kuste...@google.com>
                      Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                      Gerrit-Attention: Aske Simon Christensen <ask...@google.com>
                      Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                      Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                      Gerrit-Comment-Date: Tue, 07 Feb 2023 23:03:58 +0000

                      Aske Simon Christensen (Gerrit)

                      unread,
                      Feb 8, 2023, 4:37:28 AM2/8/23
                      to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                      Attention is currently required from: Jackson Gardner, Martin Kustermann.

                      Patch set 9:Code-Review +1

                      View Change

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

                        Gerrit-Project: sdk
                        Gerrit-Branch: main
                        Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                        Gerrit-Change-Number: 280840
                        Gerrit-PatchSet: 9
                        Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                        Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                        Gerrit-CC: Martin Kustermann <kuste...@google.com>
                        Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                        Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                        Gerrit-Comment-Date: Wed, 08 Feb 2023 09:37:21 +0000
                        Gerrit-HasComments: No
                        Gerrit-Has-Labels: Yes
                        Gerrit-MessageType: comment

                        Martin Kustermann (Gerrit)

                        unread,
                        Feb 8, 2023, 6:06:11 AM2/8/23
                        to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                        Attention is currently required from: Jackson Gardner, Nicholas Shahan.

                        View Change

                        2 comments:

                        • Commit Message:

                          • Patch Set #9, Line 7: [dart2wasm] Include wasm-opt in the shipped dart-sdk.

                            AFAIK we still do not offer a `dart compile wasm` command. As such adding wasm related things to our core Dart SDK will make it bigger without any benefit to users of Dart SDK - this is a bad smell.

                            As the CL is written now, it seems to add 128 MB:
                            ```
                            128M out/ReleaseX64/dart-sdk/bin/utils/wasm-opt
                            ```

                            At least we should strip the binary. You can see how this is done for the `dart-sdk/bin/dart` binary and do something similar here.

                            Given that stripped `wasm-opt` binary is 5.5 MB
                            ```
                            5.5M out/ReleaseX64/exe.stripped/wasm-opt
                            ```
                            it may be ok to add it to our Dart SDK even if it's not used.

                        • File sdk/BUILD.gn:

                          • Is this adding a new transitive dependency on ../third_party/binaryen:binaryen_sources? […]

                            No issue regarding correct re-building of binaryen if files change (the topic we discussed offline before), but thank you for CC'ing me, Nicolas!

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

                        Gerrit-Project: sdk
                        Gerrit-Branch: main
                        Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                        Gerrit-Change-Number: 280840
                        Gerrit-PatchSet: 9
                        Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                        Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                        Gerrit-CC: Martin Kustermann <kuste...@google.com>
                        Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                        Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                        Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                        Gerrit-Comment-Date: Wed, 08 Feb 2023 11:06:05 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Nicholas Shahan <nsh...@google.com>
                        Gerrit-MessageType: comment

                        Jackson Gardner (Gerrit)

                        unread,
                        Feb 8, 2023, 12:12:26 PM2/8/23
                        to dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Martin Kustermann, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                        Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                        View Change

                        1 comment:

                        • Commit Message:

                          • AFAIK we still do not offer a `dart compile wasm` command. […]

                            For a bit of context, `dart compile wasm` is not too far off from being a reality, and that will use the `wasm-opt` executable, so including this in the dart sdk is an inevitability. For now, the idea is to invoke `wasm-opt` ad-hoc in the flutter tool when doing `flutter build web --wasm`, which is still experimental but we'd like to start using with some high-level benchmarks soon. It's best if we consume `wasm-opt` from the dart-sdk because (a) that is eventually what will be used anyway and (b) support for WasmGC instructions is still in flux right now with binaryen, so we often need to be pinned to a very specific version that matches what `dart2wasm` emits.

                            I will definitely take a look at stripping the binary though, good catch.

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

                        Gerrit-Project: sdk
                        Gerrit-Branch: main
                        Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                        Gerrit-Change-Number: 280840
                        Gerrit-PatchSet: 9
                        Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                        Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                        Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                        Gerrit-CC: Martin Kustermann <kuste...@google.com>
                        Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                        Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                        Gerrit-Comment-Date: Wed, 08 Feb 2023 17:12:21 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
                        Gerrit-MessageType: comment

                        Jackson Gardner (Gerrit)

                        unread,
                        Feb 8, 2023, 12:34:07 PM2/8/23
                        to dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Martin Kustermann, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                        Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                        Patch set 10:Commit-Queue +2

                        View Change

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

                          Gerrit-Project: sdk
                          Gerrit-Branch: main
                          Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                          Gerrit-Change-Number: 280840
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                          Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                          Gerrit-CC: Martin Kustermann <kuste...@google.com>
                          Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                          Gerrit-Comment-Date: Wed, 08 Feb 2023 17:34:03 +0000

                          Jackson Gardner (Gerrit)

                          unread,
                          Feb 8, 2023, 12:34:44 PM2/8/23
                          to dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Martin Kustermann, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                          Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                          Patch set 10:-Commit-Queue

                          View Change

                          1 comment:

                          • Commit Message:

                            • For a bit of context, `dart compile wasm` is not too far off from being a reality, and that will use […]

                              I went ahead and

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

                          Gerrit-Project: sdk
                          Gerrit-Branch: main
                          Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                          Gerrit-Change-Number: 280840
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                          Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                          Gerrit-CC: Martin Kustermann <kuste...@google.com>
                          Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                          Gerrit-Comment-Date: Wed, 08 Feb 2023 17:34:39 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: Yes
                          Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
                          Comment-In-Reply-To: Jackson Gardner <jackson...@google.com>
                          Gerrit-MessageType: comment

                          Jackson Gardner (Gerrit)

                          unread,
                          Feb 8, 2023, 12:36:05 PM2/8/23
                          to dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Martin Kustermann, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                          Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                          View Change

                          1 comment:

                          • Commit Message:

                            • I went ahead and

                              Whoops, I didn't meant to submit this immediately. I'm doing a dry run on CQ right now to make sure everything is fine, but the newest patch copies over the stripped `wasm-opt` binary instead of the one with symbols. Let me know if that's sufficient, I'd like to get your sign-off before actually merging.

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

                          Gerrit-Project: sdk
                          Gerrit-Branch: main
                          Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                          Gerrit-Change-Number: 280840
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                          Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                          Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                          Gerrit-CC: Martin Kustermann <kuste...@google.com>
                          Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                          Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                          Gerrit-Comment-Date: Wed, 08 Feb 2023 17:36:01 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No

                          CBuild (Gerrit)

                          unread,
                          Feb 8, 2023, 1:10:28 PM2/8/23
                          to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Martin Kustermann, Nicholas Shahan, Commit Queue, Joshua Litt

                          Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                          go/dart-cbuild result: SUCCESS

                          Details: https://goto.google.com/dart-cbuild/find/6302315b02c6c3fde94ed8b5cf8105eccf8ea7c3

                          View Change

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

                            Gerrit-Project: sdk
                            Gerrit-Branch: main
                            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                            Gerrit-Change-Number: 280840
                            Gerrit-PatchSet: 10
                            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                            Gerrit-CC: Martin Kustermann <kuste...@google.com>
                            Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                            Gerrit-Comment-Date: Wed, 08 Feb 2023 18:10:24 +0000

                            Martin Kustermann (Gerrit)

                            unread,
                            Feb 8, 2023, 1:20:02 PM2/8/23
                            to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Aske Simon Christensen, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                            Attention is currently required from: Jackson Gardner, Nicholas Shahan.

                            Patch set 10:Code-Review +1

                            View Change

                            2 comments:

                            • File third_party/binaryen/BUILD.gn:

                              • Patch Set #10, Line 63: configs += [ "//build/config/compiler:enable_exceptions" ]

                                Out of curiosity: Why is this needed now (it seemed to have built `wasm-opt` without as well)?

                            • File tools/gn.py:

                              • Patch Set #10, Line 303: gn_args['wasm_opt_stripped_binary'] = 'exe.stripped/wasm-opt'

                                I was wondering whether `flutter/tools/gn` will need the same logic (as it is responsible for setting up Flutter Engine build, which also builds Dart SDK). Though it seems the engine build will strip by default and separates out the unstripped versions to `exe.unstripped/*`. So I guess it doesn't require any changes to engine.

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

                            Gerrit-Project: sdk
                            Gerrit-Branch: main
                            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                            Gerrit-Change-Number: 280840
                            Gerrit-PatchSet: 10
                            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                            Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
                            Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Jackson Gardner <jackson...@google.com>
                            Gerrit-Comment-Date: Wed, 08 Feb 2023 18:19:57 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: Yes
                            Gerrit-MessageType: comment

                            Jackson Gardner (Gerrit)

                            unread,
                            Feb 8, 2023, 1:51:26 PM2/8/23
                            to dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Aske Simon Christensen, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                            Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                            View Change

                            2 comments:

                            • File third_party/binaryen/BUILD.gn:

                              • Patch Set #10, Line 63: configs += [ "//build/config/compiler:enable_exceptions" ]

                                Out of curiosity: Why is this needed now (it seemed to have built `wasm-opt` without as well)?

                              • It's for the Windows side. Exceptions are disabled by default with the Windows toolchain, so you have to add a few flags to turn them on (binaryen uses c++ exceptions). It works without the config on Linux and macOS since exceptions are on by default.

                            • File tools/gn.py:

                              • I was wondering whether `flutter/tools/gn` will need the same logic (as it is responsible for settin […]

                                I'll double check to make sure this doesn't break the engine's dart-sdk build.

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

                            Gerrit-Project: sdk
                            Gerrit-Branch: main
                            Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                            Gerrit-Change-Number: 280840
                            Gerrit-PatchSet: 10
                            Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                            Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                            Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                            Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
                            Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                            Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                            Gerrit-Comment-Date: Wed, 08 Feb 2023 18:51:22 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
                            Gerrit-MessageType: comment

                            Jackson Gardner (Gerrit)

                            unread,
                            Feb 8, 2023, 1:51:44 PM2/8/23
                            to dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Aske Simon Christensen, Nicholas Shahan, CBuild, Commit Queue, Joshua Litt

                            Attention is currently required from: Martin Kustermann, Nicholas Shahan.

                            Patch set 10:Commit-Queue +2

                            View Change

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

                              Gerrit-Project: sdk
                              Gerrit-Branch: main
                              Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                              Gerrit-Change-Number: 280840
                              Gerrit-PatchSet: 10
                              Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                              Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                              Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
                              Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                              Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
                              Gerrit-Attention: Martin Kustermann <kuste...@google.com>
                              Gerrit-Comment-Date: Wed, 08 Feb 2023 18:51:40 +0000

                              Commit Queue (Gerrit)

                              unread,
                              Feb 8, 2023, 1:51:54 PM2/8/23
                              to Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Aske Simon Christensen, Nicholas Shahan, CBuild, Joshua Litt

                              Commit Queue submitted this change.

                              View Change

                              Approvals: Aske Simon Christensen: Looks good to me, approved Martin Kustermann: Looks good to me, approved Jackson Gardner: Commit
                              [dart2wasm] Include wasm-opt in the shipped dart-sdk.

                              Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                              Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
                              Reviewed-by: Martin Kustermann <kuste...@google.com>
                              Commit-Queue: Jackson Gardner <jackson...@google.com>
                              Reviewed-by: Aske Simon Christensen <ask...@google.com>

                              ---
                              M build/config/compiler/BUILD.gn
                              M build/toolchain/win/tool_wrapper.py
                              M sdk/BUILD.gn
                              M third_party/binaryen/BUILD.gn
                              M tools/gn.py
                              5 files changed, 62 insertions(+), 1 deletion(-)

                              index 74dca42..cf77b0c 100644
                              --- a/sdk/BUILD.gn
                              +++ b/sdk/BUILD.gn
                              @@ -27,6 +27,7 @@
                              dart_precompiled_runtime_stripped_binary = "dart_precompiled_runtime_product"
                              gen_snapshot_stripped_binary = "gen_snapshot_product"
                              analyze_snapshot_binary = "analyze_snapshot"
                              + wasm_opt_stripped_binary = "wasm-opt"
                              }

                              # The directory layout of the SDK is as follows:
                              @@ -518,6 +519,16 @@

                              [ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
                              }

                              +copy("copy_wasm_opt") {
                              + visibility = [ ":create_full_sdk" ]
                              + deps = [
                              + ":copy_libraries",
                              + "../third_party/binaryen:wasm-opt",
                              + ]
                              +  sources = [ "$root_out_dir/${wasm_opt_stripped_binary}${executable_suffix}" ]

                              + outputs = [ "$root_out_dir/$dart_sdk_output/bin/utils/{{source_file_part}}" ]
                              +}
                              +
                              # Copies DDC's SDK full and outline .dill files to lib/_internal.
                              copy("copy_dev_compiler_dills") {
                              visibility = [ ":copy_dev_compiler_sdk" ]
                              @@ -755,6 +766,7 @@

                              public_deps += [
                              ":copy_dart2wasm_platform",
                              ":copy_dart2wasm_snapshot",
                              + ":copy_wasm_opt",
                              ]
                              }
                              }
                              diff --git a/third_party/binaryen/BUILD.gn b/third_party/binaryen/BUILD.gn
                              index 139d9f8..f4ab1d3 100644
                              --- a/third_party/binaryen/BUILD.gn
                              +++ b/third_party/binaryen/BUILD.gn
                              @@ -59,6 +59,8 @@

                              # Ensure generated config.h file is include path.
                              include_dirs += [ "$target_gen_dir" ]
                              +
                              + configs += [ "//build/config/compiler:enable_exceptions" ]
                              }

                              template("wasm_tool") {
                              @@ -72,6 +74,8 @@
                              include_dirs = [ "src/src" ]
                              deps = [ ":binaryen_sources" ]
                              forward_variables_from(invoker, "*")
                              +
                              + configs += [ "//build/config/compiler:enable_exceptions" ]
                              }
                              }

                              diff --git a/tools/gn.py b/tools/gn.py
                              index be46581..c8bac2f 100755
                              --- a/tools/gn.py
                              +++ b/tools/gn.py
                              @@ -300,6 +300,7 @@
                              gn_args['gen_snapshot_stripped_binary'] = (
                              'exe.stripped/gen_snapshot_product')
                              gn_args['analyze_snapshot_binary'] = ('exe.stripped/analyze_snapshot')
                              + gn_args['wasm_opt_stripped_binary'] = 'exe.stripped/wasm-opt'

                              # Setup the user-defined sysroot.
                              if UseSysroot(args, gn_args):

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

                              Gerrit-Project: sdk
                              Gerrit-Branch: main
                              Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                              Gerrit-Change-Number: 280840
                              Gerrit-PatchSet: 11
                              Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                              Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                              Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
                              Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                              Gerrit-MessageType: merged

                              William Hesse (Gerrit)

                              unread,
                              Feb 8, 2023, 2:22:18 PM2/8/23
                              to Commit Queue, Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Aske Simon Christensen, Nicholas Shahan, CBuild, Joshua Litt, William Hesse

                              William Hesse has created a revert of this change.

                              View Change

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

                              Gerrit-Project: sdk
                              Gerrit-Branch: main
                              Gerrit-Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
                              Gerrit-Change-Number: 280840
                              Gerrit-PatchSet: 11
                              Gerrit-Owner: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Aske Simon Christensen <ask...@google.com>
                              Gerrit-Reviewer: Jackson Gardner <jackson...@google.com>
                              Gerrit-Reviewer: Joshua Litt <joshu...@google.com>
                              Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
                              Gerrit-CC: Nicholas Shahan <nsh...@google.com>
                              Gerrit-MessageType: revert

                              CBuild (Gerrit)

                              unread,
                              Feb 8, 2023, 2:28:54 PM2/8/23
                              to Commit Queue, Jackson Gardner, dart2wasm-t...@google.com, rev...@dartlang.org, Martin Kustermann, Aske Simon Christensen, Nicholas Shahan, Joshua Litt

                              go/dart-cbuild result: SUCCESS

                              Details: https://goto.google.com/dart-cbuild/find/6271d26baf498ab2b053c52527bc65f7f43e802b

                              Gerrit-Comment-Date: Wed, 08 Feb 2023 19:28:51 +0000
                              Reply all
                              Reply to author
                              Forward
                              0 new messages