-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove StatInterop.cs - unused P/Invoke to private runtime library #51661
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: marcpopMSFT <[email protected]>
marcpopMSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No testing done as we're just removing a file we don't think is used and would expect it to fail to build/run if still in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes an unused file that contained P/Invoke declarations to a private runtime library, preventing potential future breakage. The SDK was incorrectly depending on System.Native (via libSystem.Native), which is a private implementation detail of the runtime and caused breaking changes in .NET 7 on arm64.
- Removed
src/Cli/dotnet/StatInterop.cscontaining unused DllImport declarations forSystemNative_LStatand associated structs
MiYanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal and doesn't seem to be referenced. Any chance copilot could do this kind of investigation repo-wide?
The SDK was P/Invoking into
System.Native(vialibSystem.Native), a private implementation detail of the runtime. This caused breakage in .NET 7 on arm64 when the runtime changed the native function signature (dotnet/runtime#72308).Changes
src/Cli/dotnet/StatInterop.cs- contained DllImport declarations forSystemNative_LStatand associated structs (FileStatus,Permissions,FileStatusFlags)The file had no references in the codebase and was not being used. Originally intended for checking file ownership in
SudoEnvironmentDirectoryOverride.cs, but that code path was never implemented.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.