mappView build failed in Windows on ARM environment. (mappView 6.4 and later)

I’m share this post after hearing from someone a few days ago that errors occur when building mappView on MacBook Pros running Apple Silicon. I have been using this method without any error since mappView 6.4 was released.

Overview

In mapView 6.4 and later versions, node_x86.exe has been removed.
This seems to be an improvement in build performance with 64bit-based builds.

Impact

An error occurs as shown in the image below. (I translated the error into English and added it.)

Cause

This is the code of gurnt.cmd in the path below.
C:\Program Files(x86)\BRAutomation\AS6\AS\TechnologyPackages\mappView\6.6.0\IATC\jsBuild\node_modules\.bin\

IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
	REM running under 64-bit CMD.EXE on 64-bit Windows
    goto 64BIT
) ELSE (
    IF "%PROCESSOR_ARCHITECTURE%"=="x86" IF "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
		REM running under 32-bit CMD.EXE on 64-bit Windows...
        goto 64BIT
    ) ELSE (
		REM running under 32-bit CMD.EXE on 32-bit Windows...
        goto 32BIT
    )
)

	:64BIT
	   @rem OS is 64bit
	   @"%~dp0\node_x64.exe"  "%~dp0\..\grunt-cli\bin\grunt" %*
	   @goto END

	:32BIT
	   @rem OS is 32bit
	   @"%~dp0\node_x86.exe"  "%~dp0\..\grunt-cli\bin\grunt" %*
	   @goto END

	:END

As described in Overview, node_x86.exe has been deleted since mapView 6.4, so the file cannot be found, resulting in an error.

Solve

Add ARM architecture conditions to grunt.cmd to enable the execution of node_x64.exe.

IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    REM x64 Windows
    goto 64BIT
) ELSE IF "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
    REM ARM64 Windows (native)
    goto 64BIT
) ELSE (
    IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
        IF "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
            REM x86 CMD on x64 Windows
            goto 64BIT
        ) ELSE IF "%PROCESSOR_ARCHITEW6432%"=="ARM64" (
            REM x86 CMD on ARM64 Windows
            goto 64BIT
        ) ELSE (
            REM x86 Windows
            goto 32BIT
        )
    ) ELSE (
        goto 32BIT
    )
)

	:64BIT
	   @rem OS is 64bit
	   @"%~dp0\node_x64.exe"  "%~dp0\..\grunt-cli\bin\grunt" %*
	   @goto END

	:32BIT
	   @rem OS is 32bit
	   @"%~dp0\node_x86.exe"  "%~dp0\..\grunt-cli\bin\grunt" %*
	   @goto END

	:END

Compare two grunt.cmd code

Limit

B&R technology packages work independently for each version, you must modify the gurnt.cmd file for each mappView version folder. (Someone can do this automation using python or cmd, but I don’t cover it in this post.)

I have confirmed that this operates without issues in Windows on ARM laptops using Qualcomm processors and Apple Silicon with Parallels Desktop VM environments. But, this does not imply integrity in commercial usage environments.

2 Likes

Personally, I would like to see the x86 code inside grunt.cmd removed for future versions. Because now that node_x86.exe is gone, that code seems meaningless.(from the non-B&R application engineer’s perspective)

1 Like