arcade icon indicating copy to clipboard operation
arcade copied to clipboard

aspnetcore - Build break after Arcade update

Open adityamandaleeka opened this issue 2 years ago • 19 comments

  • [x] This issue is blocking Running build.cmd in the aspnetcore repo is broken at the moment.

  • [ ] This issue is causing unreasonable pain

Hey all, we have a build break in aspnetcore since taking an Arcade update. The commit which breaks things is this one: Update dependencies from https://github.com/dotnet/arcade build 20230… · dotnet/aspnetcore@cb40b05

The failure looks like this:

  Unhandled exception. System.ArgumentException: The value cannot be an empty string. (Parameter 'path')
     at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
     at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
     at System.IO.File.OpenText(String path)
     at TestTasks.InjectRequestHandler.Main(String[] args) in c:\code\aspnetcore\src\Servers\IIS\IIS\test\testassets\TestTasks\InjectRequestHandler.cs:line 27
c:\code\aspnetcore\src\Servers\IIS\build\testsite.props(77,5): error MSB3073: The command "dotnet c:\code\aspnetcore\src\Servers\IIS\build\..\IIS\test\testassets\TestTasks\bin\Debug\net8.0\TestTasks.d
ll ""  " exited with code -532462766. [c:\code\aspnetcore\src\Servers\IIS\IIS\test\testassets\InProcessWebSite\InProcessWebSite.csproj]

I investigated this a bit and the issue seems to be that a PublishDepsFilePath that was previously populated is no longer being populated (note the empty string passed in in the first argument to the TestTasks thing).

Looking at the binlogs, it looks like the reason why it's not being populated is that the GeneratePublishDependencyFile target is being skipped now because _UseBuildDependencyFile is true.

_UseBuildDependencyFile is set in _ComputeUseBuildDependencyFile and has this condition:

<PropertyGroup>
      <_TrimRuntimeAssets Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true'">true</_TrimRuntimeAssets>
      <_UseBuildDependencyFile Condition="'@(_ExcludeFromPublishPackageReference)' == '' and
                                          '@(RuntimeStorePackages)' == '' and
                                          '$(PreserveStoreLayout)' != 'true' and
                                          '$(PublishTrimmed)' != 'true' and
                                          '$(_TrimRuntimeAssets)' != 'true'">true</_UseBuildDependencyFile>
    </PropertyGroup>

Presumably one or more of those conditional clauses have flipped in value with the Arcade update?

I looked through the changes between the two arcade versions here: Comparing 226c103b56a979243f08032e6cddb4deb66ea54b...60ea5b2eca5af06fc63b250f8669d2c70179b18c · dotnet/arcade (github.com)

and didn't see anything that seems like it would obviously affect this. That said, I'm by no means an Arcade expert and today was my first time looking at most of this so maybe I've missed something (or I'm not even looking at the right changes). Can someone please take a look? I can share the good/bad binlogs if that helps.

Release Note Category

  • [ ] Feature changes/additions
  • [ ] Bug fixes
  • [ ] Internal Infrastructure Improvements

Release Note Description

adityamandaleeka avatar Jul 19 '23 16:07 adityamandaleeka

While this is investigated and triaged appropriately, I suggest reverting the Arcade update in the repo.

riarenas avatar Jul 19 '23 16:07 riarenas

https://github.com/dotnet/aspnetcore/pull/49520

wtgodbe avatar Jul 19 '23 17:07 wtgodbe

Datapoint - the build passes if you pass the -ci switch to build.cmd https://github.com/dotnet/aspnetcore/pull/49520#issuecomment-1642752805

wtgodbe avatar Jul 19 '23 21:07 wtgodbe

Looks like this is the only scenario where this is breaking. Any chance y'all could look into this further to determine a root cause?

missymessa avatar Jul 27 '23 20:07 missymessa

We updated Arcade again on Monday & I haven't heard of anyone getting the local build break since then, so we may be OK. Let's close this, I'll re-open if the issue pops up again.

wtgodbe avatar Jul 27 '23 20:07 wtgodbe

I just synced and am hitting this again.

adityamandaleeka avatar Jul 28 '23 01:07 adityamandaleeka

Well, never mind then.

I think Aditya's investigation did get to a root cause -

<PropertyGroup>
      <_TrimRuntimeAssets Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true'">true</_TrimRuntimeAssets>
      <_UseBuildDependencyFile Condition="'@(_ExcludeFromPublishPackageReference)' == '' and
                                          '@(RuntimeStorePackages)' == '' and
                                          '$(PreserveStoreLayout)' != 'true' and
                                          '$(PublishTrimmed)' != 'true' and
                                          '$(_TrimRuntimeAssets)' != 'true'">true</_UseBuildDependencyFile>
    </PropertyGroup>

_UseBuildDependencyFile is getting set to true here in local builds, but not CI builds.

wtgodbe avatar Jul 28 '23 16:07 wtgodbe

Is there any update on this? This is still breaking local builds and slowing down dev work.

adityamandaleeka avatar Aug 02 '23 20:08 adityamandaleeka

@wtgodbe @adityamandaleeka where is that code that you referenced as the root cause?

missymessa avatar Aug 02 '23 22:08 missymessa

@wtgodbe and @adityamandaleeka, this is a strange one b/c we don't have any code in dotnet/arcade that sets _UseBuildDependencyFile or any of the properties and items going into its calculation

@missymessa the code is from the .NET SDK

dougbu avatar Aug 02 '23 22:08 dougbu

@adityamandaleeka did you confirm locally that it's exactly https://github.com/dotnet/aspnetcore/commit/cb40b050193c104fdf484371512a9549be4a71b1 where the break was introduced?

wtgodbe avatar Aug 03 '23 21:08 wtgodbe

Yea that's what I determined after a git bisect. You should be able to repro it if you sync to that commit and not if you go to one commit earlier.

adityamandaleeka avatar Aug 03 '23 21:08 adityamandaleeka

@wtgodbe @adityamandaleeka what do y'all think should be the action taken on this?

@marcpopMSFT fyi

missymessa avatar Aug 24 '23 21:08 missymessa

ping @wtgodbe @adityamandaleeka @marcpopMSFT :)

missymessa avatar Sep 21 '23 19:09 missymessa

@missymessa We unblocked the aspnetcore builds with a hacky fix (https://github.com/dotnet/aspnetcore/pull/49811) but I guess the work here is to understand what changed that broke them in the first place.

adityamandaleeka avatar Sep 21 '23 23:09 adityamandaleeka

Do you have a binlog from the failing CI build and did you determine which of the five conditions is different than the local build and what changed?

marcpopMSFT avatar Sep 21 '23 23:09 marcpopMSFT

I think I shared the binlogs on Teams, I'll find the message and tag you. I don't think I determined which condition flipped.

adityamandaleeka avatar Sep 21 '23 23:09 adityamandaleeka

@adityamandaleeka checking in on the status of this issue.

missymessa avatar Oct 05 '23 21:10 missymessa

@missymessa There's been no change in status. Are you waiting for something from my end on this? I believe all the info has been provided on the Teams chat I tagged you on, but let me know if something is missing.

You should be able to repro this just by undoing the hacky fix I mentioned above and building that test site project.

adityamandaleeka avatar Oct 06 '23 18:10 adityamandaleeka