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

Fix generating vsproj with SCons 4.6.0+ #85357

Merged
merged 1 commit into from
Nov 25, 2023

Conversation

mhilbrunner
Copy link
Member

@mhilbrunner mhilbrunner commented Nov 25, 2023

Visual Studio project generation broke after the signature of find_batch_file() was changed in SCons 4.6.0+ (in SCons/scons@7082c53ff6). Thanks to mwichmann for pointing that out in #85262 (comment).

I can confirm that with these changes, vsproj=yes once again produces a VS solution as before, while I could reproduce the build failing without these changes.

I've also renamed the variable version to msvc_version for clarity. Otherwise, this just avoids passing env to find_batch_file() in SCons 4.6.0+, where that is no longer accepted. Instead, we need to find the product directory from env ourselves, as find_batch_file() previously did internally via find_vc_pdir(), which we now call ourselves.

find_vc_pdir() can in theory throw exceptions if the MSVC version is unsupported (UnsupportedVersion exception) or something unexpected occurs, but catching these wouldn't make much sense IMO, as we can't do much besides fail. Just having the build fail with these exceptions as in other cases here should be explicit enough.

We should see if we can remove some of the reliance on SCons internals here in the future. Some other stuff could likely be improved as well, but I tried to keep this minimal to get builds working again ASAP, and considering the time in the 4.2 dev cycle.

Fixes #85262.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@akien-mga akien-mga merged commit 5df9867 into godotengine:master Nov 25, 2023
15 checks passed
@akien-mga akien-mga added cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Nov 25, 2023
@akien-mga
Copy link
Member

Thanks!

@mhilbrunner mhilbrunner deleted the fix-generate-vsproj branch November 26, 2023 02:46
@akien-mga
Copy link
Member

Cherry-picked for 4.1.4.

@akien-mga akien-mga removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jan 16, 2024
@akien-mga
Copy link
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 16, 2024
@akien-mga
Copy link
Member

Cherry-picked for 3.5.4.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to generate vsproj with scons 4.6.0
2 participants