Skip to content

4.27.0 on Windows fails with error C4668: 'WINAPI_PARTITION_GAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Aug 30, 2021 · 26 comments · Fixed by #195
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Aug 30, 2021

Output of the ue4-docker info command:

ue4-docker version:         0.0.88 (latest available version is 0.0.88)
Operating system:           Windows Server 2019 Standard Evaluation Version 1809 (Build 17763.2114)
Docker daemon version:      20.10.6
NVIDIA Docker supported:    No
Maximum image size:         400GB
Available disk space:       789.61 GiB
Total system memory:        63.92 GiB physical, 73.42 GiB virtual
Number of processors:       12 physical, 24 logical

Additional details:

  • Are you accessing the network through a proxy server? No

Hello, I am having issues building the newest UE 4.27 using the latest ue4-docker (0.0.88).
At first I thought it was due to the custom UE version we use in the company, but I have also tried to build the not customized version from epic and the issue persists. Building the engine using the ue4 build-target UE4Editor works on both native OS and windows containers.
Linux image builds just fine.
Previous UE images build just fine.
Older ue4-docker versions (tested 0.0.77 and 0.0.86) have the same issue.
I am able to reproduce the issue on any windows server machine by running:

ue4-docker build custom:"4.27" -repo="[email protected]:EpicGames/UnrealEngine.git" -branch="4.27" --visual-studio 2019 --exclude debug --exclude templates --exclude ddc
[ue4-docker build] COMMAND-LINE INVOCATION:
[ue4-docker build] ['ue4-docker', 'custom:4.27', '[email protected]:EpicGames/UnrealEngine.git', '-branch=4.27', '--visual-studio', '2019', '--exclude', 'debug', '--exclude', 'templates', '--exclude', 'ddc']

[ue4-docker build] UNREAL ENGINE VERSION SETTINGS:
[ue4-docker build] Custom build:  Yes
[ue4-docker build] Custom name:   4.27
[ue4-docker build] Repository:    git@github.com:EpicGames/UnrealEngine.git
[ue4-docker build] Branch/tag:    4.27

[ue4-docker build] ADVANCED CONFIGURATION OPTIONS:
[ue4-docker build] buildgraph_args: " -set:VS2019=true"
[ue4-docker build] excluded_components: {"ddc": true, "debug": true, "templates": true}

[ue4-docker build] WINDOWS CONTAINER SETTINGS
[ue4-docker build] Isolation mode:               process
[ue4-docker build] Base OS image tag:            ltsc2019
[ue4-docker build] Host OS:                      Windows Server 2019 Standard Evaluation Version 1809 (Build 17763.2114)
[ue4-docker build] Memory limit:                 No limit
[ue4-docker build] Detected max image size:      400GB
[ue4-docker build] Visual Studio:                2019
[ue4-docker build] Directory to copy DLLs from:  C:\Windows\System32

[ue4-docker build] GENERAL SETTINGS
[ue4-docker build] Excluding the following Engine components:
[ue4-docker build] - Debug symbols
[ue4-docker build] - Derived Data Cache (DDC)
[ue4-docker build] - Template projects and samples
[ue4-docker build] Not building the ue4-source image, no Git credentials required.

[ue4-docker build] Image "adamrehn/ue4-build-prerequisites:ltsc2019-vs2019" exists and rebuild not requested, skipping build.

[ue4-docker build] Image "adamrehn/ue4-source:4.27-ltsc2019-vs2019" exists and rebuild not requested, skipping build.

[ue4-docker build] Building image "adamrehn/ue4-engine:4.27-ltsc2019-vs2019"...
Sending build context to Docker daemon  3.072kB
Step 1/8 : ARG NAMESPACE
Step 2/8 : ARG TAG
Step 3/8 : ARG PREREQS_TAG
Step 4/8 : FROM ${NAMESPACE}/ue4-source:${TAG}-${PREREQS_TAG}
 ---> 7f4bcdefd16b
Step 5/8 : RUN GenerateProjectFiles.bat && echo. && echo.RUN directive complete. Docker will now commit the filesystem layer to disk. && echo.Note that for large filesystem layers this can take quite some time. && echo.Performing filesystem layer commit... && echo.
 ---> Using cache
 ---> 732cdcb289e5
Step 6/8 : RUN .\Engine\Build\BatchFiles\Build.bat UE4Editor Win64 Development -WaitMutex && echo. && echo.RUN directive complete. Docker will now commit the filesystem layer to disk. && echo.Note that for large filesystem layers this can take quite some time. && echo.Performing filesystem layer commit... && echo.
 ---> Running in 65437974a158
Using 'git status' to determine working set for adaptive non-unity build (C:\UnrealEngine).
Creating makefile for UE4Editor (no existing makefile)
Creating makefile for UnrealHeaderTool (no existing makefile)
Building 48 actions with 24 processes...
  [1/48] Default.rc2
  [2/48] BuildSettings.cpp
  [3/48] UnrealHeaderTool-BuildSettings.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\BuildSettings\UnrealHeaderTool-BuildSettings.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\BuildSettings\UnrealHeaderTool-BuildSettings.exp
  [4/48] UnrealHeaderTool-BuildSettings.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\BuildSettings\UnrealHeaderTool-BuildSettings.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\BuildSettings\UnrealHeaderTool-BuildSettings.suppressed.exp
  [5/48] Module.TraceLog.cpp
  [6/48] UnrealHeaderTool-TraceLog.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\TraceLog\UnrealHeaderTool-TraceLog.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\TraceLog\UnrealHeaderTool-TraceLog.exp
  [7/48] UnrealHeaderTool-TraceLog.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\TraceLog\UnrealHeaderTool-TraceLog.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\TraceLog\UnrealHeaderTool-TraceLog.suppressed.exp
  [8/48] SharedPCH.Core.ShadowErrors.cpp
  [9/48] PCH.Core.cpp
  [10/48] Module.Core.2_of_15.cpp
  [11/48] Module.Projects.cpp
  [12/48] UnrealHeaderTool-Projects.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Projects\UnrealHeaderTool-Projects.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Projects\UnrealHeaderTool-Projects.exp
  [13/48] PCH.CoreUObject.cpp
  [14/48] Module.Core.11_of_15.cpp
  [15/48] Module.Core.7_of_15.cpp
  [16/48] Module.Json.cpp
  [17/48] Module.Core.4_of_15.cpp
  [18/48] Module.Core.15_of_15.cpp
  [19/48] UnrealHeaderTool-Json.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Json\UnrealHeaderTool-Json.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Json\UnrealHeaderTool-Json.exp
  [20/48] Module.Core.8_of_15.cpp
  [21/48] Module.Core.3_of_15.cpp
  [22/48] Module.Core.10_of_15.cpp
  [23/48] Module.Core.6_of_15.cpp
  [24/48] Module.CoreUObject.9_of_9.cpp
  [25/48] Module.Core.1_of_15.cpp
  [26/48] Module.Core.13_of_15.cpp
  C:/UnrealEngine/Engine/Source/Runtime/Core/Private/Tests/Math/UnitConversionTests.cpp(143): warning C4305: 'argument': truncation from 'double' to 'float'
  [27/48] Module.Core.9_of_15.cpp
  [28/48] Module.Core.5_of_15.cpp
  [29/48] Module.Core.12_of_15.cpp
  [30/48] Module.Core.14_of_15.cpp
  [31/48] UnrealHeaderTool-Core.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Core\UnrealHeaderTool-Core.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Core\UnrealHeaderTool-Core.exp
  [32/48] Module.CoreUObject.2_of_9.cpp
  [33/48] UnrealHeaderTool-Json.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Json\UnrealHeaderTool-Json.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Json\UnrealHeaderTool-Json.suppressed.exp
  [34/48] UnrealHeaderTool-Projects.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Projects\UnrealHeaderTool-Projects.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Projects\UnrealHeaderTool-Projects.suppressed.exp
  [35/48] UnrealHeaderTool-Core.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Core\UnrealHeaderTool-Core.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\Core\UnrealHeaderTool-Core.suppressed.exp
  [36/48] Module.CoreUObject.6_of_9.cpp
  [37/48] Module.CoreUObject.7_of_9.cpp
  [38/48] Module.CoreUObject.4_of_9.cpp
  [39/48] Module.CoreUObject.3_of_9.cpp
  [40/48] Module.CoreUObject.1_of_9.cpp
  [41/48] Module.CoreUObject.5_of_9.cpp
  [42/48] Module.UnrealHeaderTool.cpp
  C:/UnrealEngine/Engine/Source/Programs/UnrealHeaderTool/Private/CodeGenerator.cpp(2465): warning C4305: 'argument': truncation from 'double' to 'float'
  C:/UnrealEngine/Engine/Source/Programs/UnrealHeaderTool/Private/CodeGenerator.cpp(3395): warning C4305: 'argument': truncation from 'double' to 'float'
  [43/48] UnrealHeaderTool.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\UnrealHeaderTool.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\UnrealHeaderTool.exp
  [44/48] Module.CoreUObject.8_of_9.cpp
  [45/48] UnrealHeaderTool-CoreUObject.lib
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\CoreUObject\UnrealHeaderTool-CoreUObject.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\CoreUObject\UnrealHeaderTool-CoreUObject.exp
  [46/48] UnrealHeaderTool-CoreUObject.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\CoreUObject\UnrealHeaderTool-CoreUObject.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development\CoreUObject\UnrealHeaderTool-CoreUObject.suppressed.exp
  [47/48] UnrealHeaderTool.exe
  [48/48] UnrealHeaderTool.target
