locked
Incremental builds for .vcxproj build customizations broken in recent updates? RRS feed

  • Question

  • I am seeing an issue in recent updates of VS 2017 where incremental builds do not work for files that are built with a build customization. This has worked with my build customization for every version of VS including the original release of VS 2017, but no longer works in recent updates (eg, update 8).

    This can be reproduced with the Microsoft MASM build customization (I have a project that reproduces this but I do not see a way to attach .zip files to posts):

    1. Create a new VC++ project.
    2. Add the MASM build customization to the project.
    3. Add a .asm file, build project.
    4. Edit the .asm file, build project again.
    5. Result: It says the project is up-to-date, it does not rebuild.

    Is this a bug in VS or does a change need to be made to support incremental builds now?


    • Edited by ewells Friday, October 26, 2018 3:32 PM
    Friday, October 26, 2018 3:31 PM

Answers

  • Sorry, in Vs2017 vc Up-To-Date check has changed to rely only on tlogs produced during build and not check all project items (as it was causing a number of problems). Please create read and write tlogs in your custom targets.

    For more info about tlog files see

    https://docs.microsoft.com/en-us/visualstudio/extensibility/visual-cpp-project-extensibility?view=vs-2017#incremental-builds-and-up-to-date-checks

    You can also use GetOutOfDateItems task implemented in Microsoft.Cpp.Common.Tasks.dll (since 15.8). It will create tlogs and returns the items which need to be rebuilt. 

    The source items are supposed to have metadata for dependencies, outputs and command (if there is no command, use outputs there):

    <GetOutOfDateItems
    Condition ="'$(SelectedFiles)' == ''"
    Sources ="@(MyItems)"
    OutputsMetadataName ="Outputs"
    DependenciesMetadataName ="AdditionalInputs"
    CommandMetadataName ="Command"
    TLogDirectory ="$(TLogLocation)"
    TLogNamePrefix ="MyTargetName"
    >
    <Output TaskParameter="OutOfDateSources" ItemName="MyOutOfDateItems"/>
    </GetOutOfDateItems>

    The MASM rule targets were updated to create tlogs in 15.6 and I cannot repro the problem using the steps you gave. Are you by chance using old version of the masm build rule? If not, can you please create an issue in VS feedback and attach your repro project there?

    • Marked as answer by ewells Thursday, December 6, 2018 5:30 PM
    Thursday, November 29, 2018 5:47 AM

All replies

  • Sorry, in Vs2017 vc Up-To-Date check has changed to rely only on tlogs produced during build and not check all project items (as it was causing a number of problems). Please create read and write tlogs in your custom targets.

    For more info about tlog files see

    https://docs.microsoft.com/en-us/visualstudio/extensibility/visual-cpp-project-extensibility?view=vs-2017#incremental-builds-and-up-to-date-checks

    You can also use GetOutOfDateItems task implemented in Microsoft.Cpp.Common.Tasks.dll (since 15.8). It will create tlogs and returns the items which need to be rebuilt. 

    The source items are supposed to have metadata for dependencies, outputs and command (if there is no command, use outputs there):

    <GetOutOfDateItems
    Condition ="'$(SelectedFiles)' == ''"
    Sources ="@(MyItems)"
    OutputsMetadataName ="Outputs"
    DependenciesMetadataName ="AdditionalInputs"
    CommandMetadataName ="Command"
    TLogDirectory ="$(TLogLocation)"
    TLogNamePrefix ="MyTargetName"
    >
    <Output TaskParameter="OutOfDateSources" ItemName="MyOutOfDateItems"/>
    </GetOutOfDateItems>

    The MASM rule targets were updated to create tlogs in 15.6 and I cannot repro the problem using the steps you gave. Are you by chance using old version of the masm build rule? If not, can you please create an issue in VS feedback and attach your repro project there?

    • Marked as answer by ewells Thursday, December 6, 2018 5:30 PM
    Thursday, November 29, 2018 5:47 AM
  • Thanks, updating the build customization to generate tlog files resolved the issue.
    Thursday, December 6, 2018 5:31 PM