PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[Settings & Launcher] Clean no longer works

Open arjunbalgovind opened this issue 4 years ago • 4 comments

From the changes in #2759 , disabling IncrementalClean causes Clean to no longer work for those projects. The target would have to be tweaked a bit to fix it.

arjunbalgovind avatar May 08 '20 16:05 arjunbalgovind

Tried out the following approaches, but they didn't work. This issue still remains for the settings project. In all the cases, it seems like we hit either the double compilation issue or the clean not working issue.

  1. The present approach that we have for the settings Runner project is that the IncrementalClean step is overridden with an empty target so that we no longer face the double compilation issue. Since the same incremental clean step is used as a depency Target for Clean, clean does not work as expected.

  2. I tried to include the following in the Directory.Build.props file.

<Project>
   <Target
     Name="ForceAssignProjectConfigurationBeforeSplitProjectReferencesByFileExistence_KLUDGE" 
     BeforeTargets="_SplitProjectReferencesByFileExistence" 
     DependsOnTargets="AssignProjectConfiguration" />
</Project>

This solved the incremental clean issue but it still had the double compilation issue.

  1. The next approach that I tried was to remove the incrementalClean target from the CoreBuild target dependencies. This fixed the double compilation issue but Clean was still not working as expected.
<PropertyGroup>
    <CoreBuildDependsOn>
      BuildOnlySettings;
      PrepareForBuild;
      PreBuildEvent;
      ResolveReferences;
      PrepareResources;
      ResolveKeySource;
      Compile;
      ExportWindowsMDFile;
      UnmanagedUnregistration;
      GenerateSerializationAssemblies;
      CreateSatelliteAssemblies;
      GenerateManifests;
      GetTargetPath;
      PrepareForRun;
      UnmanagedRegistration;
      PostBuildEvent
    </CoreBuildDependsOn>
  </PropertyGroup>
  <Target
      Name="CoreBuild"
      DependsOnTargets="$(CoreBuildDependsOn)">

    <OnError ExecuteTargets="_TimeStampAfterCompile;PostBuildEvent" Condition="'$(RunPostBuildEvent)'=='Always' or '$(RunPostBuildEvent)'=='OnOutputUpdated'"/>
    <OnError ExecuteTargets="_CleanRecordFileWrites"/>

  </Target>
  1. The other approach that I tried was to override the CleanDependsOn Property as follows -
  <PropertyGroup>
    <CleanDependsOn>
        $(CleanDependsOn);
        CustomClean
    </CleanDependsOn>
  </PropertyGroup>

  <Target Name="CustomClean"
          DependsOnTargets="_CleanGetCurrentAndPriorFileWrites" />

The idea behind this was that we depend on the same targets that Incremental Clean used to depend on ie. _CleanGetCurrentAndPriorFileWrites. Ideally this should work as we are implementing a custom target which behaved just like incremental clean and are calling it when the Clean target is triggered. However, even this did not fix the clean issue.

alekhyareddy28 avatar Jul 23 '20 00:07 alekhyareddy28

Moving it to v1 as the double compilation issue exists when incremental clean is removed as stated above. This issue would be solved when we switch to WinUI 3.

alekhyareddy28 avatar Jul 24 '20 19:07 alekhyareddy28

@arjunbalgovind @alekhyareddy28 Is this still a thing?

Jay-o-Way avatar Sep 29 '22 15:09 Jay-o-Way

/needinfo

jaimecbernardo avatar Nov 15 '22 11:11 jaimecbernardo

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

ghost avatar Nov 20 '22 14:11 ghost