diff --git a/gradlew.bat b/gradlew.bat index e509b2dd..c4bdd3ab 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,93 +1,93 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/server/README.md b/server/README.md index 27338a95..4d1852b0 100644 --- a/server/README.md +++ b/server/README.md @@ -155,7 +155,7 @@ no-ops in CI, so they do not change what CI runs. (their toolchains are x86_64-only), so they always run emulated. * `-PtargetPlatforms=` — build only these targets, and boot only the builders they need. - Values: `x86_64-linux`, `armv7-android`, `arm64-android`, `js-web`, `wasm-web`, `x86_64-win32`. + Values: `x86_64-linux`, `armv7-android`, `arm64-android`, `x86_64-android`, `js-web`, `wasm-web`, `x86_64-win32`. * `-PdefoldVersions=` — which Defold SDK versions to test. `latest`, `ci` (first + last, what CI uses), `all`, or a comma list like `1.12.3,1.11.1`. * `-PreuseStack=true` — leave the docker stack running after the tests and reuse it next time. The diff --git a/server/docker/Dockerfile.android.ndk25-env b/server/docker/Dockerfile.android.ndk25-env index 58d7021b..4e7cb681 100644 --- a/server/docker/Dockerfile.android.ndk25-env +++ b/server/docker/Dockerfile.android.ndk25-env @@ -50,10 +50,7 @@ RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ rm -rf "${ANDROID_NDK25_PATH}/sources/third_party" && \ rm -rf "${ANDROID_NDK25_PATH}/sources/cxx-stl" && \ rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android" && \ - rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android" && \ rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-*" && \ - rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-*" && \ - rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android" && \ rm -rf "${ANDROID_NDK25_PATH}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android" && \ # create the .android folder and give read+write permissions (the Android Gradle plugin will write to the folder) # It is not enough to give 'user' and 'group'. We unfortunately also need 'others' @@ -66,6 +63,7 @@ RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ # check that dx installed properly which "${ANDROID_NDK25_BIN_PATH}/armv7a-linux-androideabi${ANDROID_NDK25_API_VERSION}-clang++" && \ which "${ANDROID_NDK25_BIN_PATH}/aarch64-linux-android${ANDROID_64_NDK25_API_VERSION}-clang++" && \ + which "${ANDROID_NDK25_BIN_PATH}/x86_64-linux-android${ANDROID_64_NDK25_API_VERSION}-clang++" && \ # check that aapt installed correctly "${ANDROID_SDK_BUILD_TOOLS_PATH_34}/aapt2" version && \ # download and install R8 utility separatly. It's done in that way because diff --git a/server/docker/Dockerfile.android.ndk25_sdk36-env b/server/docker/Dockerfile.android.ndk25_sdk36-env index 876ad7d1..4e5b40a9 100644 --- a/server/docker/Dockerfile.android.ndk25_sdk36-env +++ b/server/docker/Dockerfile.android.ndk25_sdk36-env @@ -43,10 +43,7 @@ RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ rm -rf "${ANDROID_NDK_PATH}/sources/third_party" && \ rm -rf "${ANDROID_NDK_PATH}/sources/cxx-stl" && \ rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android" && \ - rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android" && \ rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-*" && \ - rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-*" && \ - rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android" && \ rm -rf "${ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android" && \ # create the .android folder and give read+write permissions (the Android Gradle plugin will write to the folder) # It is not enough to give 'user' and 'group'. We unfortunately also need 'others' @@ -58,6 +55,7 @@ RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ chmod -R 755 "${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}" && \ which "${ANDROID_NDK_BIN_PATH}/armv7a-linux-androideabi${ANDROID_NDK_API_VERSION}-clang++" && \ which "${ANDROID_NDK_BIN_PATH}/aarch64-linux-android${ANDROID_64_NDK_API_VERSION}-clang++" && \ + which "${ANDROID_NDK_BIN_PATH}/x86_64-linux-android${ANDROID_64_NDK_API_VERSION}-clang++" && \ # check that aapt installed correctly "${ANDROID_SDK_BUILD_TOOLS_PATH}/aapt2" version && \ # download and install R8 utility separatly. It's done in that way because diff --git a/server/docker/Dockerfile.winsdk.2022-env b/server/docker/Dockerfile.winsdk.2022-env index 8c8b5cba..b8beb020 100644 --- a/server/docker/Dockerfile.winsdk.2022-env +++ b/server/docker/Dockerfile.winsdk.2022-env @@ -1,91 +1,91 @@ -FROM europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-wine-env:1.5.0 - -ENV PLATFORMSDK_WIN32=$PLATFORMSDK_DIR/Win32 - -ENV \ - WINDOWS_SDK_10_DIR=${PLATFORMSDK_WIN32}/WindowsKits/10 \ - WINDOWS_SDK_10_20348_VERSION=10.0.20348.0 \ - WINDOWS_MSVC_2022_VERSION=14.37.32822 - -ENV \ - VCINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC" \ - VSINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" \ - WINDOWS_MSVC_DIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC/Tools/MSVC/${WINDOWS_MSVC_2022_VERSION}" \ - VS160COMNTOOLS_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/Common7/Tools" \ - WINDOWS_VCINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC/Tools/MSVC/${WINDOWS_MSVC_2022_VERSION}" \ - WINDOWS_VSINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# windres: Allows for generating .res files that can be used during linking -RUN \ - apt-get update && \ - apt-get install -y --no-install-recommends binutils-mingw-w64-x86-64 && \ - ls -la /usr/bin/x86_64-w64-mingw32-windres && \ - ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/local/bin/windres && \ - rm -rf /var/lib/apt/lists/* - -COPY winsdk_rename_files.py ${PLATFORMSDK_WIN32} - -RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ - mkdir -p "${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" && \ - wget -q -O - "$(cat /run/secrets/DM_PACKAGES_URL)/Microsoft-Visual-Studio-2022-${WINDOWS_MSVC_2022_VERSION}.tar.gz" | tar xz -C "${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" && \ - mkdir -p "${PLATFORMSDK_WIN32}/WindowsKits" && \ - wget -q -O - "$(cat /run/secrets/DM_PACKAGES_URL)/WindowsKits-${WINDOWS_SDK_10_20348_VERSION}.tar.gz" | tar xz -C "${PLATFORMSDK_WIN32}/WindowsKits" && \ - ln -s "$(which clang)" "$(dirname "$(which clang)")/x86_64-pc-win32-clang" && \ - ln -s "$(which llvm-ar)" "$(dirname "$(which llvm-ar)")/x86_64-pc-win32-clang-ar" && \ -# Due to Windows' case insensitive file system, the sources reference lib files with wrong cases -# so we solve the bulk by making the suffixes lowercase. (e.g. MyLib.Lib -> MyLib.lib) - find $PLATFORMSDK_WIN32 -iname '*.Lib' -type f -exec sh -c 'a=$(echo "$0" | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "$0" ] && [ ! -f "$a" ] && ln -s "$0" "$a" ' {} \; - -RUN \ - python ${PLATFORMSDK_WIN32}/winsdk_rename_files.py > ${PLATFORMSDK_WIN32}/rename.txt && \ -# Make a copy of all the headers too, in lower case (e.g. Windows.h -> windows.h etc) - find $PLATFORMSDK_WIN32 -iname '*.h' -type f -exec sh -c 'd=$(dirname "$0"); a=$(basename "$0" | tr [:upper:] [:lower:]); [ "$a" != $(basename "$0") ] && [ ! -f "$d/$a" ] && ln -s "$0" "$d/$a" ' {} \; && \ -# Make lower case links of libraries as well - find ${WINDOWS_SDK_10_DIR}/Lib -iname '*.lib' -type f -exec sh -c 'd=$(dirname "$0"); a=$(basename "$0" | tr [:upper:] [:lower:]); [ "$a" != $(basename "$0") ] && [ ! -f "$d/$a" ] && ln -s "$0" "$d/$a" ' {} \; - -WORKDIR "${WINDOWS_MSVC_DIR_2022}/lib/x64" -RUN \ -# and the rest are manually copied (or made lower case) - cp oldnames.lib OLDNAMES.lib && \ - cp libcmt.lib LIBCMT.lib && \ - cp delayimp.lib Delayimp.lib - -WORKDIR "${WINDOWS_MSVC_DIR_2022}/lib/x86" -RUN \ -# and the rest are manually copied (or made lower case) - cp oldnames.lib OLDNAMES.lib && \ - cp libcmt.lib LIBCMT.lib && \ - cp delayimp.lib Delayimp.lib - -# Some headers are named by the wrong name in the windows sdk's... -# We need to make certain names lowercase because some users -# have put "pragma lib" comments in some libraries :( -# and/or misspelled header files -WORKDIR "${WINDOWS_SDK_10_DIR}/Include/${WINDOWS_SDK_10_20348_VERSION}/shared" -RUN \ - cp driverspecs.h DriverSpecs.h && \ - cp specstrings.h SpecStrings.h && \ - cp concurrencysal.h ConcurrencySal.h && \ - cp wlantypes.h WlanTypes.h - -WORKDIR "${WINDOWS_SDK_10_DIR}/Lib/${WINDOWS_SDK_10_20348_VERSION}/um/x64" -RUN cp psapi.lib Psapi.lib -WORKDIR "${WINDOWS_SDK_10_DIR}/Lib/${WINDOWS_SDK_10_20348_VERSION}/um/x86" -RUN cp psapi.lib Psapi.lib - -# Also, the OpenGL headers in the windows SDK is in a folder with lower case letters, which doesn't match the includes -WORKDIR "${WINDOWS_SDK_10_DIR}/Include/${WINDOWS_SDK_10_20348_VERSION}/um" -RUN \ - mkdir ./GL && \ - cp -v ./gl/*.* ./GL/ - -WORKDIR / - -# Since dotnet cannot really cross compile, we need to create a "lib" shim for "wine lib.exe" -# As long as it's in the path, it will be picked up -# hadolint ignore=SC2016 -RUN \ - echo '#!/usr/bin/env bash' > /usr/bin/lib && \ - echo 'wine ${WINDOWS_VCINSTALLDIR_2022}/bin/Hostx64/x64/lib.exe $*' >> /usr/bin/lib && \ +FROM europe-west1-docker.pkg.dev/extender-426409/extender-public-registry/extender-wine-env:1.5.0 + +ENV PLATFORMSDK_WIN32=$PLATFORMSDK_DIR/Win32 + +ENV \ + WINDOWS_SDK_10_DIR=${PLATFORMSDK_WIN32}/WindowsKits/10 \ + WINDOWS_SDK_10_20348_VERSION=10.0.20348.0 \ + WINDOWS_MSVC_2022_VERSION=14.37.32822 + +ENV \ + VCINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC" \ + VSINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" \ + WINDOWS_MSVC_DIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC/Tools/MSVC/${WINDOWS_MSVC_2022_VERSION}" \ + VS160COMNTOOLS_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/Common7/Tools" \ + WINDOWS_VCINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022/VC/Tools/MSVC/${WINDOWS_MSVC_2022_VERSION}" \ + WINDOWS_VSINSTALLDIR_2022="${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# windres: Allows for generating .res files that can be used during linking +RUN \ + apt-get update && \ + apt-get install -y --no-install-recommends binutils-mingw-w64-x86-64 && \ + ls -la /usr/bin/x86_64-w64-mingw32-windres && \ + ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/local/bin/windres && \ + rm -rf /var/lib/apt/lists/* + +COPY winsdk_rename_files.py ${PLATFORMSDK_WIN32} + +RUN --mount=type=secret,id=DM_PACKAGES_URL,required=true \ + mkdir -p "${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" && \ + wget -q -O - "$(cat /run/secrets/DM_PACKAGES_URL)/Microsoft-Visual-Studio-2022-${WINDOWS_MSVC_2022_VERSION}.tar.gz" | tar xz -C "${PLATFORMSDK_WIN32}/MicrosoftVisualStudio2022" && \ + mkdir -p "${PLATFORMSDK_WIN32}/WindowsKits" && \ + wget -q -O - "$(cat /run/secrets/DM_PACKAGES_URL)/WindowsKits-${WINDOWS_SDK_10_20348_VERSION}.tar.gz" | tar xz -C "${PLATFORMSDK_WIN32}/WindowsKits" && \ + ln -s "$(which clang)" "$(dirname "$(which clang)")/x86_64-pc-win32-clang" && \ + ln -s "$(which llvm-ar)" "$(dirname "$(which llvm-ar)")/x86_64-pc-win32-clang-ar" && \ +# Due to Windows' case insensitive file system, the sources reference lib files with wrong cases +# so we solve the bulk by making the suffixes lowercase. (e.g. MyLib.Lib -> MyLib.lib) + find $PLATFORMSDK_WIN32 -iname '*.Lib' -type f -exec sh -c 'a=$(echo "$0" | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "$0" ] && [ ! -f "$a" ] && ln -s "$0" "$a" ' {} \; + +RUN \ + python ${PLATFORMSDK_WIN32}/winsdk_rename_files.py > ${PLATFORMSDK_WIN32}/rename.txt && \ +# Make a copy of all the headers too, in lower case (e.g. Windows.h -> windows.h etc) + find $PLATFORMSDK_WIN32 -iname '*.h' -type f -exec sh -c 'd=$(dirname "$0"); a=$(basename "$0" | tr [:upper:] [:lower:]); [ "$a" != $(basename "$0") ] && [ ! -f "$d/$a" ] && ln -s "$0" "$d/$a" ' {} \; && \ +# Make lower case links of libraries as well + find ${WINDOWS_SDK_10_DIR}/Lib -iname '*.lib' -type f -exec sh -c 'd=$(dirname "$0"); a=$(basename "$0" | tr [:upper:] [:lower:]); [ "$a" != $(basename "$0") ] && [ ! -f "$d/$a" ] && ln -s "$0" "$d/$a" ' {} \; + +WORKDIR "${WINDOWS_MSVC_DIR_2022}/lib/x64" +RUN \ +# and the rest are manually copied (or made lower case) + cp oldnames.lib OLDNAMES.lib && \ + cp libcmt.lib LIBCMT.lib && \ + cp delayimp.lib Delayimp.lib + +WORKDIR "${WINDOWS_MSVC_DIR_2022}/lib/x86" +RUN \ +# and the rest are manually copied (or made lower case) + cp oldnames.lib OLDNAMES.lib && \ + cp libcmt.lib LIBCMT.lib && \ + cp delayimp.lib Delayimp.lib + +# Some headers are named by the wrong name in the windows sdk's... +# We need to make certain names lowercase because some users +# have put "pragma lib" comments in some libraries :( +# and/or misspelled header files +WORKDIR "${WINDOWS_SDK_10_DIR}/Include/${WINDOWS_SDK_10_20348_VERSION}/shared" +RUN \ + cp driverspecs.h DriverSpecs.h && \ + cp specstrings.h SpecStrings.h && \ + cp concurrencysal.h ConcurrencySal.h && \ + cp wlantypes.h WlanTypes.h + +WORKDIR "${WINDOWS_SDK_10_DIR}/Lib/${WINDOWS_SDK_10_20348_VERSION}/um/x64" +RUN cp psapi.lib Psapi.lib +WORKDIR "${WINDOWS_SDK_10_DIR}/Lib/${WINDOWS_SDK_10_20348_VERSION}/um/x86" +RUN cp psapi.lib Psapi.lib + +# Also, the OpenGL headers in the windows SDK is in a folder with lower case letters, which doesn't match the includes +WORKDIR "${WINDOWS_SDK_10_DIR}/Include/${WINDOWS_SDK_10_20348_VERSION}/um" +RUN \ + mkdir ./GL && \ + cp -v ./gl/*.* ./GL/ + +WORKDIR / + +# Since dotnet cannot really cross compile, we need to create a "lib" shim for "wine lib.exe" +# As long as it's in the path, it will be picked up +# hadolint ignore=SC2016 +RUN \ + echo '#!/usr/bin/env bash' > /usr/bin/lib && \ + echo 'wine ${WINDOWS_VCINSTALLDIR_2022}/bin/Hostx64/x64/lib.exe $*' >> /usr/bin/lib && \ chmod +x /usr/bin/lib \ No newline at end of file diff --git a/server/docker/docker-compose.yml b/server/docker/docker-compose.yml index 1a21c868..e324813d 100644 --- a/server/docker/docker-compose.yml +++ b/server/docker/docker-compose.yml @@ -210,7 +210,7 @@ services: # run boot only the builders it needs: IntegrationTest derives them from -PtargetPlatforms. # They are purely additive - "test" still selects all of these services. # test-linux -> x86_64-linux -# test-android -> armv7-android, arm64-android +# test-android -> armv7-android, arm64-android, x86_64-android # test-web -> js-web, wasm-web # test-windows -> x86_64-win32 # Both android builders, and all three winsdk builders, stay grouped together: which one diff --git a/server/src/main/java/com/defold/extender/Extender.java b/server/src/main/java/com/defold/extender/Extender.java index 0c54e198..9c822b2c 100644 --- a/server/src/main/java/com/defold/extender/Extender.java +++ b/server/src/main/java/com/defold/extender/Extender.java @@ -98,7 +98,7 @@ class Extender { private final String[] ALLOWED_MANIFEST_PLATFORMS = new String[] { "common", "ios", "armv7-ios","arm64-ios","x86_64-ios", - "android", "armv7-android","arm64-android", + "android", "armv7-android","arm64-android","x86_64-android", "osx", "x86-osx", "x86_64-osx","arm64-osx", "linux", "x86-linux", "x86_64-linux", "arm64-linux", "win32", "x86-win32", "x86_64-win32", diff --git a/server/src/main/java/com/defold/extender/ExtenderUtil.java b/server/src/main/java/com/defold/extender/ExtenderUtil.java index a5ec2f72..9c0ff7a1 100644 --- a/server/src/main/java/com/defold/extender/ExtenderUtil.java +++ b/server/src/main/java/com/defold/extender/ExtenderUtil.java @@ -854,7 +854,8 @@ public static boolean isIOSTarget(String platform) { public static boolean isAndroidTarget(String platform) { return platform.equals("arm64-android") || - platform.equals("armv7-android"); + platform.equals("armv7-android") || + platform.equals("x86_64-android"); } public static boolean isWebTarget(String platform) { diff --git a/server/src/main/java/com/defold/extender/WebSecurityConfig.java b/server/src/main/java/com/defold/extender/WebSecurityConfig.java index a31d5aef..bab7a411 100644 --- a/server/src/main/java/com/defold/extender/WebSecurityConfig.java +++ b/server/src/main/java/com/defold/extender/WebSecurityConfig.java @@ -26,6 +26,7 @@ SecurityFilterChain filterChain(HttpSecurity http) throws Exception { case "android": http.authorizeHttpRequests((authorizeHttpRequest) -> authorizeHttpRequest.requestMatchers("/build_async/armv7-android/**").hasRole("ANDROID")).httpBasic(withDefaults()); http.authorizeHttpRequests((authorizeHttpRequest) -> authorizeHttpRequest.requestMatchers("/build_async/arm64-android/**").hasRole("ANDROID")).httpBasic(withDefaults()); + http.authorizeHttpRequests((authorizeHttpRequest) -> authorizeHttpRequest.requestMatchers("/build_async/x86_64-android/**").hasRole("ANDROID")).httpBasic(withDefaults()); break; case "ios": http.authorizeHttpRequests((authorizeHttpRequest) -> authorizeHttpRequest.requestMatchers("/build_async/armv7-ios/**").hasRole("IOS")).httpBasic(withDefaults()); diff --git a/server/src/main/java/com/defold/extender/builders/CSharpBuilder.java b/server/src/main/java/com/defold/extender/builders/CSharpBuilder.java index 2d49fbfb..fdab2233 100644 --- a/server/src/main/java/com/defold/extender/builders/CSharpBuilder.java +++ b/server/src/main/java/com/defold/extender/builders/CSharpBuilder.java @@ -118,6 +118,7 @@ private static String convertPlatform(String platform) { if (platform.equals("x86_64-osx")) return "osx-x64"; if (platform.equals("arm64-android")) return "linux-bionic-arm64"; if (platform.equals("armv7-android")) return "linux-bionic-arm32"; + if (platform.equals("x86_64-android")) return "linux-bionic-x64"; if (platform.equals("arm64-win32")) return "win-arm64"; if (platform.equals("x86_64-win32")) return "win-x64"; if (platform.equals("x86-win32")) return "win-x86"; diff --git a/server/src/test/java/com/defold/extender/IntegrationTest.java b/server/src/test/java/com/defold/extender/IntegrationTest.java index bbe770d2..e80fed2c 100644 --- a/server/src/test/java/com/defold/extender/IntegrationTest.java +++ b/server/src/test/java/com/defold/extender/IntegrationTest.java @@ -120,7 +120,9 @@ public static List data() { DefoldVersion[] versions = { // "a" is a made up sdk where we can more easily test build.yml fixes - // new DefoldVersion("a", new Version(0, 0, 0), new String[] {"armv7-android", "x86_64-win32"} ), + // new DefoldVersion("a", new Version(0, 0, 0), new String[] {"armv7-android", "x86_64-android", "x86_64-win32"} ), + // NOTE: x86_64-android can be added to the released SDKs below once a Defold + // release ships the platform in its extender/build.yml. // // https://github.com/defold/defold/releases/tag/1.11.1 new DefoldVersion("758dfc0ea71dca26d169fddd0c5a1bc6dd0be4b3", new Version(1, 11, 1), new String[] {"armv7-android", "arm64-android", "x86_64-linux", "x86_64-win32", "js-web", "wasm-web"}), // // https://github.com/defold/defold/releases/tag/1.11.2 diff --git a/server/src/test/java/com/defold/extender/TestUtils.java b/server/src/test/java/com/defold/extender/TestUtils.java index 7557f425..ea4528f2 100644 --- a/server/src/test/java/com/defold/extender/TestUtils.java +++ b/server/src/test/java/com/defold/extender/TestUtils.java @@ -68,7 +68,7 @@ public static String composeProfiles(Collection platforms) { } else { throw new IllegalArgumentException(String.format( "Cannot map target platform '%s' to a docker compose profile. Known platforms: " - + "x86_64-linux, armv7-android, arm64-android, js-web, wasm-web, x86_64-win32", + + "x86_64-linux, armv7-android, arm64-android, x86_64-android, js-web, wasm-web, x86_64-win32", platform)); } } diff --git a/server/test-data/compile.sh b/server/test-data/compile.sh index 5a3ea6de..7a392fe8 100755 --- a/server/test-data/compile.sh +++ b/server/test-data/compile.sh @@ -50,7 +50,7 @@ function CompileAndroid { local targetdir=$3 local lib_type=$4 - archs=("armv7" "arm64") + archs=("armv7" "arm64" "x86_64") for arch in "${archs[@]}" do local archname=$arch-android @@ -71,6 +71,10 @@ function CompileAndroid { CFLAGS="${CFLAGS} -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -mfloat-abi=softfp -mfpu=vfp" LDFLAGS="-Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text" GCC=${ANDROID_GCC}armv7a-linux-androideabi${ANDROID_NDK_API_VERSION}-clang++ + elif [ "x86_64" == "$arch" ]; then + # No -march, the NDK x86_64 clang wrapper already targets the mandated ABI baseline + LDFLAGS="-Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text" + GCC=${ANDROID_GCC}x86_64-linux-android${ANDROID_64_NDK_API_VERSION}-clang++ else CFLAGS="${CFLAGS} -D__aarch64__ -march=armv8-a" LDFLAGS="-Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text" diff --git a/server/test-data/ext/lib/x86_64-android/libalib.a b/server/test-data/ext/lib/x86_64-android/libalib.a new file mode 100644 index 00000000..c845d942 Binary files /dev/null and b/server/test-data/ext/lib/x86_64-android/libalib.a differ diff --git a/server/test-data/ext2/lib/x86_64-android/libalib.a b/server/test-data/ext2/lib/x86_64-android/libalib.a new file mode 100644 index 00000000..c845d942 Binary files /dev/null and b/server/test-data/ext2/lib/x86_64-android/libalib.a differ diff --git a/server/test-data/ext2/lib/x86_64-android/libblib.a b/server/test-data/ext2/lib/x86_64-android/libblib.a new file mode 100644 index 00000000..970440a1 Binary files /dev/null and b/server/test-data/ext2/lib/x86_64-android/libblib.a differ diff --git a/server/test-data/ext_std/lib/x86_64-android/libstd.a b/server/test-data/ext_std/lib/x86_64-android/libstd.a new file mode 100644 index 00000000..c4beb754 Binary files /dev/null and b/server/test-data/ext_std/lib/x86_64-android/libstd.a differ diff --git a/server/test-data/manifest_override/upload/_app/app.manifest b/server/test-data/manifest_override/upload/_app/app.manifest index cc648ffc..6651b7b2 100644 --- a/server/test-data/manifest_override/upload/_app/app.manifest +++ b/server/test-data/manifest_override/upload/_app/app.manifest @@ -17,6 +17,9 @@ platforms: arm64-android: context: excludeLibs: [profile_null] + x86_64-android: + context: + excludeLibs: [profile_null] x86_64-osx: context: excludeLibs: [profile_null] diff --git a/server/test-data/manifest_override/upload/extension1/ext.manifest b/server/test-data/manifest_override/upload/extension1/ext.manifest index c5acdd7c..d8483b0f 100644 --- a/server/test-data/manifest_override/upload/extension1/ext.manifest +++ b/server/test-data/manifest_override/upload/extension1/ext.manifest @@ -16,6 +16,9 @@ platforms: arm64-android: context: excludeLibs: [profilerext_null] + x86_64-android: + context: + excludeLibs: [profilerext_null] x86_64-osx: context: excludeLibs: [profilerext_null] diff --git a/server/test-data/sdk/a/defoldsdk/extender/build.yml b/server/test-data/sdk/a/defoldsdk/extender/build.yml index b3e636fe..8785d2f0 100644 --- a/server/test-data/sdk/a/defoldsdk/extender/build.yml +++ b/server/test-data/sdk/a/defoldsdk/extender/build.yml @@ -334,6 +334,17 @@ platforms: compileCmd: '{{env.NDK_CXX}} -c -O2 -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -march=armv8-a -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot={{env.SYSROOT}} -DANDROID -Wa,--noexecstack {{#defines}}-D{{{.}}} {{/defines}} {{#flags}}{{{.}}} {{/flags}} {{#ext.includes}}-I{{.}} {{/ext.includes}} {{#includes}}-I{{.}} {{/includes}} {{#platformIncludes}}-I{{.}} {{/platformIncludes}} {{src}} -o{{tgt}}' linkCmd: '{{env.NDK_CXX}} -fuse-ld={{env.NDK_LD}} -O2 -g -isysroot={{env.SYSROOT}} -static-libstdc++ {{#src}}{{.}} {{/src}} -o {{tgt}} -Wl,-soname=libdmengine.so {{#defines}}-D{{{.}}} {{/defines}} {{#linkFlags}}{{{.}}} {{/linkFlags}} -Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text {{#ext.libPaths}}-L{{.}} {{/ext.libPaths}} {{#libPaths}}-L{{.}} {{/libPaths}} -Wl,-Bstatic -Wl,--start-group -lc++_static {{#libs}}-l{{{.}}} {{/libs}} {{#ext.libs}}-l{{.}} {{/ext.libs}} {{#engineLibs}}-l{{.}} {{/engineLibs}} -Wl,--end-group -Wl,-Bdynamic {{#ext.dynamicLibs}}-l{{{.}}} {{/ext.dynamicLibs}} {{#dynamicLibs}}-l{{{.}}} {{/dynamicLibs}} -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared' + x86_64-android: + env: + NDK_VERSION: "{{env.ANDROID_64_NDK_API_VERSION}}" + NDK_CXX: "{{env.ANDROID_NDK_BIN_PATH}}/x86_64-linux-android{{env.ANDROID_64_NDK_API_VERSION}}-clang++" + context: + libPaths: ["{{dynamo_home}}/lib/x86_64-android", "{{dynamo_home}}/ext/lib/x86_64-android"] + defines: ["DM_PLATFORM_ANDROID"] + + compileCmd: '{{env.NDK_CXX}} -c -O2 -g -gdwarf-2 -fpic -ffunction-sections -fstack-protector -fomit-frame-pointer -fno-strict-aliasing -funwind-tables -isysroot={{env.SYSROOT}} -DANDROID -Wa,--noexecstack {{#defines}}-D{{{.}}} {{/defines}} {{#flags}}{{{.}}} {{/flags}} {{#ext.includes}}-I{{.}} {{/ext.includes}} {{#includes}}-I{{.}} {{/includes}} {{#platformIncludes}}-I{{.}} {{/platformIncludes}} {{src}} -o{{tgt}}' + linkCmd: '{{env.NDK_CXX}} -fuse-ld={{env.NDK_LD}} -O2 -g -isysroot={{env.SYSROOT}} -static-libstdc++ {{#src}}{{.}} {{/src}} -o {{tgt}} -Wl,-soname=libdmengine.so {{#defines}}-D{{{.}}} {{/defines}} {{#linkFlags}}{{{.}}} {{/linkFlags}} -Wl,--no-undefined -Wl,-z,noexecstack -landroid -fpic -z text {{#ext.libPaths}}-L{{.}} {{/ext.libPaths}} {{#libPaths}}-L{{.}} {{/libPaths}} -Wl,-Bstatic -Wl,--start-group -lc++_static {{#libs}}-l{{{.}}} {{/libs}} {{#ext.libs}}-l{{.}} {{/ext.libs}} {{#engineLibs}}-l{{.}} {{/engineLibs}} -Wl,--end-group -Wl,-Bdynamic {{#ext.dynamicLibs}}-l{{{.}}} {{/ext.dynamicLibs}} {{#dynamicLibs}}-l{{{.}}} {{/dynamicLibs}} -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -shared' + web: # It's here to whitelist this as a platform, currently used for general settings env: diff --git a/server/test-data/sdk/a/defoldsdk/extender/variants/headless.appmanifest b/server/test-data/sdk/a/defoldsdk/extender/variants/headless.appmanifest index 4d5e2a6b..1124426b 100644 --- a/server/test-data/sdk/a/defoldsdk/extender/variants/headless.appmanifest +++ b/server/test-data/sdk/a/defoldsdk/extender/variants/headless.appmanifest @@ -68,6 +68,13 @@ platforms: symbols: ["NullSoundDevice", "GraphicsAdapterNull"] libs: ["record_null","sound_null","graphics_null","hid_null"] + x86_64-android: + context: + excludeLibs: ["record","vpx","sound","tremolo","graphics","hid"] + excludeSymbols: ["DefaultSoundDevice","AudioDecoderWav","AudioDecoderStbVorbis","AudioDecoderTremolo","GraphicsAdapterOpenGL","GraphicsAdapterVulkan"] + symbols: ["NullSoundDevice", "GraphicsAdapterNull"] + libs: ["record_null","sound_null","graphics_null","hid_null"] + arm64-ios: context: excludeLibs: ["record","vpx","sound","tremolo","graphics","hid"] diff --git a/server/test-data/sdk/a/defoldsdk/extender/variants/release.appmanifest b/server/test-data/sdk/a/defoldsdk/extender/variants/release.appmanifest index 7ed53c6c..f2ad4072 100644 --- a/server/test-data/sdk/a/defoldsdk/extender/variants/release.appmanifest +++ b/server/test-data/sdk/a/defoldsdk/extender/variants/release.appmanifest @@ -51,6 +51,11 @@ platforms: excludeLibs: ["engine", "engine_service", "profile", "remotery", "profilerext"] libs: ["engine_release", "engine_service_null", "profile_null", "remotery_null", "profilerext_null"] + x86_64-android: + context: + excludeLibs: ["engine", "engine_service", "profile", "remotery", "profilerext"] + libs: ["engine_release", "engine_service_null", "profile_null", "remotery_null", "profilerext_null"] + arm64-ios: context: excludeLibs: ["engine", "engine_service", "profile", "remotery", "profilerext"] diff --git a/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_foo.a b/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_foo.a new file mode 100644 index 00000000..d00afe82 Binary files /dev/null and b/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_foo.a differ diff --git a/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_main.a b/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_main.a new file mode 100644 index 00000000..7e04ba60 Binary files /dev/null and b/server/test-data/sdk/a/defoldsdk/lib/x86_64-android/libengine_main.a differ diff --git a/server/test-data/testproject_appmanifest/ext/lib/x86_64-android/libalib.a b/server/test-data/testproject_appmanifest/ext/lib/x86_64-android/libalib.a new file mode 100644 index 00000000..390ac0c5 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext/lib/x86_64-android/libalib.a differ diff --git a/server/test-data/testproject_appmanifest/ext2/lib/x86_64-android/libblib.a b/server/test-data/testproject_appmanifest/ext2/lib/x86_64-android/libblib.a new file mode 100644 index 00000000..a23d53a2 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext2/lib/x86_64-android/libblib.a differ