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

DllImportGenerator.UnitTests failure: The type or namespace name 'DllImportAttribute' could not be found #64586

Closed
sbomer opened this issue Feb 1, 2022 · 3 comments

Comments

@sbomer
Copy link
Member

sbomer commented Feb 1, 2022

Rolling build failure, logs on net7.0-OSX-Release-x64-CoreCLR_release-OSX.1014.Amd64.Open.

DllImportGenerator.UnitTests.Diagnostics.TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic(targetFramework: Core) [FAIL]
      Assert.Empty() Failure
      Expected: <empty>
      Actual:   [(5,6): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?), (5,6): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?), (2,1): hidden CS8019: Unnecessary using directive.]
      Stack Trace:
        /_/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Diagnostics.cs(67,0): at DllImportGenerator.UnitTests.Diagnostics.TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic(TestTargetFramework targetFramework)
        --- End of stack trace from previous location ---

This failure shows up in:

  • DllImportGenerator.UnitTests.Diagnostics.TargetFrameworkNotSupported_NoDiagnostic
  • DllImportGenerator.UnitTests.Diagnostics.TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic
  • DllImportGenerator.UnitTests.Compiles.ValidateSnippetsFallbackForwarder

The failure only shows up on OSX so far. This appears to be a new failure mode - I am seeing the first occurrence in the above pipeline run which has these new commits: bc6d349...4a19a49. But none of those commits look related to me so it may just be nondeterministic. One of these tests previously had similar unusual failures on OSX: #62467 (error CS0518: Predefined type 'System.Object' is not defined or imported, etc.).

/cc @AaronRobinsonMSFT

Build Kind Start Time
1582910 Rolling 2022-31-01
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Interop-coreclr untriaged New issue has not been triaged by the area owner labels Feb 1, 2022
@AaronRobinsonMSFT
Copy link
Member

@elinor-fung or @jkoritzinsky Did we change any failure cases where we would not find a type?

@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Feb 1, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone Feb 1, 2022
@jkoritzinsky
Copy link
Member

No, we didn't. I think this is another sign of the GC Hole that we've been seeing pop up here and there. I think this has the same root issue as #62467.

@AaronRobinsonMSFT
Copy link
Member

I believe this was fixed in #69106.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants