Skip to content

GH-132983: Build _zstd on Windows #133366

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

Merged
merged 7 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Zstandard scaffold
  • Loading branch information
AA-Turner committed May 4, 2025
commit a0cfc5d4a853d63b0aff6e1febab4a5ee3d2bbb6
21 changes: 21 additions & 0 deletions Misc/externals.spdx.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@
"name": "zlib-ng",
"primaryPackagePurpose": "SOURCE",
"versionInfo": "2.2.4"
},
{
"SPDXID": "SPDXRef-PACKAGE-zstd",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "f24b52470d12f466e9fa4fcc94e6c530625ada51d7b36de7fdc6ed7e6f499c8e"
}
],
"downloadLocation": "https://github.com/python/cpython-source-deps/archive/refs/tags/zstd-1.5.7.tar.gz",
"externalRefs": [
{
"referenceCategory": "SECURITY",
"referenceLocator": "cpe:2.3:a:facebook:zstandard:1.5.7:*:*:*:*:*:*:*",
"referenceType": "cpe23Type"
}
],
"licenseConcluded": "NOASSERTION",
"name": "zstd",
"primaryPackagePurpose": "SOURCE",
"versionInfo": "1.5.7"
}
],
"spdxVersion": "SPDX-2.3"
Expand Down
1 change: 1 addition & 0 deletions PCbuild/get_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.15.
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.15.0
set libraries=%libraries% xz-5.2.5
set libraries=%libraries% zlib-ng-2.2.4
set libraries=%libraries% zstd-1.5.7

for %%e in (%libraries%) do (
if exist "%EXTERNALS_DIR%\%%e" (
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/pcbuild.proj
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<ExtensionModules Include="_asyncio;_remotedebugging;_zoneinfo;_decimal;_elementtree;_multiprocessing;_overlapped;pyexpat;_queue;select;unicodedata;winsound;_uuid;_wmi" />
<ExtensionModules Include="_ctypes" Condition="$(IncludeCTypes)" />
<!-- Extension modules that require external sources -->
<ExternalModules Include="_bz2;_lzma;_sqlite3" />
<ExternalModules Include="_bz2;_lzma;_sqlite3;_zstd" />
<!-- venv launchers -->
<Projects Include="venvlauncher.vcxproj;venvwlauncher.vcxproj" />
<!-- _ssl will build _socket as well, which may cause conflicts in parallel builds -->
Expand Down
68 changes: 68 additions & 0 deletions PCbuild/pcbuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib-ng", "zlib-ng.vcxproj"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_remotedebugging", "_remotedebugging.vcxproj", "{4D7C112F-3083-4D9E-9754-9341C14D9B39}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_zstd", "_zstd.vcxproj", "{07029B86-F3E9-443E-86FB-78AA6D47FED1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zstd", "zstd.vcxproj", "{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -1750,6 +1754,70 @@ Global
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|Win32.Build.0 = Release|Win32
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|x64.ActiveCfg = Release|x64
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|x64.Build.0 = Release|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|ARM.ActiveCfg = Debug|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|ARM.Build.0 = Debug|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|ARM64.Build.0 = Debug|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|Win32.ActiveCfg = Debug|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|Win32.Build.0 = Debug|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|x64.ActiveCfg = Debug|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Debug|x64.Build.0 = Debug|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGInstrument|x64.Build.0 = PGInstrument|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.PGUpdate|x64.Build.0 = PGUpdate|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|ARM.ActiveCfg = Release|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|ARM.Build.0 = Release|ARM
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|ARM64.ActiveCfg = Release|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|ARM64.Build.0 = Release|ARM64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|Win32.ActiveCfg = Release|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|Win32.Build.0 = Release|Win32
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|x64.ActiveCfg = Release|x64
{07029B86-F3E9-443E-86FB-78AA6D47FED1}.Release|x64.Build.0 = Release|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|ARM.ActiveCfg = Debug|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|ARM.Build.0 = Debug|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|ARM64.Build.0 = Debug|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|Win32.ActiveCfg = Debug|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|Win32.Build.0 = Debug|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|x64.ActiveCfg = Debug|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Debug|x64.Build.0 = Debug|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGInstrument|x64.Build.0 = PGInstrument|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.PGUpdate|x64.Build.0 = PGUpdate|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|ARM.ActiveCfg = Release|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|ARM.Build.0 = Release|ARM
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|ARM64.ActiveCfg = Release|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|ARM64.Build.0 = Release|ARM64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|Win32.ActiveCfg = Release|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|Win32.Build.0 = Release|Win32
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|x64.ActiveCfg = Release|x64
{8D80E018-6A7D-4B46-A7BE-D9E02A20D473}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions PCbuild/python.props
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<nasmDir Condition="$(nasmDir) == ''">$(ExternalsDir)\nasm-2.11.06\</nasmDir>
<zlibDir Condition="$(zlibDir) == ''">$(ExternalsDir)\zlib-1.3.1\</zlibDir>
<zlibNgDir Condition="$(zlibNgDir) == ''">$(ExternalsDir)\zlib-ng-2.2.4\</zlibNgDir>
<zstdDir Condition="$(zstdDir) == ''">$(ExternalsDir)\zstd-1.5.7\lib\</zstdDir>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions PCbuild/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ zlib-ng

Sources for zlib-ng are imported unmodified into our source
repository at https://github.com/python/cpython-source-deps.
_zstd
Python wrapper for version 1.5.7 of the Zstandard compression library
Homepage:
https://facebook.github.io/zstd/


Getting External Sources
Expand Down
3 changes: 2 additions & 1 deletion PCbuild/regen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
<_LicenseSources Include="$(PySourcePath)LICENSE;
$(PySourcePath)PC\crtlicense.txt;
$(bz2Dir)LICENSE;
$(libffiDir)LICENSE;" />
$(libffiDir)LICENSE;
$(zstdDir)..\LICENSE;" />
<_LicenseSources Include="$(opensslOutDir)LICENSE.txt" Condition="Exists('$(opensslOutDir)LICENSE.txt')" />
<_LicenseSources Include="$(opensslOutDir)LICENSE" Condition="!Exists('$(opensslOutDir)LICENSE.txt')" />
<_LicenseSources Include="$(tcltkDir)tcllicense.terms;
Expand Down
2 changes: 1 addition & 1 deletion Tools/msi/freethreaded/freethreaded_files.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</ComponentGroup>
</Fragment>

<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_queue;_uuid;_wmi;_zoneinfo;_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited;_tkinter ?>
<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_queue;_uuid;_wmi;_zoneinfo;_zstd;_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited;_tkinter ?>
<Fragment>
<DirectoryRef Id="Lib_venv_scripts_nt__freethreaded" />

Expand Down
2 changes: 1 addition & 1 deletion Tools/msi/lib/lib_files.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_queue;_uuid;_wmi;_zoneinfo ?>
<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_queue;_uuid;_wmi;_zoneinfo;_zstd ?>
<Fragment>
<DirectoryRef Id="Lib_venv_scripts_nt" />

Expand Down
Loading