aspnetcore - Build break after Arcade update
-
[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
While this is investigated and triaged appropriately, I suggest reverting the Arcade update in the repo.
https://github.com/dotnet/aspnetcore/pull/49520
Datapoint - the build passes if you pass the -ci switch to build.cmd https://github.com/dotnet/aspnetcore/pull/49520#issuecomment-1642752805
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?
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.
I just synced and am hitting this again.
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.
Is there any update on this? This is still breaking local builds and slowing down dev work.
@wtgodbe @adityamandaleeka where is that code that you referenced as the root cause?
@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
@adityamandaleeka did you confirm locally that it's exactly https://github.com/dotnet/aspnetcore/commit/cb40b050193c104fdf484371512a9549be4a71b1 where the break was introduced?
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.
@wtgodbe @adityamandaleeka what do y'all think should be the action taken on this?
@marcpopMSFT fyi
ping @wtgodbe @adityamandaleeka @marcpopMSFT :)
@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.
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?
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 checking in on the status of this issue.
@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.