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

Add support for VS 2022 #60

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add support for VS 2022 #60

wants to merge 8 commits into from

Conversation

Myoldmopar
Copy link
Owner

The new CI machine has Visual Studio 2022, not 2019. I thought about installing 2019, but I don't think I will. I think I'd rather just move the other machine up to 2022. Needed a tweak to Decent before doing that. This change will allow us to initially add a second Windows Decent run with 2022. Then install 2022 on the older machine. Once everything settles, eliminate the 2019 build.

Copy link
Owner Author

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

It's close, I need to look in one more spot before merging and testing.

'Visual Studio 17 2022'
else
raise CannotMatchCompiler, 'For Visual Studio, must specify version as either 16 or 17'
end
Copy link
Owner Author

Choose a reason for hiding this comment

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

Instead of just assuming 2019, we need the compiler to pass in a version when doing Visual Studio builds. This now allows Decent to support either.

@@ -268,7 +276,7 @@ def setup_single_compiler(compiler, is_release)
compiler[:cmake_extra_flags] = setup_compiler_extra_flags(compiler, is_release)
compiler[:num_parallel_builds] = setup_compiler_num_processors(compiler)

raise CannotMatchCompiler, 'Decent CI currently only deployed with Visual Studio version 16 (2019)' if compiler[:name] =~ /.*Visual Studio.*/i && compiler[:version] != 16
raise CannotMatchCompiler, 'Decent CI currently only deployed with Visual Studio version 16 (2019) and 17 (2022)' if compiler[:name] =~ /.*Visual Studio.*/i && !compiler[:version].in?([16, 17])
Copy link
Owner Author

Choose a reason for hiding this comment

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

I think I may need to still tweak something on Decent to make sure we skip a different VS version and not fail on it.

expect(setup_compiler_build_generator({:name => 'Visual Studio Hello'})).to include 'Visual Studio'
expect(setup_compiler_build_generator({:name => 'Visual Studio', :version => 16})).to include 'Visual Studio'
expect(setup_compiler_build_generator({:name => 'Visual Studio', :version => 17})).to include 'Visual Studio'
expect { setup_compiler_build_generator({:name => 'Visual Studio', :version => 198}) }.to raise_exception(CannotMatchCompiler)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Modified the test to ensure we pass a valid version in.

raise CannotMatchCompiler, "Unknown Windows Decent CI instance running: #{Socket.gethostname}"
end
end
# :nocov:
Copy link
Owner Author

Choose a reason for hiding this comment

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

I know, I know, this is not great, but it is temporary at least. Basically, we need to run on two different OS images, one has 16 only and one has 17 only. We offer a way to specify which version we want to run, but not a way to handle this situation where a machine tries to pick up a run and appears to be fine, but later realizes it can't run that. Another option here would be to see if the file system has a version-specific file at like Program Files / Visual Studio Something / Something. But I don't think it's worth digging into that right now.

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.

1 participant