Total time in Parallel executor: 29.33 seconds
Parsing headers for UE4Editor
  Running UnrealHeaderTool UE4Editor "C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\UnrealEngine\Engine\Programs\UnrealBuildTool\Log_UHT.txt"
LogInit: Display: Loading text-based GConfig....
Reflection code generated for UE4Editor in 12.7497078 seconds
Building UE4Editor...
Using Visual Studio 2019 14.29.30133 toolchain (C:\BuildTools\VC\Tools\MSVC\14.29.30133) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 4561 actions with 24 processes...
  [1/4561] PBDSpringConstraints.ispc
  [2/4561] GeometryCollectionSceneProxy.ispc
  [3/4561] GPUSkinVertexFactory.ispc
  [4/4561] AABB.ispc
  [5/4561] PBDAxialSpringConstraints.ispc
  [6/4561] PBDLongRangeConstraints.ispc
  [7/4561] BonePose.ispc
  [8/4561] SkeletalMeshComponent.ispc
  [9/4561] ChaosClothingSimulation.ispc
  [10/4561] VelocityField.ispc
  [11/4561] NiagaraDataInterfaceVectorField.ispc
  [12/4561] TriangleMesh.ispc
  [13/4561] AnimationRuntime.ispc
  [14/4561] KAggregateGeom.ispc
  [15/4561] GeometryCollectionComponent.ispc
  [16/4561] PBDSphericalConstraint.ispc
  [17/4561] PBDMinEvolution.ispc
  [18/4561] GPUSkinVertexFactory.ispc
  [19/4561] Default.rc2
  [20/4561] GeometryCollectionSceneProxy.ispc
  [21/4561] AABB.ispc
  [22/4561] PerParticleDampVelocity.ispc
  [23/4561] PBDSpringConstraints.ispc
  [24/4561] PBDLongRangeConstraints.ispc
  [25/4561] BonePose.ispc
  [26/4561] PBDAxialSpringConstraints.ispc
  [27/4561] SkeletalMeshComponent.ispc
  [28/4561] AnimEncoding_ConstantKeyLerp.ispc
  [29/4561] VelocityField.ispc
  [30/4561] TriangleMesh.ispc
  [31/4561] ChaosClothingSimulation.ispc
  [32/4561] NiagaraDataInterfaceVectorField.ispc
  [33/4561] PCH.ImageWrapper.cpp
  [34/4561] SharedPCH.CoreUObject.ShadowErrors.cpp
  [35/4561] SharedPCH.Core.ShadowErrors.cpp
  [36/4561] AnimationRuntime.ispc
  [37/4561] KAggregateGeom.ispc
  [38/4561] PCH.Core.cpp
  [39/4561] AnimEncoding_VariableKeyLerp.ispc
  [40/4561] PBDSphericalConstraint.ispc
  [41/4561] Module.TraceLog.cpp
  [42/4561] GeometryCollectionComponent.ispc
  [43/4561] PBDMinEvolution.ispc
  [44/4561] PCH.CoreUObject.cpp
  [45/4561] PBDJointSolverGaussSeidel.ispc
  [46/4561] Module.ImageWrapper.cpp
  [47/4561] PerParticlePBDCollisionConstraint.ispc
  [48/4561] PerParticleDampVelocity.ispc
  [49/4561] Module.SlateCore.gen.cpp
  [50/4561] AnimEncoding_PerTrackCompression.ispc
  [51/4561] Module.Core.7_of_15.cpp
  [52/4561] Module.Core.10_of_15.cpp
  [53/4561] AnimEncoding_ConstantKeyLerp.ispc
  [54/4561] SharedPCH.Slate.ShadowErrors.cpp
  [55/4561] Module.SlateCore.2_of_3.cpp
.
.
.
  [4543/4561] UE4Editor-DisplayClusterConfigurator.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Runtime\nDisplay\Intermediate\Build\Win64\UE4Editor\Development\DisplayClusterConfigurator\UE4Editor-DisplayClusterConfigurator.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Runtime\nDisplay\Intermediate\Build\Win64\UE4Editor\Development\DisplayClusterConfigurator\UE4Editor-DisplayClusterConfigurator.suppressed.exp
  [4544/4561] UE4Editor-DatasmithPLMXMLTranslator.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Enterprise\DatasmithCADImporter\Intermediate\Build\Win64\UE4Editor\Development\DatasmithPLMXMLTranslator\UE4Editor-DatasmithPLMXMLTranslator.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Enterprise\DatasmithCADImporter\Intermediate\Build\Win64\UE4Editor\Development\DatasmithPLMXMLTranslator\UE4Editor-DatasmithPLMXMLTranslator.suppressed.exp
  [4545/4561] UE4Editor-MeshModelingToolsEditorOnly.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Experimental\MeshModelingToolset\Intermediate\Build\Win64\UE4Editor\Development\MeshModelingToolsEditorOnly\UE4Editor-MeshModelingToolsEditorOnly.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Experimental\MeshModelingToolset\Intermediate\Build\Win64\UE4Editor\Development\MeshModelingToolsEditorOnly\UE4Editor-MeshModelingToolsEditorOnly.suppressed.exp
  [4546/4561] UE4Editor-MagicLeapAR.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Lumin\MagicLeap\Intermediate\Build\Win64\UE4Editor\Development\MagicLeapAR\UE4Editor-MagicLeapAR.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Lumin\MagicLeap\Intermediate\Build\Win64\UE4Editor\Development\MagicLeapAR\UE4Editor-MagicLeapAR.suppressed.exp
  [4547/4561] UE4Editor-GameplayAbilitiesEditor.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Runtime\GameplayAbilities\Intermediate\Build\Win64\UE4Editor\Development\GameplayAbilitiesEditor\UE4Editor-GameplayAbilitiesEditor.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Runtime\GameplayAbilities\Intermediate\Build\Win64\UE4Editor\Development\GameplayAbilitiesEditor\UE4Editor-GameplayAbilitiesEditor.suppressed.exp
  [4548/4561] UE4Editor.exe
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor.suppressed.exp
  [4549/4561] UE4Editor-VirtualCamera.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Experimental\VirtualCamera\Intermediate\Build\Win64\UE4Editor\Development\VirtualCamera\UE4Editor-VirtualCamera.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Experimental\VirtualCamera\Intermediate\Build\Win64\UE4Editor\Development\VirtualCamera\UE4Editor-VirtualCamera.suppressed.exp
  [4550/4561] UE4Editor-PixelStreaming.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Media\PixelStreaming\Intermediate\Build\Win64\UE4Editor\Development\PixelStreaming\UE4Editor-PixelStreaming.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Media\PixelStreaming\Intermediate\Build\Win64\UE4Editor\Development\PixelStreaming\UE4Editor-PixelStreaming.suppressed.exp
  [4551/4561] UE4Editor-DatasmithImporter.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Enterprise\DatasmithImporter\Intermediate\Build\Win64\UE4Editor\Development\DatasmithImporter\UE4Editor-DatasmithImporter.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Enterprise\DatasmithImporter\Intermediate\Build\Win64\UE4Editor\Development\DatasmithImporter\UE4Editor-DatasmithImporter.suppressed.exp
  [4552/4561] UE4Editor-USDExporter.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Importers\USDImporter\Intermediate\Build\Win64\UE4Editor\Development\USDExporter\UE4Editor-USDExporter.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Importers\USDImporter\Intermediate\Build\Win64\UE4Editor\Development\USDExporter\UE4Editor-USDExporter.suppressed.exp
  [4553/4561] UE4Editor-CameraCalibrationEditor.dll
     Creating library C:\UnrealEngine\Engine\Plugins\VirtualProduction\CameraCalibration\Intermediate\Build\Win64\UE4Editor\Development\CameraCalibrationEditor\UE4Editor-CameraCalibrationEditor.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\VirtualProduction\CameraCalibration\Intermediate\Build\Win64\UE4Editor\Development\CameraCalibrationEditor\UE4Editor-CameraCalibrationEditor.suppressed.exp
  [4554/4561] UE4Editor-ControlRigEditor.dll
     Creating library C:\UnrealEngine\Engine\Plugins\Experimental\ControlRig\Intermediate\Build\Win64\UE4Editor\Development\ControlRigEditor\UE4Editor-ControlRigEditor.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\Experimental\ControlRig\Intermediate\Build\Win64\UE4Editor\Development\ControlRigEditor\UE4Editor-ControlRigEditor.suppressed.exp
  [4555/4561] UE4Editor-DetailCustomizations.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\DetailCustomizations\UE4Editor-DetailCustomizations.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\DetailCustomizations\UE4Editor-DetailCustomizations.suppressed.exp
  [4556/4561] UE4Editor-NiagaraEditor.dll
     Creating library C:\UnrealEngine\Engine\Plugins\FX\Niagara\Intermediate\Build\Win64\UE4Editor\Development\NiagaraEditor\UE4Editor-NiagaraEditor.suppressed.lib and object C:\UnrealEngine\Engine\Plugins\FX\Niagara\Intermediate\Build\Win64\UE4Editor\Development\NiagaraEditor\UE4Editor-NiagaraEditor.suppressed.exp
  [4557/4561] UE4Editor-UnrealEd.dll
     Creating library C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealEd\UE4Editor-UnrealEd.suppressed.lib and object C:\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UnrealEd\UE4Editor-UnrealEd.suppressed.exp
The command 'cmd /S /C .\Engine\Build\BatchFiles\Build.bat UE4Editor Win64 Development -WaitMutex && echo. && echo.RUN directive complete. Docker will now commit the filesystem layer to disk. && echo.Note that for large filesystem layers this can take quite some time. && echo.Performing filesystem layer commit... && echo.' returned a non-zero code: 6
[ue4-docker build] Error: failed to build image "adamrehn/ue4-engine:4.27-ltsc2019-vs2019".

Thanks in advance

@slonopotamus slonopotamus added the bug Something isn't working label Aug 30, 2021
@slonopotamus
Copy link
Collaborator

slonopotamus commented Aug 30, 2021

Confirming, I've reproduced this.

Error:

  ** For UE4Editor-Win64-DebugGame + UE4Editor-Win64-Development
  Module.ElectraPlayerRuntime.1_of_4.cpp
  C:\UnrealEngine\Engine\Source\ThirdParty\Windows\DirectX\include\d3d12.h(427): error C4668: 'WINAPI_PARTITION_GAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

Now the question is: is it actually specific to ue4-docker?

@slonopotamus
Copy link
Collaborator

Google reveals several hits...

https://answers.unrealengine.com/questions/1029719/view.html
https://forums.unrealengine.com/t/branch-4-27/230021

@slonopotamus
Copy link
Collaborator

That's interesting: https://github.com/EpicGames/UnrealEngine/commit/ecc4872c3269e75a24adc40734cc8bcc9bbed1ca
If I'm reading this correctly, 4.27 cannot be built with Windows SDK < 18362 (while UE5 can).

@slonopotamus
Copy link
Collaborator

slonopotamus commented Aug 30, 2021

If we closely look at UE-4.27 release notes, we'll see that "IDE Version the Build farm compiles against" says "Windows 10 SDK (10.0.18362.0)".

The weird thing is that you cannot install Visual Studio 2017 and Windows 10 SDK 10.0.18362.0 in a single step because the newest Windows SDK that VS2017 channel contains is 10.0.17763.0.

So, what we can do here...

a. Install newer SDK when using VS2019.
b. Install newer SDK always, like Epics do. But this will require full retesting of ancient UE4 versions that we still support because they might not be compatible with newer Windows SDK.
c. Use separate ue4-build-prerequisites image for each engine version. This move makes sense because different engine versions have different requirements and it is just a matter of luck that we can use the same image for all UE4.x versions.
d. Complain to Epics that 4.27 doesn't compile with Windows SDK < 10.0.18362.0 so they fix it in 4.27.x
e. Suggest your own

@adamrehn
Copy link
Owner

Regarding compatibility of newer SDKs with older Engine versions, the Windows SDK is supposed to be fully backwards compatible, right? We'd definitely still want to verify that rather than just taking Microsoft's word for it, but in theory it should be safe to use a newer SDK version to build older software.

@TBBle
Copy link
Collaborator

TBBle commented Aug 30, 2021

What about adding -DWINAPI_PARTITION_GAMES=0 to the build, since we don't support building against the Microsoft GDK?

Otherwise, perhaps we can ignore C4668, since in this case, "undefined preprocessor macro evaluates to 0" is the standard and desired behaviour.

@slonopotamus
Copy link
Collaborator

@adamrehn There is a reason why we're using Windows SDK 17763 currently. It is the latest thing that is available through VS2017 channel. We'll have to use VS2019 channel to install newer Windows SDK, while continuing to use VS2017 channel to install all the rest of build tools. I don't even want to think how this works from licensing perspective. Does it mean I now need to have VS2019 license even though the only thing I install through it is available independently with a different license?

Anyway, see #193.

slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Aug 31, 2021
slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Aug 31, 2021
slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Aug 31, 2021
@TBBle
Copy link
Collaborator

TBBle commented Aug 31, 2021

Does it mean I now need to have VS2019 license even though the only thing I install through it is available independently with a different license?

There's not different VS2017 and VS2019 licenses, AFAIK. A VS license covers all versions, and installing anything from the VS Build Tools installer means the user must have such a license.

@slonopotamus
Copy link
Collaborator

A VS license covers all versions

Are you sure? I thought having a VS license covers all prior versions.

@TBBle
Copy link
Collaborator

TBBle commented Aug 31, 2021

... I was sure until you asked that. Thinking about it, I'm on a Visual Studio subscription through my employer, so I always have access to the latest version, and I forgot that box-product licenses for VS are still a thing.

You're right, the standalone license doens't include newer versions... Or older versions, accordsing to Pricing Details.

Screenshot

image

@slonopotamus
Copy link
Collaborator

slonopotamus commented Aug 31, 2021

https://visualstudio.microsoft.com/wp-content/uploads/2020/09/Visual-Studio-Licensing-Whitepaper-Aug-2020.pdf

For Visual Studio Professional 2019 standalone licenses, the software included in the license is the current version of the
software, Visual Studio Professional 2019, plus downgrade rights to simultaneously run prior versions of Visual Studio
Professional to which you may otherwise have access.

