-
Notifications
You must be signed in to change notification settings - Fork 160
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
BinSkim .NET Updates to version 9 #1024
base: main
Are you sure you want to change the base?
Conversation
3d1696b
to
990a79d
Compare
8c0ae1d
to
c90c64e
Compare
…and platform checks Add static keyword to lambdas in AnalyzeCommandTests.cs Modified lambda expressions in AnalyzeCommandTests.cs to be static. This change ensures that the lambdas do not capture variables from the enclosing scope, potentially improving performance and clarity. Fixing version constant file Refactor project to target .NET 9.0 and remove obsolete configurations Update ADO build configuration to target .NET 9.0 and add .vscode to .gitignore Update GitHub workflows to target .NET 9.0 and improve formatting steps Update .gitignore and improve Build scripts for .NET 9.0 compatibility Directory.Packages.props fixes
c72a5f2
to
0884878
Compare
Removed `using System.Runtime.Versioning;` and `[SupportedOSPlatform("windows")]` from `MSDiaComWrapper.cs` and `Pdb.cs`. Replaced `Marshal.GetObjectForIUnknown` with `ResourceReleaser.GetObjectForIUnknown` in `MSDiaComWrapper.cs`. Removed `OperatingSystem.IsWindows()` checks in `Pdb.cs` and ensured `PlatformSpecificHelpers.ThrowIfNotOnWindows()` still enforces Windows-only execution in `Init` methods. Simplified codebase by removing redundant platform checks.
echo public const string FileVersion = "%MAJOR%.%MINOR%.%PATCH%" + ".0";>> %VERSION_CONSTANTS% | ||
echo public const string Version = AssemblyVersion + Prerelease;>> %VERSION_CONSTANTS% | ||
echo }>> %VERSION_CONSTANTS% | ||
echo }>> %VERSION_CONSTANTS% |
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.
It seems there's an extra space at the start of the line here.
| **`--help`** | Table of argument information. | | ||
| **`--version`** | BinSkim version details. | | ||
| **`value pos. 0`** | One or more specifiers to a file, directory, or filter pattern that resolves to one or more binaries to analyze. | | ||
| Argument (short form, long form) | Meaning | |
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.
Is there any tooling in the repository that checks for correct indentation of Markdown? If not I suspect the indentation gets out of sync very quickly.
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.
If possible - I'd suggest dealing with Markdown formatting outside of this PR.
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.
There are some configs under .vscode/
you want to change too.
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.
Do we no longer needs this?
@@ -121,13 +121,18 @@ public ulong ReadLength(out bool is64bit) | |||
/// <summary> | |||
/// Reads the string from the current position in the stream. | |||
/// </summary> | |||
[HandleProcessCorruptedStateExceptions] |
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.
I may be reading the docs wrong, but with HandleProcessCorruptedStateExceptions
being removed - are you still trying to catch CSEs with the try-catch
block?
@@ -212,6 +213,7 @@ public void PEBinary_IsDotNetNativeBootstrapExe() | |||
} | |||
|
|||
[Fact] | |||
[SupportedOSPlatform("windows")] |
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.
It seems to me there are other places with a runtime check for PlatformSpecificHelpers.RunningOnWindows()
, but without SupportedOSPlatform("windows")
- do you want to make these more consistent?
@@ -237,7 +237,7 @@ public void MultithreadedAnalyzeCommand_InitializeGlobalContextFromOptions_Quiet | |||
Assert.IsType<Sarif.Driver.AggregatingLogger>(context.Logger); | |||
|
|||
var aggregatingLogger = (Sarif.Driver.AggregatingLogger)context.Logger; | |||
Assert.Equal(0, aggregatingLogger.Loggers.Count); | |||
Assert.Empty(aggregatingLogger.Loggers); |
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.
Let's call it a nitpick, but unless this is required for the update itself, it would be great to tackle these type of changes in a separate PR.
@@ -16,8 +15,7 @@ function Build-Tool() | |||
} | |||
|
|||
|
|||
function Build-Baselines($sourceExtension) | |||
{ | |||
function Build-Baselines($sourceExtension) { |
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.
Nitpick - this is now inconsistent with GenerateTests.ps1
, I'd perhaps leave the formatting for PowerShell scripts to a different PR.
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.
It seems quite a lot of stuff got bundled into 7af574f - IMO if we're dropping Test.ConcurrencyTests
altogether a separate PR would be great, but perhaps at least a separate commit with some reasoning why?
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.
Nitpick: It seems there's a mix of major, minor and patch updates - I assume not all of them are strictly .NET update related (I'd be surprised if some of these patch level updates would be). I think it's fine to update dependencies in general, but too many changes here make it a bit tricky to review these. Separate PR in a regular dependency update cycle would be great in the future.
| **`--help`** | Table of argument information. | | ||
| **`--version`** | BinSkim version details. | | ||
| **`value pos. 0`** | One or more specifiers to a file, directory, or filter pattern that resolves to one or more binaries to analyze. | | ||
| Argument (short form, long form) | Meaning | |
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.
If possible - I'd suggest dealing with Markdown formatting outside of this PR.
[WIP] BinSkim .NET Updates to version 9
Overview
This pull request focuses on updating the BinSkim project to incorporate the latest .NET updates. The goal is to ensure compatibility with the newest .NET features and improve overall performance and security.
Changes
Updated the project to target the latest .NET version.
Benefits
Enhanced Compatibility: Ensures that the BinSkim project is compatible with the latest .NET version, taking advantage of new features and improvements.
Testing
Verified that the project builds successfully with the latest .NET version.
Ran all existing tests to ensure no regressions were introduced.
Conducted manual testing to confirm that the functionality remains intact.
Additional Notes
If you encounter any issues or have questions about these updates, please feel free to reach out.