C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(230,5): error MSB8065: Custom build for item "D:\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\CMakeFiles\8c5af364b615efc1be57a6c3114709e4\INSTA
LL_force.rule" succeeded, but specified output "d:\corefx\artifacts\obj\native\netcoreapp-windows_nt-debug-x64\cmakefiles\install_force" has not been created. This may cause incremental build to work incorrectly. [D:\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug
-x64\install.vcxproj] [D:\corefx\src\Native\build-native.proj]
The build shows as failed even though it didn't really fail because the native step produced a warning so it keeps going. (We might need to propagate the TreatWarningsAsErrors to the native build command), but that is not the real issue there.
cc: @ViktorHofer @ericstj
FYI: @carlossanlop
Something must have changed on the VS's side. Let's keep this open and investigate further if this still happens with a later 16.4-preview version.
We might need to propagate the TreatWarningsAsErrors to the native build command
Sounds good but let's not do this before the issue disappeared.
Update: after an investigation, I think this is a cmake issue where the generated project is not doing the right thing. So basically they define some CustomBuild commands which are executed by MSBuild targets and they define an input and an output. However, the command that is defined in the generated vcxproj is a nop, hence it doesn't produce any output.
Why was it not warning before? I cracked opened the MSBuild tasks dll for the new VS preview, it seems like they added validation that the CustomBuild command actually produces the output it states it does, so that is why now we get a warning.
We could change the model on how we build and install the native lib, by instead of calling MSBuild directly on install.vcxproj, we could call
cmake --build <dir> --config <cfg>
cmake --install <dir> --config <cfg>
However I don't know how much warnings or msbuild output we would lose by doing that.
In the meantime I opened an issue on cmake: https://gitlab.kitware.com/cmake/cmake/issues/19737
So while I get a response, I think we should explicitly set TreatWarningsAsErrors=false when doing the native build in order to avoid confusing people, as a lot people has reached me asking why the build is failing, thinking it actually failed when it didn't.
CMake has merged the fix and apparently is going to make it to the next release of 3.15 -- I will follow their releases and close this issue once the fix is publicly accessible by installing a new version of cmake.
Hi. Form me, the issue remains for CMake 3.15.3.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(230,5): error MSB8065: Custom build for item "D:\Sources\NetFoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\CMakeFiles\af7b5fb01ed3438277a908fb1341432f\INSTALL_force.rule" succeeded, but specified output "d:\sources\netfoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-windows_nt-debug-x64\cmakefiles\install_force" has not been created. This may cause incremental build to work incorrectly. [D:\Sources\NetFoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\install.vcxproj] [D:\Sources\NetFoundation\dotnet\corefx\src\Native\build-native.proj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(230,5): error MSB8065: Custom build for item "D:\Sources\NetFoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\CMakeFiles\af7b5fb01ed3438277a908fb1341432f\INSTALL_force.rule" succeeded, but specified output "d:\sources\netfoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-windows_nt-debug-x64\cmakefiles\install_force" has not been created. This may cause incremental build to work incorrectly. [D:\Sources\NetFoundation\dotnet\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\install.vcxproj] [D:\Sources\NetFoundation\dotnet\corefx\src\Native\build-native.proj]
Seems the issue is linked to VS 2019 16.4.0 Preview 1.0
Hi. Form me, the issue remains for CMake 3.15.3.
That is expected, the fix will be part of CMake 3.15.4 -- I don't know when it is expected to release, but from looking at the Milestone assigned to the issue I filed: https://gitlab.kitware.com/cmake/cmake/issues/19737 that milestone was done yesterday, so the release should be soon.
@safern Unfortunately the bug remains for 3.15.4
@safern Unfortunately the bug remains for 3.15.4
Thanks, @Simon-IT, unfortunately the fix was incomplete and was not done for built-in cmake targets, like install target (which is the one we're hitting it on). The issue I linked above, was re-opened and assigned a 3.16.0 milestone, so we will have to wait until a new fix, unfortunately :cry:
Thanks @safern for the support...
FWIW, 3.16.0-rc1 is available and I do not see the errors with it installed.
Thanks for testing @Gnbrkm41. I just updated the docs (https://github.com/dotnet/corefx/commit/81c91fab23b26592334ac6ff4bef34f102e3c3ce) and close this issue as fixed.
Most helpful comment
FWIW, 3.16.0-rc1 is available and I do not see the errors with it installed.