I believe it has exactly the same wording for VS2017. So, it someone has VS2017-only license, it isn't clear whether it is ok for them to install Windows SDK through VS2019 Build Tools.

Maybe we just use https://community.chocolatey.org/packages/windows-sdk-10.0? Err, wait, it is kinda old.

Looking for a newer package... It possibly should be this one: https://community.chocolatey.org/packages/windows-sdk-10 Nope, also old.

@slonopotamus
Copy link
Collaborator

Created UDN ticker for this issue: https://udn.unrealengine.com/s/question/0D54z000079HcjJCAS/d3d12h427-error-c4668-winapipartitiongames-is-not-defined-as-a-preprocessor-macro-replacing-with-0-for-ifelif

If Epics restore pre-18362 Windows SDK compatibility in 4.27.x, I'd suggest doing nothing on our side for now.

slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Aug 31, 2021
slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Aug 31, 2021
@ghost
Copy link
Author

ghost commented Sep 1, 2021

I tried the new version and it works! I can also confirm the new SDK works with unreal 4.26.
This was a lightning fix, thanks a lot!

@slonopotamus
Copy link
Collaborator

@tibzuru Do you mean you built with changes from #193?

@slonopotamus
Copy link
Collaborator

Well-well-well. 4.20.3 doesn't compile against Windows SDK 18362.

  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(7): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(13): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(19): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(25): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(31): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(37): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(43): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(49): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(55): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(61): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(67): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(73): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\ndis/version.h(79): error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif

@slonopotamus
Copy link
Collaborator

So, we no longer have a single Windows SDK that is compatible with all our supported engine versions.

@ghost
Copy link
Author

ghost commented Sep 1, 2021

@tibzuru Do you mean you built with changes from #193?

Indeed.
Works fine with UE 4.27 and 4.26. I will test it with 4.25 today and let you know.

@slonopotamus
Copy link
Collaborator

slonopotamus commented Sep 1, 2021

Don't worry, we already know that multiple engine versions are fucked up:

  1. 4.23-preview: https://answers.unrealengine.com/questions/919242/view.html
  2. 4.21: ERROR When Build UE4.21 For ZED! stereolabs/zed-unreal-plugin#12
  3. 4.21 again: https://forums.unrealengine.com/t/ndis_miniport_major_version-is-not-defined-error/135058
  4. I got failure with 4.20

@slonopotamus
Copy link
Collaborator

I've got a response from Epics, but it isn't clear whether 4.27 compatibility with pre-18362 Windows SDK will be restored:

Hi Marat,

I'm currently discussing the possibility to bring to a future 4.27.x release with the development team. We have some rules regarding what can change in a minor release and must ensure this change would not break them.

It's also unclear why the dependency was removed in UE5 as our build farm is setup on 18362 since version 4.25.

Martin

@TBBle
Copy link
Collaborator

TBBle commented Sep 1, 2021

Those are all the same problem: It was fixed in 4.23.0 onwards by locally defining that macro's value. Given the date of the change (June 2019), I assume that came out of Epic validating the 18362 SDK, and 4.23 was the first release after that.

I had a quick poke around, and it seems this is indeed a bug in the Windows SDK 18362 onwards: A header was copied over from the Driver Development Kit to replace a block of (presumably hand-maintained) parallel definitions for the NDIS API version. However, the header relied on behaviour elsewhere to set some macros including NDIS_MINIPORT_MAJOR_VERSION based on a compile definition that a driver developer was required to use when compiling the driver.

Users of this header from user-space are also required to set a macro, but a different macro, and the replaced code only looked at that macro, not the other possible macros like NDIS_MINIPORT_MAJOR_VERSION.

Annoyingly, a much older (Windows 8) version of the DDK protected these checks with defined(NDIS_MINIPORT_MAJOR_VERSION), but I guess since driver authors were required to set the values, that check was removed.

