Skip to content

CG2 test followups #106929

Open
Open
@am11

Description

@am11

#80154 followups:

  • __TestBuildMode: crossgen2 (as in git grep __TestBuildMode.*crossgen2) should use helix so we can revert 2324602 (i.e. use published crossgen2.exe instead of dotnet crossgen2.dll)

  • Crossgen2Tool (as in git grep '<Crossgen2Tool' should similarly use published crossgen2.exe instead of crossgen2.dll and while working on it, we should deduplicate

      runtime/src/tasks/Crossgen2Tasks/PrepareForReadyToRunCompilation.cs
      runtime/src/tasks/Crossgen2Tasks/ResolveReadyToRunCompilers.cs
      runtime/src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs
    

    and

      sdk/src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs
      sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs
      sdk/src/Tasks/Microsoft.NET.Build.Tasks/RunReadyToRunCompiler.cs
    
  • Remove apphost.exe requirement from crossgen2_publish; some ResolveFrameworkRef.. type of target make it mandatory during the publish. It will allow us to delete this two-step workaround

    <MakeDir Condition="'$(Crossgen2Supported)' == 'true'" Directories="$(ArtifactsObjDir)coreclr\crossgen2_publish\$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)" />
    <Copy
    SourceFiles="$(_apphostPath)"
    DestinationFiles="$(ArtifactsObjDir)coreclr\crossgen2_publish\$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)\apphost$(ExeSuffix)"
    Condition="'$(Crossgen2Supported)' == 'true'" />

  • Integrate src/tests/build.sh/cmd with top-level build.sh/cmd, so when we use build.sh -c release -rc checked, the corresponding test command is src/tests/build.sh -release -p:RuntimeConfiguration=checked instead of what we have now src/tests/build.sh -checked -p:LibrariesConfiguration=release. This will allow us to remove workaround like

    <!-- Copy apphost to crossgen2_publish directory.
    The default configuration between product and tests are flipped. When we build project like:
    `build -c debug -rc checked`, the corresponding test command is `src/tests/build -checked -p:LibrariesConfiguration=debug`,
    instead of `-debug -p:RuntimeConfiguration=checked`. That forces us to either pass the
    `HostConfiguration=debug` explicitly or fix this disparity; both of which will break the dev workflow.
    As a workaround, we will first check if the directory pointed by `HostConfiguration` exists, then check
    `LibrariesConfiguration`.
    -->
    <PropertyGroup Condition="'$(Crossgen2Supported)' == 'true'">
    <_targetOS>$(TargetOS)</_targetOS>
    <_targetOS Condition="'$(_targetOS)' == 'windows'">win</_targetOS>
    <_apphostPath Condition="Exists('$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(HostConfiguration)\corehost\apphost$(ExeSuffix)')">$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(HostConfiguration)\corehost\apphost$(ExeSuffix)</_apphostPath>
    <_apphostPath Condition="'$(_apphostPath)' == '' and Exists('$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(LibrariesConfiguration)\corehost\apphost$(ExeSuffix)')">$(ArtifactsBinDir)$(_targetOS)-$(TargetArchitecture).$(LibrariesConfiguration)\corehost\apphost$(ExeSuffix)</_apphostPath>
    <_toolsConfiguration Condition="Exists('$(ArtifactsBinDir)ILLink.Tasks\$(ToolsConfiguration)\$(NetCoreAppToolCurrent)\ILLink.Tasks.dll')">$(ToolsConfiguration)</_toolsConfiguration>
    <_toolsConfiguration Condition="Exists('$(ArtifactsBinDir)ILLink.Tasks\$(LibrariesConfiguration)\$(NetCoreAppToolCurrent)\ILLink.Tasks.dll')">$(LibrariesConfiguration)</_toolsConfiguration>
    </PropertyGroup>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions