From 49670eeb28e62c0c74c79af556859a4ba4885984 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 28 Mar 2023 19:58:50 +0100 Subject: [PATCH 1/4] Add workaround for Windows ARM64 compiler regression --- PCbuild/pyproject.props | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 92c7849d3bcf75..d2e82534552a4f 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -21,6 +21,13 @@ false + + <_VCToolsVersion>$([System.Version]::Parse(`$(VCToolsVersion)`).Major).$([System.Version]::Parse(`$(VCToolsVersion)`).Minor) + + + true + + <_DebugPreprocessorDefinition>NDEBUG; <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG; @@ -50,6 +57,7 @@ /utf-8 %(AdditionalOptions) -Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions) -flto %(AdditionalOptions) + -d2pattern-opt-disable:-932189325 %(AdditionalOptions) OnlyExplicitInline @@ -79,6 +87,7 @@ PGUpdate advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies) /OPT:REF,NOICF %(AdditionalOptions) + -d2:-pattern-opt-disable:-932189325 %(AdditionalOptions) true From e55554d9e9c71e86263637036b820d675b708b8e Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 28 Mar 2023 21:45:24 +0100 Subject: [PATCH 2/4] Ensure VCToolsVersion is not empty --- PCbuild/pyproject.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index d2e82534552a4f..36c4c269d05da9 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -21,7 +21,7 @@ false - + <_VCToolsVersion>$([System.Version]::Parse(`$(VCToolsVersion)`).Major).$([System.Version]::Parse(`$(VCToolsVersion)`).Minor) From 7a30dba82dfa4b09fc9822ce0bbf4cb6bd1a80d8 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 28 Mar 2023 23:35:14 +0100 Subject: [PATCH 3/4] Only use FileId128 when it is non-zero --- Python/fileutils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Python/fileutils.c b/Python/fileutils.c index 969b7163b5ac18..1c9a472b1134b3 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1166,8 +1166,13 @@ _Py_stat_basic_info_to_stat(FILE_STAT_BASIC_INFORMATION *info, /* File systems with less than 128-bits zero pad into this field */ id_128_to_ino file_id; file_id.id = info->FileId128; - result->st_ino = file_id.st_ino; - result->st_ino_high = file_id.st_ino_high; + if (file_id.st_ino && file_id.st_ino_high) { + result->st_ino = file_id.st_ino; + result->st_ino_high = file_id.st_ino_high; + } else { + result->st_ino = info->FileId.QuadPart; + result->st_ino_high = 0; + } /* bpo-37834: Only actual symlinks set the S_IFLNK flag. But lstat() will open other name surrogate reparse points without traversing them. To detect/handle these, check st_file_attributes and st_reparse_tag. */ From ecd157527c3d7db60124592c2eae8f0b96c5c1e9 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 29 Mar 2023 00:09:40 +0100 Subject: [PATCH 4/4] Revert "Only use FileId128 when it is non-zero" This reverts commit 7a30dba82dfa4b09fc9822ce0bbf4cb6bd1a80d8. --- Python/fileutils.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Python/fileutils.c b/Python/fileutils.c index 1c9a472b1134b3..969b7163b5ac18 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1166,13 +1166,8 @@ _Py_stat_basic_info_to_stat(FILE_STAT_BASIC_INFORMATION *info, /* File systems with less than 128-bits zero pad into this field */ id_128_to_ino file_id; file_id.id = info->FileId128; - if (file_id.st_ino && file_id.st_ino_high) { - result->st_ino = file_id.st_ino; - result->st_ino_high = file_id.st_ino_high; - } else { - result->st_ino = info->FileId.QuadPart; - result->st_ino_high = 0; - } + result->st_ino = file_id.st_ino; + result->st_ino_high = file_id.st_ino_high; /* bpo-37834: Only actual symlinks set the S_IFLNK flag. But lstat() will open other name surrogate reparse points without traversing them. To detect/handle these, check st_file_attributes and st_reparse_tag. */