I've no idea why UE4 is pulling in the NDIS driver userspace API. The closest I could find with GitHub searching is the WebRTC library's test suite pulls in ntddndis.h, but cursory inspection doesn't show any of the symbols from NDIS used there anyway.

Edit: I raised this as a report to MS, as best I could.

@slonopotamus
Copy link
Collaborator

Another update from Epics:

Martin Sevigny (Epic Games)

an hour ago
I confirmed that the change will get rolled in a future release of 4.27. You can just remove the references to the macro in the mean time.

So maybe we just... wait? :D

@slonopotamus
Copy link
Collaborator

slonopotamus commented Sep 1, 2021

Let's collect together what we have:

  1. Engines older than 4.23 do not build with SDK 18362 and they won't be fixed by Epics.
  2. 4.27 doesn't build with SDK 17763 (even though 5.0 does). This will be possibly fixed by Epics in following 4.27.x
  3. All engines from 4.23 up to 4.26 supposedly build with either SDK

What we can do:
a. Upgrade SDK to 18362 and drop support for pre-4.23 engines. Not sure. We don't have any stats on what engines users build with ue4-docker. @adamrehn do we have any policy on when we drop older engines?
b. Upgrade SDK to 18362 and patch pre-4.23 engines so they build.
c. Keep SDK at 17763 and wait until Epics fix 4.27.x. Obviosly, 4.27.0 will continue to be broken.
d. Keep SDK at 17763 and patch 4.27 so it builds.
e. Use different SDKs depending on engine. The problem is ue4-build-prerequisites is currently engine-agnostic. If we move installation of build tools out of it, we will have to install build tools twice: into ue4-source and into ue4-minimal. I don't like that at all. Alternatively, we need to make separate ue4-build-prerequisites with different SDKs. This doesn't play well with custom engine versions: we don't know MAJOR.MINOR until we clone engine sources and that only happens in ue4-source.
f. Suggest your own.

I'm leaning towards option B, given that this is a one-liner that @TBBle linked

@TBBle
Copy link
Collaborator

TBBle commented Sep 1, 2021

Certainly build-system patches not untrodden ground for this project, so I'd prefer B too from this list. I think it's more maintainable to meet current environment expectations and patch old, unchanging versions, than continuously patch newer versions back to older environments.

We could perhaps do D but as a build-system patch (i.e. like B, but setting WINAPI_PARTITION_GAMES=0) as that only affects one specific version. That's particularly suitable if we wanted to do that temporarily until 4.27.1 ships a fix and then blacklist 4.27.0 and drop our patch.

@slonopotamus
Copy link
Collaborator

slonopotamus commented Sep 1, 2021

Oh, I forgot one more aspect. We can have different SDKs for VS2017 and VS2019. And this does make sense because newer engines (UE5) already dropped VS2017 support and they will definitely drop SDK 17763 sooner or later.

So, option G: use newer SDK for VS2019 ue4-build-prerequisites. Claim that broken 4.27.0 is only supported for VS2019.

I think I like this option the most.

P.S. VS2019 is supported since 4.25 that already contains a fix for SDK >= 18362.

@slonopotamus
Copy link
Collaborator

I've implemented option G in #195.

slonopotamus added a commit to slonopotamus/ue4-docker that referenced this issue Sep 1, 2021
@slonopotamus slonopotamus changed the title Failing to build UE4.27 image on windows. 4.27.0 on Windows fails with: error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro Sep 7, 2021
@slonopotamus slonopotamus changed the title 4.27.0 on Windows fails with: error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro 4.27.0 on Windows fails with error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro Sep 7, 2021
@slonopotamus
Copy link
Collaborator

Epics fixed 4.27.x to compile against Windows SDK older than 18362: https://github.com/EpicGames/UnrealEngine/commit/1abe97fc35ff45f2138419469faf9e85f1057930

@slonopotamus slonopotamus changed the title 4.27.0 on Windows fails with error C4668: 'NDIS_MINIPORT_MAJOR_VERSION' is not defined as a preprocessor macro 4.27.0 on Windows fails with error C4668: 'WINAPI_PARTITION_GAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants