Author Ma Lin
Recipients Dima.Tisnek, Ma Lin, Mariatta, ned.deily, njs, ronaldoussoren
Date 2020-04-07.06:54:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586242450.97.0.468172484753.issue40060@roundup.psfhosted.org>
In-reply-to
Content
Windows build encountered a similar problem, see issue32394.
The solution is to check the runtime system version when importing socket module, if it is an older system, delete the constants. [1]

issue32394 has a small script (winsdk_watchdog.py) to help find such constants, usage:
1, build a CPython build with old SDK.
2, use winsdk_watchdog.py, dump possible affected constants to a file `winsdk_dump.json`.
3, build a CPython build with new SDK.
4, use winsdk_watchdog.py, compare constants between two builds .

If a new constant is introduced by new SDK/API, we remove it on older system during runtime.
Otherwise we can ignore this new constant, this means it has nothing to do with the new SDK.
(msg311858 is a demo.)

We don't need to use winsdk_watchdog.py routinely, just use it when updating the building SDK, this process only takes about 10~20 minutes.

I think macOS build can also uses this process.

[1]
The commit:
https://github.com/python/cpython/commit/19e7d48ce89422091f9af93038b9fee075d46e9e

Note that there was a minor fix later:
https://github.com/python/cpython/commit/8905fcc85a6fc3ac394bc89b0bbf40897e9497a#diff-a47fd74731aeb547ad780900bb8e6953
History
Date User Action Args
2020-04-07 06:54:11Ma Linsetrecipients: + Ma Lin, ronaldoussoren, ned.deily, njs, Dima.Tisnek, Mariatta
2020-04-07 06:54:10Ma Linsetmessageid: <1586242450.97.0.468172484753.issue40060@roundup.psfhosted.org>
2020-04-07 06:54:10Ma Linlinkissue40060 messages
2020-04-07 06:54:10Ma Lincreate