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

Replace mono with .NET 8 support #120

Open
wants to merge 3 commits into
base: release-1.7
Choose a base branch
from

Conversation

Bartleby2718
Copy link

@madelson There are some open questions in #119, but filing a PR to get some feedback.

@@ -29,7 +29,7 @@ public void TestArgumentValidation([Values] bool isWindowsSyntax)
[TestCase("\r", "\n", "\r\n")]
[TestCase("", "\"", "\\", "")]
[TestCase("abc", "a\\b", "a\\ b\"")]
// these chars are treated specially on mono unix
// these chars are treated specially on mono unix, so keeping.
Copy link
Author

@Bartleby2718 Bartleby2718 May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever I wasn't sure what to do about Mono-related comments, I either deleted it or modified it so that it shows up in the diff.

MedallionShell.Tests/CommandLineSyntaxTest.cs Outdated Show resolved Hide resolved
public class PlatformCompatibilityTest
{
[Test]
public Task TestReadAfterExit() => RunTestAsync(() => PlatformCompatibilityTests.TestReadAfterExit());

[Test]
public Task TestWriteAfterExit() => RunTestAsync(() => PlatformCompatibilityTests.TestWriteAfterExit());
// TODO: fix in https://github.com/madelson/MedallionShell/issues/117
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now because this must be fixed before 1.7 is released.

// other types of IOExceptions (e. g. FileNotFoundException, PathTooLongException) that could in
// theory be thrown here and trigger this
when (IsMono && ex.GetType() == typeof(IOException))
catch
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not sure what to do here...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copypasted from net6.0

@@ -114,8 +111,8 @@ public static void TestBadProcessFile()
{
var baseDirectory = Path.GetDirectoryName(SampleCommandPath)!;

AssertThrows<Win32Exception>(() => Command.Run(baseDirectory));
AssertThrows<Win32Exception>(() => Command.Run(Path.Combine(baseDirectory, "DOES_NOT_EXIST.exe")));
AssertThrows<InvalidOperationException>(() => Command.Run(baseDirectory));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing for all target frameworks, so I think this is a breaking change in a more recent version of .NET SDK, but I couldn't find anything that seems relevant in https://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0 or https://learn.microsoft.com/en-us/dotnet/core/compatibility/7.0.

@@ -22,13 +22,8 @@ for:
matrix:
only:
-
image: "Ubuntu"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed in the previous PR; we temporarily lost coverage for Ubuntu 22.04.

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, we don't have to update this line when we change from net462 to net472. You can see that this technique is being used in https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/src/Microsoft.IdentityModel.Protocols/Microsoft.IdentityModel.Protocols.csproj#L29.

@Bartleby2718
Copy link
Author

@madelson This blocks other PRs, so I'd appreciate it if you could review this first!

@Bartleby2718 Bartleby2718 requested a review from madelson June 29, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants