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

Support WindowsServer (windows 10) environments #105

Closed

Conversation

sake92
Copy link

@sake92 sake92 commented May 9, 2022

Fixes #104

@sake92 sake92 changed the title Support WindowsServer environments Support WindowsServer (windows 10) environments May 9, 2022
@jvanzyl
Copy link

jvanzyl commented May 17, 2022

Might this also be used to support Windows11 in the same way for #106?

@jvanzyl
Copy link

jvanzyl commented May 17, 2022

@sake92 I'm happy to add to your commit if I can get access to your branch. Seems like the addition of osName.contains("11") on line 73183b9#diff-72a326e132770acdb4cc0a74ed76a24961962a984e03eb3e31b67b4ea4e6ce0aR316 would get us Windows11 support, yes?

@sake92
Copy link
Author

sake92 commented May 18, 2022

@jvanzyl yeah, I suppose. I pushed a commit for win11. To be honest I didn't test the whole build, but it should work.
It would be good to add some CI tests.

@jvanzyl
Copy link

jvanzyl commented May 18, 2022

I've downloaded Windows10 and 11 so I'll try it here. I'm surprised there aren't Windows10/11 host options available in GitHub Actions given it runs on Azure.

@sake92
Copy link
Author

sake92 commented May 18, 2022

Windows Servers 2016..2022 are actually Windows10 based, as far as I can see in their docs.
Maybe they'll add win11 in the future.
https://github.com/actions/virtual-environments -> https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md

Copy link
Member

@kohlschuetter kohlschuetter left a comment

Choose a reason for hiding this comment

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

There were some minor issues with this PR I commented below.
Since there was some concurrent work done that includes a fix for this bug, this means that we can't merge this PR. However I want you to thank for looking into this!

@@ -311,7 +311,13 @@ private List<LibraryCandidate> initLibraryCandidates(List<Throwable> suppressedT
}

private static String architectureAndOS() {
return System.getProperty("os.arch") + "-" + System.getProperty("os.name").replaceAll(" ", "");
String osName = System.getProperty("os.name").replaceAll(" ", "");
Copy link
Member

Choose a reason for hiding this comment

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

FYI, this would crash if os.name is null.

@@ -311,7 +311,13 @@ private List<LibraryCandidate> initLibraryCandidates(List<Throwable> suppressedT
}

private static String architectureAndOS() {
return System.getProperty("os.arch") + "-" + System.getProperty("os.name").replaceAll(" ", "");
String osName = System.getProperty("os.name").replaceAll(" ", "");
if (osName.toLowerCase().contains("windows") &&
Copy link
Member

Choose a reason for hiding this comment

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

When using toLowerCase we should specify the locale (please be sure to test with mvn clean install -Pstrict which should catch this)

return System.getProperty("os.arch") + "-" + System.getProperty("os.name").replaceAll(" ", "");
String osName = System.getProperty("os.name").replaceAll(" ", "");
if (osName.toLowerCase().contains("windows") &&
(osName.contains("2016") || osName.contains("2019") || osName.contains("2022"))) {
Copy link
Member

Choose a reason for hiding this comment

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

We'd have to update this code whenever a newer version comes out, which I think we can do better.

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.

Support on WindowsServer
3 participants