adamrehn / ue4-docker

Windows and Linux containers for Unreal Engine 4
https://docs.adamrehn.com/ue4-docker/
MIT License
788 stars 173 forks source link

UE4 requires the NuGet Package Manager #8

Closed Ludea closed 6 years ago

Ludea commented 6 years ago

I success to build the first two images on windows server 1804. But in the third, I have, at step 7 an error message . UE4 requires the NuGet Package Manager to be installed to use "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe". Please run the Visual Studio Installer and add it from the individual components list (in the 'Code Tools' category).

Maybe you have to include Nuget Package Manager into the first container ?

adamrehn commented 6 years ago

This appears to be related to the recent release of Visual Studio 2017 version 15.8, since this error does not occur when using a build of the ue4-build-prerequisites image from a few weeks ago that contains version 15.7.6 of the Build Tools. Presumably Microsoft have altered the dependency lists in such a way that the NuGet Package Manager is no longer a required dependency of the default selected installation workloads.

I have modified the Build Tools installation command to explicitly specify the required installation workloads and components, including the component ID for the NuGet Package Manager. This ensures that NuGet is always installed, and should be less brittle in the face of future Visual Studio updates. As an added bonus, this has also reduced the overall size of the ue4-build-prerequisites image by about 15GB, since only the required installation workloads are selected.

To utilise this fix, you will need to pull the latest version of the Dockerfiles and rebuild all images by specifying the --rebuild parameter when invoking the build script.

Ludea commented 6 years ago

I have still the same issue, but with a different path C:\BuildTools\MSBuild\15.0\Bin\MSBuild.exe". Please run the Visual Studio Installer and add it from the individual components list (in the 'Code Tools' category).

adamrehn commented 6 years ago

To help provide more information for debugging purposes, can you please perform the following steps:

Ludea commented 6 years ago

I already delete all images and containers. The command I use : python build.py --no-capture --no-package --random-memory --rebuild 4.20.2

adamrehn commented 6 years ago

Can you provide the complete log output from running that command please?

Ludea commented 6 years ago

[build.py] Building image "adamrehn/ue4-build-prerequisites:latest"...

[build.py] Building image "adamrehn/ue4-source:4.20.2"... Sending build context to Docker daemon 3.584kB Step 1/12 : ARG PREREQS_TAG ---> Step 2/12 : FROM adamrehn/ue4-build-prerequisites:${PREREQS_TAG} ---> 22a4bfaecfd5 Step 3/12 : ARG GIT_REPO="" ---> Using cache ---> a6854663f2a4 Step 4/12 : ARG GIT_BRANCH="" ---> Using cache ---> 668f735edecb Step 5/12 : ARG HOST_ADDRESS_ARG="" ---> Using cache ---> 8a4386950125 Step 6/12 : ENV HOST_ADDRESS ${HOST_ADDRESS_ARG} ---> Using cache ---> 7c871a72c24b Step 7/12 : ARG HOST_TOKEN_ARG="" ---> Using cache ---> 9d3e52f058fc Step 8/12 : ENV HOST_TOKEN ${HOST_TOKEN_ARG} ---> Running in 5d580baf02cf ---> ee5e3e254b89 Removing intermediate container 5d580baf02cf Step 9/12 : COPY git-credential-helper.bat C:\git-credential-helper.bat ---> 893f0c33891c Removing intermediate container d4161c12e2b3 Step 10/12 : ENV GIT_ASKPASS C:\git-credential-helper.bat ---> Running in 4e40e134a17f ---> d361954c1256 Removing intermediate container 4e40e134a17f Step 11/12 : WORKDIR C:\ ---> 0c051025c11b Removing intermediate container 6272c7718aa8 Step 12/12 : RUN git clone --progress --depth=1 -b %GIT_BRANCH% %GIT_REPO% C:\UnrealEngine ---> Running in b1048e273911 Cloning into 'C:\UnrealEngine'... remote: Counting objects: 85912, done. remote: Compressing objects: 100% (67970/67970), done. remote: Total 85912 (delta 17914), reused 62836 (delta 15848), pack-reused 0 Receiving objects: 100% (85912/85912), 186.61 MiB | 565.00 KiB/s, done. Resolving deltas: 100% (17914/17914), done. Checking connectivity: 85912, done. Note: checking out '8696faa54bf2f89ca50d34e6fb3dcc461a810185'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

Checking out files: 100% (92676/92676), done. ---> f8c03f865382 Removing intermediate container b1048e273911 Successfully built f8c03f865382 Successfully tagged adamrehn/ue4-source:4.20.2 [build.py] Built image "adamrehn/ue4-source:4.20.2" in 3 hours, 9 minutes and 55.11 seconds

[build.py] Building image "adamrehn/ue4-build:4.20.2"... Sending build context to Docker daemon 4.608kB Step 1/12 : ARG TAG ---> Step 2/12 : FROM adamrehn/ue4-source:${TAG} ---> f8c03f865382 Step 3/12 : COPY patch-setup-win.py C:\patch-setup-win.py ---> ff8c6e2b5fd9 Removing intermediate container 1c3d4bcc0e6a Step 4/12 : RUN python C:\patch-setup-win.py C:\UnrealEngine\Setup.bat ---> Running in 9ac10ca01ca3 PATCHED C:\UnrealEngine\Setup.bat:

@echo off setlocal pushd %~dp0

rem Figure out if we should append the -prompt argument set PROMPT_ARGUMENT= for %%P in (%) do if /I "%%P" == "--prompt" goto no_prompt_argument for %%P in (%) do if /I "%%P" == "--force" goto no_prompt_argument set PROMPT_ARGUMENT=--prompt :no_prompt_argument

rem Sync the dependencies... .\Engine\Binaries\DotNET\GitDependencies.exe %PROMPT_ARGUMENT% %* if ERRORLEVEL 1 goto error

rem Setup the git hooks... if not exist .git\hooks goto no_git_hooks_directory echo Registering git hooks... echo #!/bin/sh >.git\hooks\post-checkout echo Engine/Binaries/DotNET/GitDependencies.exe % >>.git\hooks\post-checkout echo #!/bin/sh >.git\hooks\post-merge echo Engine/Binaries/DotNET/GitDependencies.exe % >>.git\hooks\post-merge :no_git_hooks_directory

rem Install prerequisites... echo (Skipping installation of prerequisites) @rem start /wait Engine\Extras\Redist\en-us\UE4PrereqSetup_x64.exe /quiet

rem Register the engine installation... if not exist .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe goto :no_unreal_version_selector @rem .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe /register :no_unreal_version_selector

echo Done! exit /b 0 goto :EOF

rem Error happened. Wait for a keypress before quitting. :error @rem pause

---> 3ccd632d9bbb Removing intermediate container 9ac10ca01ca3 Step 5/12 : WORKDIR C:\UnrealEngine ---> 14ad05cbb783 Removing intermediate container 2a5f1a068f1b Step 6/12 : RUN Setup.bat ---> Running in fae9af85f4bf Checking dependencies (excluding Mac, Android, Linux)... Updating dependencies: 100% (34085/34085), 5554.9/5554.9 MiB | 0.86 MiB/s, done. Registering git hooks... (Skipping installation of prerequisites) Done! ---> 7158ebccc8dd Removing intermediate container fae9af85f4bf Step 7/12 : RUN GenerateProjectFiles.bat ---> Running in ed10d9f6d843 Setting up Unreal Engine 4 project files...

UE4 requires the NuGet Package Manager to be installed to use "C:\BuildTools\MSBuild\15.0\Bin\MSBuild.exe". Please run the Visual Studio Installer and add it from the individual components list (in the 'Code Tools' category).

Press any key to continue . . . The command 'cmd /S /C GenerateProjectFiles.bat' returned a non-zero code: 1 [build.py] Error: failed to build image "adamrehn/ue4-build:4.20.2".

I will do a docker system prune and rebuild all (for 3 times)

Ludea commented 6 years ago

I re build (4 times) and seems to work ! The script success to build engine !