Skip to content

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

Closed

Description

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

Activity

  1. ViktorHofer commented on Sep 13, 2019

    @ViktorHofer
    Member

    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.

  2. self-assigned this
    on Sep 18, 2019
  3. safern commented on Sep 19, 2019

    @safern
    MemberAuthor

    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.

  4. safern commented on Sep 25, 2019

    @safern
    MemberAuthor

    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.

  5. Simon-IT commented on Oct 1, 2019

    @Simon-IT

    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

  6. safern commented on Oct 1, 2019

    @safern
    MemberAuthor

    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.

  7. Simon-IT commented on Oct 4, 2019

    @Simon-IT

    @safern Unfortunately the bug remains for 3.15.4

  8. safern commented on Oct 7, 2019

    @safern
    MemberAuthor

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

  9. Simon-IT commented on Oct 8, 2019

    @Simon-IT

    Thanks @safern for the support...

  10. Gnbrkm41 commented on Oct 14, 2019

    @Gnbrkm41
    Contributor

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

  11. ViktorHofer commented on Oct 14, 2019

    @ViktorHofer
    Member

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

  12. transferred this issue fromdotnet/corefxon Feb 1, 2020
  13. added this to the 5.0 milestone on Feb 1, 2020
  14. ghost locked as resolved and limited conversation to collaborators on Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions