Skip to content

[release/2.1] Correct and streamline internal builds #30729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Mar 8, 2021

  • correct manual internal builds
    • need to explicitly set $(BuildNumber) property in all build steps
    • change $(BuildScriptArgs) name to avoid circular reference
  • skip tests by default in internal non-PR builds

nits:

  • include new $(BuildNumberArg) in $(SharedFxArgs)
  • run all test jobs in internal pull requests

Also includes overall build fix, copied from #30164

@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

@dougbu dougbu added area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework tell-mode Indicates a PR which is being merged during tell-mode labels Mar 8, 2021
@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

Purely infrastructure and therefore tell-mode

@dougbu dougbu requested a review from a team March 8, 2021 04:12
@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

Any objection to tell-mode @Pilchie

@dougbu dougbu changed the title Correct and streamline internal builds [release/2.1] Correct and streamline internal builds Mar 8, 2021
@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

Baselines: https://dev.azure.com/dnceng/internal/_build/results?buildId=1026812 (internal build of #30639 containing some overlapping commits to this PR) and https://dev.azure.com/dnceng/public/_build/results?buildId=1026843 (public build of this PR) did run tests.

Unfortunately, https://dev.azure.com/dnceng/internal/_build/results?buildId=1026844 (internal build of this PR) also run tests. Suspect env: is in the wrong place…

@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

@dougbu
Copy link
Contributor Author

dougbu commented Mar 8, 2021

@wtgodbe
Copy link
Member

wtgodbe commented Mar 8, 2021

Thanks!

@Pilchie
Copy link
Member

Pilchie commented Mar 8, 2021

No objection to tell-mode.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 9, 2021

@wtgodbe what are the SharedFx-{platform}.ProjectImports.zip files e.g. https://dev.azure.com/dnceng/_apis/resources/Containers/6457484/artifacts-Linux-Musl-SharedFx?itemPath=artifacts-Linux-Musl-SharedFx%2Flogs%2FSharedFx-linux-musl-x64.ProjectImports.zip for❔ I downloaded one and it seems to contain all files from the repo.

@wtgodbe
Copy link
Member

wtgodbe commented Mar 9, 2021

what are the SharedFx-{platform}.ProjectImports.zip files

Good question - I have no idea. I don't see that artifact in the last official build of release/2.1: https://dev.azure.com/dnceng/internal/_build/results?buildId=1005457&view=artifacts&pathAsName=false&type=publishedArtifacts

@dougbu
Copy link
Contributor Author

dougbu commented Mar 10, 2021

Do not merge proactively. I want to double-check https://dev.azure.com/dnceng/internal/_build/results?buildId=1030342

dougbu added 4 commits March 11, 2021 12:19
- correct manual internal builds
    - need to explicitly set `$(BuildNumber)` property in all build steps
    - rename `$(BuildScriptArgs)` to avoid circular reference
- skip tests by default in internal non-PR builds

nits:
- include new `$(BuildNumberArg)` in `$(SharedFxArgs)`
- run all test jobs in internal pull requests
- however test\SharedFx.UnitTests\SharedFx.UnitTests.csproj always runs as part of `BuildSharedFx` target
- download will usually fail repeatedly if it fails even once
- previous maximum duration (105 min.) was greater than the job timeout
- when `!$(ValidateBaseline)`, previous runtimes do not exist
@dougbu dougbu force-pushed the dougbu/internal.build.cleanup branch from 550a362 to 64b7204 Compare March 11, 2021 20:19
@dougbu
Copy link
Contributor Author

dougbu commented Mar 22, 2021

Official builds still hit a lot of NU5123 errors with *.map files e.g. in the "Build linux-musl-x64 SharedFX" job,

/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Abstractions.ni.{da691088-1d16-422b-a976-0053e603d4f0}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Cookies.ni.{01c9a2c7-89e3-403b-b097-ce406b540626}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Core.ni.{4af1c091-57c0-49c5-a035-75c3c519737b}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Facebook.ni.{be6811cc-b147-466b-bd83-ba94e19dfd9d}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Google.ni.{5ae50644-1b1e-43b9-a99c-9ca496015af1}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.JwtBearer.ni.{b632600f-0bd1-495c-a691-51d0834d6306}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.MicrosoftAccount.ni.{b2764031-766d-4b69-b176-1a71358d06bd}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.OAuth.ni.{d5257217-e971-42a8-aed2-3647ba158c07}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.OpenIdConnect.ni.{f76515da-ed02-4451-be2f-4d1dd921dab7}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.Twitter.ni.{61db7198-c831-4ead-8b7a-28d5f7af68af}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authentication.WsFederation.ni.{bf9053aa-f446-483e-8988-508db4377689}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Authorization.Policy.ni.{7092d54d-984f-401a-aa87-d1166d542c29}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Connections.Abstractions.ni.{02d0d6a0-92c4-41eb-8d3e-d84e75f33180}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Cryptography.Internal.ni.{a53d44c1-5ce2-4bd2-a4aa-e7b93bf1101e}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.Cryptography.KeyDerivation.ni.{fc774452-f0ff-4c30-9142-7370c005c69b}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.DataProtection.Abstractions.ni.{d28c1fbc-79e1-43e2-aebf-5016282178ec}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]
/code/build/.dotnet/sdk/2.1.522/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(202,5): error NU5123: The file 'runtimes/linux-musl-x64/lib/netcoreapp2.1/Microsoft.AspNetCore.DataProtection.Extensions.ni.{52a32ce4-1196-4f05-8fab-de99ae130603}.map' path, name, or both are too long. Your package might not work without long file path support. Please shorten the file path or file name. [/code/build/.w/linux-musl-x64/Symbols/Microsoft.AspNetCore.App/runtime.linux-musl-x64.Microsoft.AspNetCore.App.csproj]

@rrelyea what suppresses these errors❔ I ask because the package layout seems to be consistent between e.g. runtime.linux-musl-x64.Microsoft.AspNetCore.All.2.1.17-servicing-31324.symbols.nupkg and Microsoft.AspNetCore.App.Runtime.linux-musl-arm64.3.1.14.symbols.nupkg but NU5123 don't show up in our release/3.1 builds and we don't mention "NU5123" in our release/3.1 branch.

Alternatively, @tmat is there another (shorter) way we could name the *.map files that would still work for the symbol servers❔

@dougbu
Copy link
Contributor Author

dougbu commented Mar 23, 2021

I'm having trouble getting to the root cause of some warnings and errors in internal 2.1.x builds such as https://dev.azure.com/dnceng/internal/_build/results?buildId=1051784

  1. /ping @rrelyea and @tmat on the *.map packaging issues. Should we just place the *.map files in or near the root of the package layout❔

  2. @rrelyea similarly, complaints about licenseURL use in our packages are infrequent but show up consistently w/ projects copied from https://github.com/dotnet/aspnetcore/blob/release/2.1/build/tools/templates/SharedFxSymbols/SharedFrameworkSymbols.csproj We don't want to change the 2.1.x licenses at this late date. So, how are we suppressing / hiding problems in our other shipping projects❔ (There isn't much special about that project and we don't mention "NU5125" in this repo.)

    [...\.dotnet\x64\sdk\2.1.522\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(202,5): error NU5125: The 'licenseUrl' element will be deprecated. Consider using the 'license' element instead. [...\.w\win-x64\Symbols\Microsoft.AspNetCore.App\runtime.win-x64.Microsoft.AspNetCore.App.csproj]
    [...\.dotnet\x64\sdk\2.1.522\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(202,5): error NU5125: The 'licenseUrl' element will be deprecated. Consider using the 'license' element instead. [...\.w\win-x64\Symbols\Microsoft.AspNetCore.App\runtime.win-x64.Microsoft.AspNetCore.All.csproj]
    
  3. @trylek @AntonLapounov our 2.1 builds hit a problem that sound like a recurrence of Illegal Instruction occurs when executing on Ubuntu 16.04 ARM64 using 2.2.100-preview1-008633 sdk#9305. We also see a lot of E_FAIL output (as documented in [release/2.1] Clean up E_FAIL compilation errors #30760). Is there something we can change to clean this up in our 2.1.x builds❔
    Relevant command is

    /code/build/.w/linux-musl-x64/CrossGenTool/crossgen @/code/build/.w/linux-musl-x64/CrossGenRsp/shared/Microsoft.AspNetCore.App/2.1.27-servicing-1051784/Microsoft.CodeAnalysis.rsp
    

    with COMPlus_PartialNGen=0 passed in the environment. The response file contains e.g.

    -nologo
    -readytorun
    -in /code/build/.w/linux-musl-x64/Publish/shared/Microsoft.AspNetCore.App/2.1.27-servicing-1051784/Microsoft.CodeAnalysis.dll
    -out /code/build/.w/linux-musl-x64/CrossGen/shared/Microsoft.AspNetCore.App/2.1.27-servicing-1051784/Microsoft.CodeAnalysis.dll
    -platform_assemblies_paths /code/build/.w/linux-musl-x64/CrossGenTool/:/code/build/.w/linux-musl-x64/Publish/shared/Microsoft.AspNetCore.App/2.1.27-servicing-1051784/:/code/build/.w/linux-musl-x64/Publish/shared/Microsoft.AspNetCore.All/2.1.27-servicing-1051784/
    -JITPath /code/build/.w/linux-musl-x64/CrossGenTool/libclrjit.so
    

    Output is

    EXEC Method not found: 'Void Microsoft.DiaSymReader.ISymUnmanagedWriter8._VtblGap1_33()'. while resolving 0x60007b7 - Microsoft.DiaSymReader.ISymUnmanagedWriter8._VtblGap1_33. [/code/build/.dotnet/buildtools/korebuild/2.1.7-build-20210309.1/KoreBuild.proj]
    ...
    Error 2147500037 (Exception from HRESULT: 0x80004005 (E_FAIL)) while compiling method AnalysisState.GenerateSimulatedCompilationEventsAsync
    Error 2147500037 (Exception from HRESULT: 0x80004005 (E_FAIL)) while compiling method AnalysisState.OnCompilationEventsGeneratedAsync
    Error 2147500037 (Exception from HRESULT: 0x80004005 (E_FAIL)) while compiling method AnalysisState.EnsureAnalyzerActionCountsInitializedAsync
    Error 2147500037 (Exception from HRESULT: 0x80004005 (E_FAIL)) while compiling method AnalyzerDriver.AttachQueueAndProcessAllEventsAsync
    ...
    Native image /code/build/.w/linux-musl-x64/CrossGen/shared/Microsoft.AspNetCore.App/2.1.27-servicing-1051784/Microsoft.CodeAnalysis.dll generated successfully.
    

    The E_FAIL messages happen with a lot of assemblies but the "Method not found" error seems specific to Microsoft.CodeAnalysis.dll.

Any help much appreciated❕

@trylek
Copy link
Member

trylek commented Mar 24, 2021

I believe that Anton recently updated the DiaSymReader to resolve some arm64-related issues but this thread mostly seems to refer to the x64 platform whereas the issue dotnet/sdk#9305 is about arm64. I defer to Anton to provide more detail as I must admit I'm not super familiar with details of this work; the Crossgen executions still use the "old native" Crossgen that hasn't changed for months, it seems to me that the root cause is clearly related to the DiaSymReader upgrade; changing the compilation to use Crossgen2 is actually a line of work I need to finally make progress on after having been long delayed with various issues hitting the runtime framework switch-over.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 24, 2021

@trylek thanks for your response. Has crossgen changed in 2.1 builds at all❔ And, are we planning to move to crossgen2 in servicing branches too❔

@trylek
Copy link
Member

trylek commented Mar 24, 2021

We certainly don't plan to "backport Crossgen2" to the servicing branches, it would be next to impossible and I believe there's no reason in "rewriting history". It's not like Crossgen1 committed a heinous crime and any mention of it has to be erased from everywhere, we just wrote a newer version and we're switching over to it in the releases to come. Please keep in mind that Crossgen1 / 2 is part of the .NET SDK, it's not an "external" compiler or build tool in the sense of being released independently (like Roslyn, MSVC, or cmake) where we need to update to newer versions once in a while even in the servicing branches.

@AntonLapounov
Copy link
Member

Microsoft.DiaSymReader.ISymUnmanagedWriter8 is Windows-only. Have we crossgened Microsoft.CodeAnalysis.dll before on Linux or has it recently taken a dependency on Microsoft.DiaSymReader?

@trylek
Copy link
Member

trylek commented Mar 24, 2021

And for your other question, I don't see any recent semantic changes to Crossgen in the 2.1 branch, please see here:

https://github.com/dotnet/coreclr/commits/release/2.1/src

I believe it's been mostly infra goo and bits of mostly managed stuff unrelated to the Crossgen compiler at least for a year, maybe more.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 24, 2021

Have we crossgened Microsoft.CodeAnalysis.dll before on Linux or has it recently taken a dependency on Microsoft.DiaSymReader?

I don't know anything about the history of Microsoft.CodeAnalysis and don't even know where the 2.1.x version of that assembly or package is / was built. We could exclude it from our crossgen operations but the larger question of platform compatibility would remain. We have a number of CodeAnalysis projects in this repo e.g. src/Razor/CodeAnalysis.Razor/src/Microsoft.CodeAnalysis.Razor.csproj and believe they're supposed to work everywhere. If a Microsoft.CodeAnalysis dependency is Windows-only, what operations won't work on (say) Linux❔

/fyi we do the crossgen operation for every assembly that ends up in our Microsoft.AspNetCore.App or Microsoft.AspNetCore.All meta-packages. This hasn't changed. Main new bit is our move from TeamCity to AzDO for 2.1 builds; we noticed the many messages (~1000 E_FAIL messages per build❕) but believe they've happened for a while.

/cc @jaredpar in case something has changed and @pranavkm for awareness.

@trylek
Copy link
Member

trylek commented Mar 24, 2021

Thanks Anton, you're right, I misread the error message. For Microsoft.CodeAnalysis, I see that the current "live" version in the runtime repo indeed uses pinvokes against DiaSymReader. This would constitute an important change if previously Microsoft.CodeAnalysis had been using dynamic resolution of DiaSymReader methods (LoadLibraryEx & GetProcAddress & Marshal.GetDelegateForFunctionPointer. I don't know if such transformation happened in the past. Why would have we changed the version of Microsoft.CodeAnalysis to something recent in the old servicing branch?

@AntonLapounov
Copy link
Member

If a Microsoft.CodeAnalysis dependency is Windows-only, what operations won't work on (say) Linux❔

Speculating: it might call Windows interfaces only when executed on Windows and crossgen.exe might be not smart enough. If it is not a regression in 2.1, do we care?

@dougbu
Copy link
Contributor Author

dougbu commented Mar 24, 2021

could you please share the entire offending response file?

This might be the key @trylek. We run crossgen against all of our assemblies twice, once to handle the assemblies themselves and once to generate the appropriate PDBs or MAPs. The target that contains E_FAIL output and complaints about DiaSymReadder is CrossGenAssemblies. Note it doesn't pass either -CreatePDB or -CreatePerfMap.

The CrossGenSymbols target seems to work fine.

Can one command do what we need on Linux and macOS❔ Or, should we just add the appropriate -CreateXYZ option in CrossGenAssemblies

@dougbu
Copy link
Contributor Author

dougbu commented Mar 24, 2021

If it is not a regression in 2.1, do we care?

Our main concern is the unreadability of our 2.1 builds due to the E_FAIL spew. We may find an underlying issue in Microsoft.CodeAnalysis but my question for @jaredpar was intended as an aside.

@trylek
Copy link
Member

trylek commented Mar 24, 2021

Calling the compiler twice is the right thing to do - in fact that's one of Crossgen1 drawbacks we fixed in Crossgen2 which is able to generate the PDB or perfmap directly alongside the compiled native executable, simplifying the overall workflow and increasing compilation throughput. My current working theory is that Crossgen1 simply looks at the targeting DLL for pinvokes (I doubt it actually needs to but it just might). So I'm guessing that in the "past when it was working" either the DiaSymReader was (perhaps erroneously) available even to Linux builds or the version of Microsoft.CodeAnalysis wasn't using pinvokes to the library at that time.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 24, 2021

Thanks, I think that's it for the Method not found part. We don't see it that in later release branches because our analyzers don't get crossgened.

However many other assemblies from Microsoft.AspNetCore.App and Microsoft.AspNetCore.All do still land in Microsoft.AspNetCore.App.Runtime packages and are crossgened. But, I don't see the E_FAIL output. Main difference in the newer MSBuild code seems to be <Exec ... /> versus <Exec ... IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="High" /> (in our 'main' branch). Is adding those attributes safe for the 2.1.x copy of crossgen

@AntonLapounov
Copy link
Member

Is adding those attributes safe for the 2.1.x copy of crossgen

Probably yes; however, my knowledge of the old crossgen is limited.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 31, 2021

Is adding those attributes safe for the 2.1.x copy of crossgen

Probably yes; however, my knowledge of the old crossgen is limited.

The added attributes on the Exec task didn't change anything. @trylek @AntonLapounov let's take further discussion of the crossgen output (E_FAIL and otherwise) to #30760.

@AntonLapounov
Copy link
Member

@dougbu Have you tried <Exec StandardOutputImportance="Low" StandardErrorImportance="Low" ...?

dougbu added a commit that referenced this pull request Apr 5, 2021
- version flows into `$(MicrosoftNETCoreApp21PackageVersion)` automatically
- cherry-picked from #30729 internal branch
dougbu added a commit that referenced this pull request Apr 5, 2021
- skip `SharedFxTests.BaselineTest(...)` between rebranding and baseline updates
    - previous runtime is not available in this window
- reduce retries in `RetryHelper`
    - download will usually fail repeatedly if it fails even once
    - previous maximum duration (105 min.) was greater than the job timeout
- avoid NETSDK1023 warnings
    - eng/targets/CSharp.Common.props adds packages removed from project
- cherry-picked from #30729 internal branch

nit: remove unused `GetTotalRetriesUsed()` method
dougbu added a commit that referenced this pull request Apr 6, 2021
- run `locale-gen` to avoid "setlocale: LC_ALL: cannot change locale" and similar
    - needs `locales` package
- move to still-supported Ubuntu 18.04 image
    - image needs slightly-newer `libicu60` package
    - rename Dockerfile to match
- cherry-picked from #30729 internal branch for Ubuntu image update

nit: set locale-related environment variables to match Python default
dougbu added a commit that referenced this pull request Apr 6, 2021
- avoid MSB4011 warnings (about repeated Directory.Build.targets imports)
    - place `$DOTNET_HOME` beside repo root, not under it
- cherry-picked from #30729 internal branch for image update

nits:
- use current Docker image for 2.1 alpine
- set `$LANGUAGE` with other locale-related environment variables
dougbu added a commit that referenced this pull request Apr 6, 2021
- run `locale-gen` to avoid "setlocale: LC_ALL: cannot change locale" and similar
    - needs `locales` package
- move to still-supported Ubuntu 18.04 image
    - image needs slightly-newer `libicu60` package
    - rename Dockerfile to match
- cherry-picked from #30729 internal branch for Ubuntu image update

nit: set locale-related environment variables to match Python default
dougbu added a commit that referenced this pull request Apr 6, 2021
- avoid MSB4011 warnings (about repeated Directory.Build.targets imports)
    - place `$DOTNET_HOME` beside repo root, not under it
- cherry-picked from #30729 internal branch for image update

nits:
- use current Docker image for 2.1 alpine
- set `$LANGUAGE` with other locale-related environment variables
dougbu added a commit that referenced this pull request Apr 8, 2021
- skip `SharedFxTests.BaselineTest(...)` between rebranding and baseline updates
    - previous runtime is not available in this window
- reduce retries in `RetryHelper`
    - download will usually fail repeatedly if it fails even once
    - previous maximum duration (105 min.) was greater than the job timeout
- avoid NETSDK1023 warnings
    - eng/targets/CSharp.Common.props adds packages removed from project
- create archives based on one that actually exists between rebranding and baseline updates
- mostly cherry-picked from #30729 internal branch

nit: remove unused `GetTotalRetriesUsed()` method
dougbu added a commit that referenced this pull request Apr 8, 2021
- run `locale-gen` to avoid "setlocale: LC_ALL: cannot change locale" and similar
    - needs `locales` package
- move to still-supported Ubuntu 18.04 image
    - image needs slightly-newer `libicu60`, `clang` and `lldb` packages
    - rename Dockerfile to match
- cherry-picked from #30729 internal branch for Ubuntu image update

nit: set locale-related environment variables to match Python default
dougbu added a commit that referenced this pull request Apr 8, 2021
- avoid MSB4011 warnings (about repeated Directory.Build.targets imports)
    - place `$DOTNET_HOME` beside repo root, not under it
- cherry-picked from #30729 internal branch for image update

nits:
- use current Docker image for 2.1 alpine
- set `$LANGUAGE` with other locale-related environment variables
dougbu added a commit that referenced this pull request Apr 9, 2021
* Update branding to 2.1.28

* Bump `$(MicrosoftNETCoreAppPackageVersion)`
  - version flows into `$(MicrosoftNETCoreApp21PackageVersion)` automatically
  - cherry-picked from #30729 internal branch

* Get tests and archives working after rebranding
  - skip `SharedFxTests.BaselineTest(...)` between rebranding and baseline updates
    - previous runtime is not available in this window
  - reduce retries in `RetryHelper`
    - download will usually fail repeatedly if it fails even once
    - previous maximum duration (105 min.) was greater than the job timeout
  - avoid NETSDK1023 warnings
    - eng/targets/CSharp.Common.props adds packages removed from project
  - create archives based on one that actually exists between rebranding and baseline updates
  - mostly cherry-picked from #30729 internal branch

  nit: remove unused `GetTotalRetriesUsed()` method

* Use Ubuntu 18.04 build agents
  - set locale consistently on all platforms
    - default locale on newer agents is unloved `C.UTF-8`

* Stop using Ubuntu 14.04
  - run `locale-gen` to avoid "setlocale: LC_ALL: cannot change locale" and similar
    - needs `locales` package
  - move to still-supported Ubuntu 18.04 image
    - image needs slightly-newer `libicu60`, `clang` and `lldb` packages
    - rename Dockerfile to match
  - cherry-picked from #30729 internal branch for Ubuntu image update

  nit: set locale-related environment variables to match Python default

* Avoid KoreBuild issues when using dockerbuild.sh
  - avoid MSB4011 warnings (about repeated Directory.Build.targets imports)
    - place `$DOTNET_HOME` beside repo root, not under it
  - cherry-picked from #30729 internal branch for image update

  nits:
  - use current Docker image for 2.1 alpine
  - set `$LANGUAGE` with other locale-related environment variables

* Remove obsolete Groovy code

* Pick up latest EF sources
  - minor change shouldn't affect submodule build but best to keep up

* Improve the CDN tests
  - apply efe9b95 to similar template test
  - add debug output to CDN tests
  - back-port test reliability fix
    - based on  @javiercn's 3368ea6 / #13646 fix
    - avoid `TimeSpan` arithmetic and did not match refactoring done in 'release/3.1'
      - do not have recently-added `TimeSpan` operators in 2.1
  - skip `CdnScriptTaghelperTests` on .NET Framework
    - failures appear specific to that platform
    - leave src/Templating/test/Templates.Test/CdnScriptTagTests.cs unchanged
      - test project does not target .NET Framework
@dougbu
Copy link
Contributor Author

dougbu commented Oct 1, 2021

I'll reopen this after restoring the fixes lost here

@dougbu dougbu closed this Oct 1, 2021
@dougbu dougbu deleted the dougbu/internal.build.cleanup branch October 1, 2021 01:59
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 tell-mode Indicates a PR which is being merged during tell-mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants