Skip to content
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

Corefx native build produces a warning on latest VS Preview (16.4.0 Preview 1.0 29311.250) #30845

Closed
safern opened this issue Sep 12, 2019 · 10 comments

Comments

@safern
Copy link
Member

safern commented Sep 12, 2019

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

@ViktorHofer
Copy link
Member

ViktorHofer commented Sep 13, 2019

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.

@safern safern self-assigned this Sep 18, 2019
@safern
Copy link
Member Author

safern commented Sep 19, 2019

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.

@safern
Copy link
Member Author

safern commented Sep 25, 2019

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.

@Simon-IT
Copy link

Simon-IT commented Oct 1, 2019

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

@safern
Copy link
Member Author

safern commented Oct 1, 2019

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.

@Simon-IT
Copy link

Simon-IT commented Oct 4, 2019

@safern Unfortunately the bug remains for 3.15.4

@safern
Copy link
Member Author

safern commented Oct 7, 2019

@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 😢

@Simon-IT
Copy link

Simon-IT commented Oct 8, 2019

Thanks @safern for the support...

@Gnbrkm41
Copy link
Contributor

FWIW, 3.16.0-rc1 is available and I do not see the errors with it installed.

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 14, 2019

Thanks for testing @Gnbrkm41. I just updated the docs (dotnet/corefx@81c91fa) and close this issue as fixed.

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 5.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants