Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add enum value from newest Windows SDK #1859

Merged
merged 5 commits into from
Oct 2, 2024
Merged

Conversation

DKLoehr
Copy link
Contributor

@DKLoehr DKLoehr commented Sep 27, 2024

Windows SDK version 10.0.26100.0 adds a cache type value, CacheUnknown. This adds a case for that type to sysinfo.cc, which will otherwise complain about the switch statement being non-exhaustive when building with the new SDK.

Since the value doesn't exist in prior SDK versions, we only add the case conditionally. The condition can be removed if we ever decide to bump up the required SDK version.

Windows SDK version 10.0.26100.0 adds a cache type value, `CacheUnknown`. This adds a case for that type to `sysinfo.cc`, which will otherwise complain about the switch statement being non-exhaustive when building with the new SDK.

Since the value doesn't exist in prior SDK versions, we only add the case conditionally. The condition can be removed if we ever decide to bump up the required SDK version.
@dmah42
Copy link
Member

dmah42 commented Sep 30, 2024

should we return "Unknown" in this case?

Make sure the version macro we're using for the SDK is properly indicative of version 10.0.26100.0. Also fix formatting complains from the linter.
@DKLoehr
Copy link
Contributor Author

DKLoehr commented Sep 30, 2024

We could, but C.type is already set to Unknown so it would be a no-op. Happy to do it that way if you think it's clearer.

@dmah42
Copy link
Member

dmah42 commented Sep 30, 2024

ah i didn't spot that. this is fine, thanks.

dmah42
dmah42 previously approved these changes Sep 30, 2024
Formatter insists on two space before a comment after a macro...
dmah42
dmah42 previously approved these changes Sep 30, 2024
@dmah42
Copy link
Member

dmah42 commented Sep 30, 2024

looks like the define guard isn't quite right

@DKLoehr
Copy link
Contributor Author

DKLoehr commented Sep 30, 2024

Yes, I can't figure out why, unless I'm blind and missing something obvious. As far as I can tell that define was only added in the most recent SDK version, at the same time as CacheUnknown. Do you know what SDK version is being used by the builders which are failing?

@dmah42
Copy link
Member

dmah42 commented Sep 30, 2024

Yes, I can't figure out why, unless I'm blind and missing something obvious. As far as I can tell that define was only added in the most recent SDK version, at the same time as CacheUnknown. Do you know what SDK version is being used by the builders which are failing?

Current runner version: '2.319.1'
Operating System
Microsoft Windows Server 2022
10.0.20348
Datacenter
Runner Image
Image: windows-2022
Version: 20240922.1.0
Included Software: https://github.com/actions/runner-images/blob/win22/20240[9](https://github.com/google/benchmark/actions/runs/11108965351/job/30863405634?pr=1859#step:1:10)22.1/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240922.1

is any of that useful?

@DKLoehr
Copy link
Contributor Author

DKLoehr commented Sep 30, 2024

That's useful info, thanks! Unfortunately I checked out all the SDKs on the windows-2022 release image, and none of them have this defined, so I'm not sure what's going on. I notice that it's the windows-latest builders that are failing; do you know what's different between them and windows-2022? Looking around at the runner-images repo, I see that windows-latest might be some kind of alias for windows-2022, but evidently it's not identical.

@DKLoehr
Copy link
Contributor Author

DKLoehr commented Sep 30, 2024

Found this issue, it seems like windows-latest has been partially updated but not completely? Not 100% sure if that's the problem, but it seems highly suspicious given that the error we're seeing here looks like we've got only part of the new SDK.

Try detecting the current SDK version in a slightly different way.
dmah42
dmah42 previously approved these changes Oct 1, 2024
@dmah42
Copy link
Member

dmah42 commented Oct 1, 2024

latest is now passing, 2019/2022 are now failing :)

Undefined constants are treated as 0 by the preprocessor, which causes the check to trivially return true for previous SDK versions. Replace the constant with its value (from the newest SDK version) instead,
@dmah42 dmah42 merged commit 24e0bd8 into google:main Oct 2, 2024
80 checks passed
@dmah42
Copy link
Member

dmah42 commented Oct 2, 2024

thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants