Skip to content

Conversation

@BrennanConroy
Copy link
Member

Don't require building the sharedfx in order to use RunHelix.ps1

@BrennanConroy BrennanConroy requested a review from dougbu July 21, 2021 21:57
@BrennanConroy BrennanConroy requested a review from a team as a code owner July 21, 2021 21:57
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jul 21, 2021
Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit scary because the shared Fx is required for a number of projects in the repo. I'd feel better about this if the change

  1. really were specific to the RunHelix.ps1 script (IncludeAspNetRuntime) is run for every Helix submission
  2. was controlled by a property that's set using a new RunHelix.ps1 option to opt out of including our shared Fx in the correlation payload

@BrennanConroy
Copy link
Member Author

This is a bit scary because the shared Fx is required for a number of projects in the repo.

This change effectively brings the script back to it's former state where it worked for tests that didn't need the shared Fx. The behavior regressed with the shared Fx work.

If you need the shared fx there is a nice warning when running the script:

If running tests that need the shared Fx, run './build -pack -all' before this.
And if packing for a different platform, add '/p:CrossgenOutput=false'.

If we add some opt-in or opt-out switch, that is extra work someone has to know to do. Whereas the current state it will just work for someone who wants the shared-fx or not (assuming they build the shared-fx if they need it, which is always the case if you need it)

@dougbu
Copy link
Contributor

dougbu commented Jul 22, 2021

🆗 I buy what you said @BrennanConroy but I think you ignored

really was specific to the RunHelix.ps1 script (IncludeAspNetRuntime is run for every Helix submission)

My concern here is somewhat separate. The RunHelix.ps1 script outputs the "nice warning" you mention but that won't happen if anything else hits the IncludeAspNetRuntime target w/o packing the shared Fx beforehand. You're turning a fast failure when not using RunHelix.ps1 into a very slow one. I suggest unconditionally adding a property to the dotnet msbuild command line in RunHelix.ps1 that allows the shared Fx to be missing.

</ItemGroup>

<Target Name="IncludeAspNetRuntime" BeforeTargets="Gather">
<Target Name="IncludeAspNetRuntime" BeforeTargets="Gather" Condition="'$(DoNotIncludeSharedFxHelix)' != 'true'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to you but I was thinking of something more like

Suggested change
<Target Name="IncludeAspNetRuntime" BeforeTargets="Gather" Condition="'$(DoNotIncludeSharedFxHelix)' != 'true'">
<Target Name="IncludeAspNetRuntime" BeforeTargets="Gather"
Condition="'$(DoNotIRequireSharedFxHelix)' != 'true' OR
EXISTS('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg')">

Then RunHelix.ps1 wouldn't need a new [switch] and could pass /p:DoNotIRequireSharedFxHelix=true unconditionally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately, @HaoK could you remind me why the EXISTS('...') exists on line 90 of this file❔ We should avoid ordering issues and ensure the shared Fx packages exist before creating the correlation payload because it's created once for all projects under test. If the order isn't working right, tests that require the shared Fx e.g. ProjectTemplates.Tests.csproj will fail annoyingly late.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My approach was sort of the backwards of what you are implying, I wanted to add targets that no-op or didn't fail since I believe things have morphed/transformed from how the targets were originally named, before we had a single option which included the runtime and did a lot of things, so lots of tests set the flag but they might not be building the shared Fx since only templates needed them. If we have more granular options now, its likely the exists is redundant now if this is only for the shared fx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EXISTS isn't redundant for Microsoft.AspNetCore.App.Ref because we hope not to service that package but @BrennanConroy please remove the one for Microsoft.AspNetCore.App.Runtime if you choose to update this PR again.

@BrennanConroy BrennanConroy merged commit f608a19 into main Jul 28, 2021
@BrennanConroy BrennanConroy deleted the brecon/runtestfix branch July 28, 2021 00:04
@ghost ghost added this to the 6.0-rc1 milestone Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants