Cloud Gem Create Bug

Aloha,

I am having an issue with the cloud-gem create function. I have attempted this twice using 1.20 and both times ended with the same result.

The gem creation seems to work fine, however when I then rebuild the project I come up with an error indicating that the _precompiled.h file cannot be found. To fix this I attempted to manually create the missing file and link it in the appropriate waf, but to no avail. Ultimately I had to uninstall Lumberyard and try again with a new install. I tried again to create a new cloud gem and I ended up with the exact same results on the new install. Below is a copy of the error output of both attempts.

1st attempt:

1>testGemClientComponent.cpp
1>
1>c:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp(20): fatal error C1083: Cannot open include file: 'testGem_precompiled.h': No such file or directory

1>Build failed
1><++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
1>Compilation failed - File: ‘testGemClientComponent.cpp.723109.obj’, Module: ‘testGem’, Configuration: ‘win_x64_vs2017|profile’, error code 2
1> Input Files: ‘c:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp’
1> Output Files: ‘c:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp.723109.obj’
1> Command: ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\CL.exe /bigobj /nologo /W3 /WX /MP /Gy /GF /Gm- /fp:fast /Zc:wchar_t /Zc:forScope /Gd /Zc:inline /wd4530 /wd4577 /FS /Ox /Ob2 /Ot /Oi /Oy- /GR- /showIncludes /MD /Z7 /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testGem\v1\Code /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code /IC:\Amazon\Lumberyard\1.20\3rdParty\boost\1.61.0-az.2 /Ic:\Amazon\Lumberyard\1.20\dev\Code\CryEngine\CryCommon /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\Source /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CloudGemFramework\v1\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CloudCanvasCommon\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\AzCore /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\AzCore /IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include /IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /IC:\Amazon\Lumberyard\1.20\3rdParty\AWS\AWSNativeSDK\1.4.34.3\include /IC:\Amazon\Lumberyard\1.20\3rdParty\OpenSSL\1.1.1b-noasm\include /IC:\Amazon\Lumberyard\1.20\3rdParty\rapidjson\rapidjson-1.0.2.1\include /IC:\Amazon\Lumberyard\1.20\3rdParty\rapidxml\1.13-modified.1\include /IC:\Amazon\Lumberyard\1.20\3rdParty\Lua\5.1.1.8-az /IC:\Amazon\Lumberyard\1.20\3rdParty\zlib\1.2.8-pkg.2\include /DPRODUCT_SKU_default /D_WIN32 /D_WIN64 /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_ENABLE_EXTENDED_ALIGNED_STORAGE /D_PROFILE /DPROFILE /DNDEBUG /DAZ_ENABLE_TRACING /DAZ_ENABLE_DEBUG_TOOLS /DSCRIPTCANVAS_ERRORS_ENABLED /DEXE_VERSION_INFO_0=1 /DEXE_VERSION_INFO_1=20 /DEXE_VERSION_INFO_2=0 /DEXE_VERSION_INFO_3=0 /DPLATFORM_SUPPORTS_AWS_NATIVE_SDK /DUSE_WINDOWS_DLL_SEMANTICS /DLY_BUILD=934666 /D_MT /D_DLL /DLY_METRICS_BUILD_TIME=0 /DAWS_CUSTOM_MEMORY_MANAGEMENT /DUSE_IMPORT_EXPORT /DOPENSSL_ENABLED c:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp /c /Fo c:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp.723109.obj’
1> Output:
1> testGemClientComponent.cpp
1>c:\Amazon\Lumberyard\1.20\dev\Gems\testGem\v1\Code\AWS\ServiceApi\testGemClientComponent.cpp(20): fatal error C1083: Cannot open include file: ‘testGem_precompiled.h’: No such file or directory
1><++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
1>

2nd Attempt:

c:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp(20): fatal error C1083: Cannot open include file: ‘testCloudGem_precompiled.h’: No such file or directory
1>Build failed
1><++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
1>Compilation failed - File: ‘testCloudGemClientComponent.cpp.8095980.obj’, Module: ‘testCloudGem’, Configuration: ‘win_x64_vs2017|profile’, error code 2
1> Input Files: ‘c:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp’
1> Output Files: ‘c:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp.8095980.obj’
1> Command: ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\CL.exe /bigobj /nologo /W3 /WX /MP /Gy /GF /Gm- /fp:fast /Zc:wchar_t /Zc:forScope /Gd /Zc:inline /wd4530 /wd4577 /FS /Ox /Ob2 /Ot /Oi /Oy- /GR- /showIncludes /MD /Z7 /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testCloudGem\v1\Code /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code /IC:\Amazon\Lumberyard\1.20\3rdParty\boost\1.61.0-az.2 /Ic:\Amazon\Lumberyard\1.20\dev\Code\CryEngine\CryCommon /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\Source /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CloudGemFramework\v1\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CloudCanvasCommon\Code\Include /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\AzFramework /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\GridMate /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.20\dev\Gems\CryLegacy\Code\Source\CryAction /Ic:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Code\Framework\AzCore /Ic:\Amazon\Lumberyard\1.20\dev\Code\Framework\AzCore /IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include /IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt /IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt /IC:\Amazon\Lumberyard\1.20\3rdParty\AWS\AWSNativeSDK\1.4.34.3\include /IC:\Amazon\Lumberyard\1.20\3rdParty\OpenSSL\1.1.1b-noasm\include /IC:\Amazon\Lumberyard\1.20\3rdParty\rapidjson\rapidjson-1.0.2.1\include /IC:\Amazon\Lumberyard\1.20\3rdParty\rapidxml\1.13-modified.1\include /IC:\Amazon\Lumberyard\1.20\3rdParty\Lua\5.1.1.8-az /IC:\Amazon\Lumberyard\1.20\3rdParty\zlib\1.2.8-pkg.2\include /DPRODUCT_SKU_default /D_WIN32 /D_WIN64 /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_ENABLE_EXTENDED_ALIGNED_STORAGE /D_PROFILE /DPROFILE /DNDEBUG /DAZ_ENABLE_TRACING /DAZ_ENABLE_DEBUG_TOOLS /DSCRIPTCANVAS_ERRORS_ENABLED /DEXE_VERSION_INFO_0=1 /DEXE_VERSION_INFO_1=20 /DEXE_VERSION_INFO_2=0 /DEXE_VERSION_INFO_3=0 /DPLATFORM_SUPPORTS_AWS_NATIVE_SDK /DUSE_WINDOWS_DLL_SEMANTICS /DLY_BUILD=934666 /D_MT /D_DLL /DLY_METRICS_BUILD_TIME=0 /DAWS_CUSTOM_MEMORY_MANAGEMENT /DUSE_IMPORT_EXPORT /DOPENSSL_ENABLED c:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp /c /Fo c:\Amazon\Lumberyard\1.20\dev\BinTemp\win_x64_vs2017_profile\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp.8095980.obj’
1> Output:
1> testCloudGemClientComponent.cpp
1>c:\Amazon\Lumberyard\1.20\dev\Gems\testCloudGem\v1\Code\AWS\ServiceApi\testCloudGemClientComponent.cpp(20): fatal error C1083: Cannot open include file: ‘testCloudGem_precompiled.h’: No such file or directory

Ultimately I can no longer access the projects in which I created these gems as they will no longer build.

Thank you for looking into this.

Can you describe how you are creating the gem?

By default if you create the Gem via the ProjectConfigurator EnableGems -> Create a New Gem, you should see your wscript has a PCH disabled ie

def build(bld):
bld.DefineGem(
# General
disable_pch = True,

It could be you have a different waf setting here or elsewhere that is trying to override this. But the component.cpp file generated does not appear to pull in precompiled headers for Gems created this way.

Thanks Pip, I am using the lmbr_aws cloud-gem create function. disable_pch is set to True in the wcscript as well.

Trying to re-create this issue locally to see if we can reproduce.

Can you confirm your exact workflow?

  • lmbr_aws cloud-gem create --gem TestGem --initial-content bucket --enable
  • lmbr_waf configure
  • lmbr_waf build_win_x64_vs2017_profile -p all

Am interested what you are using for --intial-content, looks like it could be api-lambda but want to be sure

Hi Pip, thanks again for looking into this for me.

  1. lmbr_aws cloud-gem create --gem testGem --initial-content api-lambda-dynamodb --enable
  2. lmbr_waf configure
  3. Build from within VS

I see that #include “TestGemLambda_precompiled.h” statement now being generated in the ClientComponent.h with either api-lambda or api-lambda-dynamodb

Definitely a bug. You can workaround by:

  • Deleting the two #include “TestGemLambda_precompiled.h” lines (in the cpp/.h)
  • Adding in #include <platform_impl.h> in the Client Component header

Will file a bug to get this fixed asap.

Apologies for the inconvenience, seems that the move to turn off PCH here was not reflected by the code generator for CloudGems

Awesome, thanks Pip. Just prior to your response I erased all reference to the gem for now and am attempting a rebuild. If that does not work I will try the workaround you offered and let you know. Aloha