Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-32142

Apple Silicon Support: Unable to Build Flink Project due to "Bad CPU Type" Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.15.0, 1.15.1, 1.16.0, 1.17.0, 1.15.2, 1.15.3, 1.16.1, 1.15.4, 1.16.2, 1.18.0, 1.17.1, 1.15.5, 1.16.3, 1.17.2
    • 1.20.0
    • Apple Silicon architecture (M2 Pro)

      macOS Ventura (Version 13.3.1)

    Description

      Attempting to build the Flink project on Apple Silicon architecture results in an error related to the execution of the frontend-maven-plugin.

      The error message indicates that the plugin fails to run "flink/flink-runtime-web/web-dashboard/node/node" program due to a "Bad CPU type in executable" error.

      [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.0:npm (npm install) on project flink-runtime-web: Failed to run task: 'npm ci --cache-max=0 --no-save ${npm.proxy}' failed. java.io.IOException: Cannot run program "flink/flink-runtime-web/web-dashboard/node/node" (in directory "flink/flink-runtime-web/web-dashboard"): error=86, Bad CPU type in executable

      Steps to Reproduce:

      1. Clone the Flink project repository. 
      2. Attempt to build the project on an Apple Silicon device.
      3. Observe the error message mentioned above.
      git clone https://github.com/apache/flink.git
      cd flink
      ./mvnw clean package -DskipTests
      

      Proposed Solution

      Upgrade frontend-maven-plugin from version 1.11.0 to the latest version, 1.12.1.

      frontend-maven-plugin version 1.11.0 downloads x64 binaries node-v16.13.2-darwin-x64.tar.gz instead of the arm64 binaries.

      Support for arm64 has been available for frontend-maven-plugin  since version 2. https://github.com/eirslett/frontend-maven-plugin/pull/970

      [DEBUG] Executing command line [/Users/elphas/src/flink/flink-runtime-web/web-dashboard/node/node, --version] [INFO] Installing node version v16.13.2 [DEBUG] Creating temporary directory /flink/flink-runtime-web/web-dashboard/node/tmp [INFO] Unpacking ~/.m2/repository/com/github/eirslett/node/16.13.2/node-16.13.2-darwin-x64.tar.gz into flink/flink-runtime-web/web-dashboard/node/tmp

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              elphastori Elphas Toringepi
              elphastori Elphas Toringepi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: