Skip to content
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

Update source-build artifacts to be coherent #15372

Merged
merged 12 commits into from
Feb 7, 2023

Conversation

MichaelSimons
Copy link
Member

No description provided.

@MichaelSimons MichaelSimons marked this pull request as ready for review January 31, 2023 03:21
@MichaelSimons MichaelSimons requested a review from a team as a code owner January 31, 2023 03:21
@MichaelSimons MichaelSimons enabled auto-merge (squash) January 31, 2023 03:21
@MichaelSimons
Copy link
Member Author

@ViktorHofer - Are you aware of any runtime changes that might be causing the following errors? I am trying to update the SDK to eliminate some prebuilts and the build was working for me on commit 007df054a526ed9e3dc70b43bfa330943bd4816a but started failing after dfe1076090adad6990747e6abed8bf6699371877 flowed in. TIA

    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/AotCompilerTask/MonoAOTCompiler.csproj::TargetFramework=net8.0]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/AppleAppBuilder/AppleAppBuilder.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/installer.tasks/installer.tasks.csproj::TargetFramework=net8.0]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/TestExclusionListTasks/TestExclusionListTasks.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/libraries/Microsoft.NET.WebAssembly.Webcil/src/Microsoft.NET.WebAssembly.Webcil.csproj::TargetFramework=net8.0]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/WasmAppBuilder/WasmAppBuilder.csproj::TargetFramework=net8.0]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/WasmBuildTasks/WasmBuildTasks.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.csproj]
    CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs(231,37): error CS8795: Partial method 'Interlocked._MemoryBarrierProcessWide()' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs(53,37): error CS8795: Partial method 'RuntimeHelpers.RunClassConstructor(QCallTypeHandle)' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs(74,37): error CS8795: Partial method 'RuntimeHelpers.RunModuleConstructor(QCallModule)' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs(86,38): error CS8795: Partial method 'RuntimeHelpers.CompileMethod(RuntimeMethodHandleInternal)' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs(89,44): error CS8795: Partial method 'RuntimeHelpers.PrepareMethod(RuntimeMethodHandleInternal, nint*, int)' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
    /vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs(186,37): error CS8795: Partial method 'RuntimeHelpers.GetUninitializedObject(QCallTypeHandle, ObjectHandleOnStack)' must have an implementation part because it has accessibility modifiers. [/vmr/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
...

@lewing lewing closed this Jan 31, 2023
auto-merge was automatically disabled January 31, 2023 21:45

Pull request was closed

@lewing lewing reopened this Jan 31, 2023
@mthalman
Copy link
Member

I can see from a previously successful CI build that it also had these same warnings of LibraryImportGenerator. So that seems unrelated to the cause of this issue.

@MichaelSimons
Copy link
Member Author

I kicked off another local build and cannot reproduce this. I am running with prep.sh --bootstrap though. I wonder if this is an issue with the source-build artifacts when not utilizing the bootstrap flow.

@mthalman
Copy link
Member

mthalman commented Feb 1, 2023

This sure is strange. I created a codespace from this PR and it doesn't repro there either. 🫤

@mthalman
Copy link
Member

mthalman commented Feb 1, 2023

Ah, it repros when using the --clean-while-building option. How can that be?

@MichaelSimons
Copy link
Member Author

Ah, it repros when using the --clean-while-building option. How can that be?

Oh that's a good discovery. Not sure why that is. IIRC clean while building only cleans up artifacts at the end of a repo build. Could this indicate an odd cross repo dependency outside of a nuget package?

@ViktorHofer
Copy link
Member

@ViktorHofer - Are you aware of any runtime changes that might be causing the following errors?

@MichaelSimons I'm currently OOO - sick. Let me cc @jkoritzinsky who might be able to help.

@jkoritzinsky
Copy link
Member

Could this be related to the fact that Microsoft.Interop.SourceGeneration is building with a prebuilt reference? I just saw the issue related to that on dotnet/runtime and am going to put out a PR to fix it.

@mthalman
Copy link
Member

mthalman commented Feb 3, 2023

I've narrowed things down a bit. This behavior does not occur if the arcade and command-line-api repos are not cleaned up after building them.

@MichaelSimons
Copy link
Member Author

One thing I noticed is that if you rebuild after this fails, the build passes. This is an indicator that it isn't clean-while-building related because that only cleans up artifacts after building each repo in the full build context. This could be an indicator of a concurrency issue.

@MichaelSimons
Copy link
Member Author

I am at a loss on this one. I have a working and failing binlog from the same commit. The parameters to the csc command of System.Private.CodeLib.csproj appear to be identical. The question I have is the following warning a red herring? As Matt pointed out earlier, he has found other working builds that pass with this same warnings.

CSC warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.Interop.SourceGeneration, Version=8.0.8.8002, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the path specified. [/repos/dotnet/src/runtime/artifacts/source-build/self/src/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]

In regards to

Could this be related to the fact that Microsoft.Interop.SourceGeneration is building with a prebuilt reference? I just saw the issue related to that on dotnet/runtime and am going to put out a PR to fix it.

I don't think this is related. That PR is in regards to enabling the local prebuilt detection in the runtime repo.

@mthalman
Copy link
Member

mthalman commented Feb 6, 2023

I also found that if you run build.sh once so that it targets all of runtime's dependencies (and only those dependencies) and then run build.sh again targeting only the runtime repo, the build will succeed. But if you include the runtime repo in that first build, it won't work.

@mthalman
Copy link
Member

mthalman commented Feb 7, 2023

I've isolated the repro to just the change in the SDK version. The other changes in this PR are not impacting this issue.

@MichaelSimons
Copy link
Member Author

We need to unblock this PR for preview one. I have disabled the clean-while-building functionality and logged a tracking issue to investigate how this is causing the build to fail.

@MichaelSimons MichaelSimons enabled auto-merge (squash) February 7, 2023 16:42
@MichaelSimons MichaelSimons merged commit 593bfe8 into dotnet:main Feb 7, 2023
@MichaelSimons MichaelSimons deleted the update-sb-artifacts branch February 7, 2023 17:18
MichaelSimons added a commit to MichaelSimons/installer that referenced this pull request Feb 7, 2023
@jaredpar
Copy link
Member

jaredpar commented Aug 31, 2023

The symptoms of this issue are very similar to dotnet/runtime#85082. Believe it's likely the same underlying problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants