Skip to content

System.Private.CoreLib's fast up-to-date check is broken #68698

Closed

Description

@ViktorHofer

When building System.Runtime's src project, which depends on System.Private.CoreLib without making any changes to any of the assemblies, Systme.Private.CoreLib always incrementally builds:

1>------ Build started: Project: System.Private.CoreLib, Configuration: Debug x64 ------
1>System.Private.CoreLib -> C:\git\runtime5\artifacts\bin\coreclr\windows.x64.Debug\IL\System.Private.CoreLib.dll
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========

1>------ Build started: Project: System.Private.CoreLib, Configuration: Debug x64 ------
1>System.Private.CoreLib -> C:\git\runtime5\artifacts\bin\coreclr\windows.x64.Debug\IL\System.Private.CoreLib.dll
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========

1>------ Build started: Project: System.Private.CoreLib, Configuration: Debug x64 ------
1>System.Private.CoreLib -> C:\git\runtime5\artifacts\bin\coreclr\windows.x64.Debug\IL\System.Private.CoreLib.dll
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========

This shouldn't happen as Visual Studio caches inputs and outputs and makes sure that a project's build isn't even triggered when nothing changed.

cc @dotnet/runtime-infrastructure @trylek @agocke @jkotas

Activity

  1. ghost added
    untriaged
    on Apr 29, 2022
  2. ViktorHofer commented on Apr 29, 2022

    @ViktorHofer
    MemberAuthor

    @drewnoakes @davkean is it possible to diagnose why the fast up-to-date check fails for System.Private.CoreLib via some knobs?

  3. ViktorHofer commented on Apr 29, 2022

    @ViktorHofer
    MemberAuthor

    I already found the relevant documentation: https://github.com/dotnet/project-system/blob/main/docs/up-to-date-check.md#sdk-style-projects.

    3>FastUpToDate: Output 'C:\git\runtime5\artifacts\bin\coreclr\windows.x64.Debug\IL\System.Private.CoreLib.pdb' does not exist, not up-to-date. (System.Private.CoreLib)
    
  4. ViktorHofer commented on Apr 29, 2022

    @ViktorHofer
    MemberAuthor

    Found the culprit. These two targets move the pdb from the build directory into a separate location and by that, invalidate the output:

    <!-- Target used to consolidate all PDBs into a single location, except the aotsdk
    PDBs, as S.P.C will overwrite the coreclr PDBs -->
    <Target Name="MoveSymbolFiles"
    AfterTargets="Build"
    Condition="Exists(@(_AllPdbs))"
    Inputs="@(_AllPdbs)"
    Outputs="@(_AllPdbs -> '$(RuntimeBinDir)PDB/%(Filename).pdb')">
    <Move SourceFiles="@(_AllPdbs)"
    DestinationFolder="$(RuntimeBinDir)PDB"
    Condition="'%(_AllPdbs.FolderName)' != 'aotsdk'" />
    </Target>
    <Target Name="MoveAotSymbolFiles"
    AfterTargets="Build"
    Condition="Exists(@(_AllPdbs))"
    Inputs="@(_AllPdbs)"
    Outputs="@(_AllPdbs -> '$(RuntimeBinDir)PDB/aotsdk/%(Filename).pdb')">
    <Move SourceFiles="@(_AllPdbs)"
    DestinationFolder="$(RuntimeBinDir)PDB/aotsdk"
    Condition="'%(_AllPdbs.FolderName)' == 'aotsdk'" />
    </Target>

    @trylek @agocke @jkotas does the pdb need to be moved or can it be copied instead?

  5. danmoseley commented on Apr 29, 2022

    @danmoseley
    Contributor

    The comment there mentions that they'd otherwise be overwritten. Are any outputs being updated in place? Moves and updates in place both make incremental build harder.

  6. jkotas commented on Apr 29, 2022

    @jkotas
    Member

    I would be even better to place the .pdbs into the right directory so that they do not have to be moved or copied.

    @agocke should be able to tell what can be done about this since he has investigated and changed this recently in #68063

  7. agocke commented on May 2, 2022

    @agocke
    Member

    Yeah, each could be placed in a separate directory for its project, I think. I was just working around the NativeAOT/IL S.P.C collision. The broad view is having separate directories, instead of just for AOT

  8. added this to the Future milestone on May 2, 2022
  9. removed
    untriaged
    on May 2, 2022
  10. ViktorHofer commented on May 2, 2022

    @ViktorHofer
    MemberAuthor

    If I have some time I would be willing to send a PR to fix this. @jkotas @agocke just to clarify, did you mean that the pdb should be placed into the $(RuntimeBinDir)PDB / $(RuntimeBinDir)PDB/aotsdk directory or that the pdb belongs into the output directory of System.Private.CoreLib and that whatever tool requires the pdbs, should look into the project's individual output directories?

  11. added a commit that references this issue on May 12, 2022
  12. ghost added
    in-pr
    on May 12, 2022
  13. ghost removed
    in-pr
    on May 12, 2022
  14. ghost locked as resolved and limited conversation to collaborators on Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-coreclr

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions