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

added a 'latest' systemversion for vs2017 #994

Merged
merged 4 commits into from
Jan 18, 2018

Conversation

dcourtois
Copy link
Contributor

Sorry for the delay, but here is the pull request for issue #935 and the other related ones.

You can now specify systemversion "latest". If the action is vs2017, it will query the registry to retrieve the latest SDK 10 version number. If anything's wrong (action less than vs2017, the registry does not exist, etc.) no system version will be written in the vcxproj.

There are 2 basic unit tests, but I couldn't run them, tests currently fail on test_http.lua on my setup...
I tested this on my personal project, and also to build Premake itself using vs2017, and it works fine (just needed to add systemversion "latest" on the various Premake scripts for the Windows config.

forgot to add the ".0" suffix


added unit tests for systemversion "latest"
Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

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

Overall seems good, except for that one test which I think causes the tests to fail.


function suite.windowsTargetPlatformVersionLatest_on2015()
p.action.set("vs2015")
systemversion "10.0.10240.0"
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah ! You're totally right ! Is there a way to run specific tests ? (Couldn't run the whole test suite because of some other tests failing before this one)

@tvandijck
Copy link
Contributor

I'm with @samsinsane here...

Copy link
Contributor Author

@dcourtois dcourtois left a comment

Choose a reason for hiding this comment

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

Hi, like I said in the first comment, it's not this test which fails, it's test_http.lua. So I couldn't run test_globals.lua, thus the dumb copy/paste error. But anyway it should be fixed now, thanks :)

Edit: seeing the result of appveyor, it seems the problem with test_http is only on my setup, and there's a problem with the test for "latest" and vs2017. I'll get back to it, sorry for the inconvenience


function suite.windowsTargetPlatformVersionLatest_on2015()
p.action.set("vs2015")
systemversion "10.0.10240.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah ! You're totally right ! Is there a way to run specific tests ? (Couldn't run the whole test suite because of some other tests failing before this one)

@tvandijck
Copy link
Contributor

Yeah, I ran into similar issues with some of the http test failures... it's kind of why I added the --insecure option.... I run my tests locally with that option, so the ssl tests pass... it's often because of some firewall stuff in corporate organizations...

@dcourtois
Copy link
Contributor Author

Ok I could run the tests, and I have a problem: I need to override os.getWindowsRegistry and restore to be able to return a testable version number, but the code I'm using is not working. I'm a bit rusty in Lua, do you have any idea why it's not working ? And any way to achieve this ?

function suite.windowsTargetPlatformVersionLatest_on2017()
p.action.set("vs2017")
systemversion "latest"
prepare()
Copy link
Member

Choose a reason for hiding this comment

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

prepare is what will call os.getWindowsRegistry, so you'll need to put this just above the test.capture

@samsinsane
Copy link
Member

Hi, like I said in the first comment

Woops, sorry about that, I completely forgot that you mentioned the tests failing in your original comment. I was referring to the failed builds with appveyor and travis, in my head it made sense at the time, sorry for the confusion!

do you have any idea why it's not working ? And any way to achieve this ?

I've added a comment for this, that should fix it.

@dcourtois
Copy link
Contributor Author

@samsinsane thanks, that was it ! some other tests still fail on my machine, but at least appveyor seems to be happy now :)

function m.latestSDK10Version()
local arch = iif(os.is64bit(), "\\WOW6432Node\\", "\\")
local version = os.getWindowsRegistry("HKLM:SOFTWARE" .. arch .."Microsoft\\Microsoft SDKs\\Windows\\v10.0\\ProductVersion")
return iif(version ~= nil, version .. ".0", nil)
Copy link
Member

Choose a reason for hiding this comment

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

This took me a little bit to figure out but these tests fail on Linux and macOS because version .. ".0" is being evaluated here. To resolve this issue, you'll need to break this out into a proper if statement.

@samsinsane
Copy link
Member

@dcourtois No worries, glad it sorted it out, just noticed another issue when I checked the Travis builds. I've added a comment for that, hopefully that's the last thing! I'm sure you're just as keen to merge this as I am at this point. 😄 Thanks for doing this!

@dcourtois
Copy link
Contributor Author

My worst PR ever, thanks for the help :D Fingers crossed ...

@samsinsane
Copy link
Member

Everything looks good now! We'll merge this when the mac build finally runs - seems like it's time for TravisCI to buy some more macs haha.

@tvandijck
Copy link
Contributor

That could be days ;) Their mac builds are so overloaded all the time, it often takes 4-5 hours for that queue to clear... I wouldn't wait... if linux is passing, bsd/mac will pass too on this one, there is no difference in codepath for this particular test between the two...

@samsinsane
Copy link
Member

@tvandijck you raise some good points. Merging.

@samsinsane samsinsane merged commit ae8e3b0 into premake:master Jan 18, 2018
@dcourtois
Copy link
Contributor Author

Now I can suggest to update the Premake and modules' scripts to use systemversion "latest" to finally be able to bootstrap Premake using vs2017 :p

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.

4 participants