Skip to content

Commit

Permalink
Merge pull request python#19 from paulmon/fix-venvlauncher
Browse files Browse the repository at this point in the history
Fix venvlauncher
  • Loading branch information
paulmon authored Dec 18, 2018
2 parents 964996e + bcd39c1 commit bbac193
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Modules/_ctypes/callproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,10 @@ static int _call_function_pointer(int flags,
int *space;
ffi_cif cif;
int cc;
#if defined(MS_WIN32) && !defined(_M_ARM)
#ifdef MS_WIN32
#if !defined(_M_ARM)
int delta;
#endif // _M _ARM
#ifndef DONT_USE_SEH
DWORD dwExceptionCode = 0;
EXCEPTION_RECORD record;
Expand Down
4 changes: 4 additions & 0 deletions PCbuild/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ echo.Available flags to avoid building certain modules.
echo.These flags have no effect if '-e' is not given:
echo. --no-ssl Do not attempt to build _ssl
echo. --no-tkinter Do not attempt to build Tkinter
echo. --no-venv Do not build venv[w]launcher
echo.
echo.Available arguments:
echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdate
Expand Down Expand Up @@ -83,10 +84,12 @@ if "%~1"=="-e" (set IncludeExternals=true) & shift & goto CheckOpts
if "%~1"=="-E" (set IncludeExternals=false) & shift & goto CheckOpts
if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts
if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts
if "%~1"=="--no-venv" (set IncludeVenvLauncher=false) & shift & goto CheckOpts

if "%IncludeExternals%"=="" set IncludeExternals=true
if "%IncludeSSL%"=="" set IncludeSSL=true
if "%IncludeTkinter%"=="" set IncludeTkinter=true
if "%IncludeVenvLauncher%"=="" set IncludeVenvLauncher=true

if "%IncludeExternals%"=="true" call "%dir%get_externals.bat"

Expand Down Expand Up @@ -140,6 +143,7 @@ echo on
/p:Configuration=%conf% /p:Platform=%platf%^
/p:IncludeExternals=%IncludeExternals%^
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
/p:IncludeVenvLauncher=%IncludeVenvLauncher%^
/p:UseTestMarker=%UseTestMarker% %GITProperty%^
%1 %2 %3 %4 %5 %6 %7 %8 %9

Expand Down
3 changes: 2 additions & 1 deletion PCbuild/pcbuild.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<IncludeTests Condition="'$(IncludeTest)' == ''">true</IncludeTests>
<IncludeSSL Condition="'$(IncludeSSL)' == ''">true</IncludeSSL>
<IncludeTkinter Condition="'$(IncludeTkinter)' == ''">true</IncludeTkinter>
<IncludeVenvLauncher Condition="'$(IncludeVenvLauncher)' == ''">true</IncludeVenvLauncher>
</PropertyGroup>

<ItemDefinitionGroup>
Expand Down Expand Up @@ -71,7 +72,7 @@
<!-- python[w].exe -->
<Projects2 Include="python.vcxproj;pythonw.vcxproj" />
<!-- venv[w]launcher.exe -->
<Projects2 Condition="$(Platform) != 'ARM'" Include="venvlauncher.vcxproj;venvwlauncher.vcxproj" />
<Projects2 Condition="$(IncludeVenvLauncher)" Include="venvlauncher.vcxproj;venvwlauncher.vcxproj" />
</ItemGroup>

<Target Name="Build">
Expand Down
97 changes: 96 additions & 1 deletion PCbuild/pcbuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj", "{12728250-16EC-4DC6-94D7-E21DD88947F8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python_uwp", "python_uwp.vcxproj", "{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "venvlauncher", "venvlauncher.vcxproj", "{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "venvwlauncher", "venvwlauncher.vcxproj", "{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw_uwp", "pythonw_uwp.vcxproj", "{AB603547-1E2A-45B3-9E09-B04596006393}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -463,7 +471,6 @@ Global
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.PGUpdate|x64.Build.0 = PGUpdate|x64
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|ARM.ActiveCfg = Release|ARM
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|ARM.Build.0 = Release|ARM
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|Win32.ActiveCfg = Release|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|Win32.Build.0 = Release|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Release|x64.ActiveCfg = Release|x64
Expand Down Expand Up @@ -990,6 +997,94 @@ Global
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|Win32.Build.0 = Release|Win32
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.ActiveCfg = Release|x64
{12728250-16EC-4DC6-94D7-E21DD88947F8}.Release|x64.Build.0 = Release|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Debug|ARM.ActiveCfg = Debug|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Debug|Win32.ActiveCfg = Debug|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Debug|Win32.Build.0 = Debug|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Debug|x64.ActiveCfg = Debug|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Debug|x64.Build.0 = Debug|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGInstrument|ARM.ActiveCfg = PGInstrument|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGInstrument|x64.Build.0 = PGInstrument|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGUpdate|ARM.ActiveCfg = PGUpdate|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.PGUpdate|x64.Build.0 = PGUpdate|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Release|ARM.ActiveCfg = Release|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Release|Win32.ActiveCfg = Release|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Release|Win32.Build.0 = Release|Win32
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Release|x64.ActiveCfg = Release|x64
{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}.Release|x64.Build.0 = Release|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|ARM.ActiveCfg = Debug|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|ARM.Build.0 = Debug|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|Win32.ActiveCfg = Debug|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|Win32.Build.0 = Debug|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|x64.ActiveCfg = Debug|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Debug|x64.Build.0 = Debug|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGInstrument|x64.Build.0 = PGInstrument|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.PGUpdate|x64.Build.0 = PGUpdate|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|ARM.ActiveCfg = Release|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|ARM.Build.0 = Release|ARM
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|Win32.ActiveCfg = Release|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|Win32.Build.0 = Release|Win32
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|x64.ActiveCfg = Release|x64
{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}.Release|x64.Build.0 = Release|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|ARM.ActiveCfg = Debug|ARM
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|ARM.Build.0 = Debug|ARM
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|Win32.ActiveCfg = Debug|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|Win32.Build.0 = Debug|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|x64.ActiveCfg = Debug|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Debug|x64.Build.0 = Debug|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|ARM.ActiveCfg = PGInstrument|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|ARM.Build.0 = PGInstrument|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGInstrument|x64.Build.0 = PGInstrument|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|ARM.ActiveCfg = PGUpdate|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|ARM.Build.0 = PGUpdate|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.PGUpdate|x64.Build.0 = PGUpdate|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|ARM.ActiveCfg = Release|ARM
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|ARM.Build.0 = Release|ARM
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|Win32.ActiveCfg = Release|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|Win32.Build.0 = Release|Win32
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|x64.ActiveCfg = Release|x64
{FDB84CBB-2FB6-47C8-A2D6-091E0833239D}.Release|x64.Build.0 = Release|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.Debug|ARM.ActiveCfg = Debug|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Debug|Win32.ActiveCfg = Debug|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Debug|Win32.Build.0 = Debug|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Debug|x64.ActiveCfg = Debug|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.Debug|x64.Build.0 = Debug|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.PGInstrument|ARM.ActiveCfg = PGInstrument|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.PGInstrument|x64.Build.0 = PGInstrument|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.PGUpdate|ARM.ActiveCfg = PGUpdate|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.PGUpdate|x64.Build.0 = PGUpdate|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|ARM.ActiveCfg = Release|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|Win32.ActiveCfg = Release|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|Win32.Build.0 = Release|Win32
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|x64.ActiveCfg = Release|x64
{AB603547-1E2A-45B3-9E09-B04596006393}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 16 additions & 0 deletions PCbuild/venvwlauncher.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
Expand All @@ -9,6 +13,10 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|ARM">
<Configuration>PGInstrument</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGInstrument|Win32">
<Configuration>PGInstrument</Configuration>
<Platform>Win32</Platform>
Expand All @@ -17,6 +25,10 @@
<Configuration>PGInstrument</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|ARM">
<Configuration>PGUpdate</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="PGUpdate|Win32">
<Configuration>PGUpdate</Configuration>
<Platform>Win32</Platform>
Expand All @@ -25,6 +37,10 @@
<Configuration>PGUpdate</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down
32 changes: 31 additions & 1 deletion Tools/winiot/sync_win_iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def include_in_tools(p):
FULL_LAYOUT = [
('/', '$source', 'python.exe', is_not_debug),
('/', '$source', 'pythonw.exe', is_not_debug),
('/', '$source', 'venvlauncher.exe', is_not_debug),
('/', '$source', 'venvwlauncher.exe', is_not_debug),
('/', '$source', 'python{}.dll'.format(sys.version_info.major), is_not_debug),
('/', '$source', '{}.dll'.format(BASE_NAME), is_not_debug),
('DLLs/', '$source', '*.pyd', is_not_debug),
Expand All @@ -141,6 +143,8 @@ def include_in_tools(p):
FULL_LAYOUT_DEBUG = [
('/', '$source', 'python_d.exe', is_debug),
('/', '$source', 'pythonw_d.exe', is_debug),
('Lib/', '$source', 'venvlauncher_d.exe', is_debug),
('Lib/', '$source', 'venvwlauncher_d.exe', is_debug),
('/', '$source', 'python{}_d.dll'.format(sys.version_info.major), is_debug),
('/', '$source', '{}_d.dll'.format(BASE_NAME), is_debug),
('include/', 'include', '*.h', None),
Expand Down Expand Up @@ -269,7 +273,33 @@ def main():
fs = repo / s
print('fs = {}'.format(fs))
files = rglob(fs, p, c, includeDebug)
copied = copy_to_layout(output / t.rstrip('/'), files)
extra_files = []
if s == 'Lib' and p == '**/*':
extra_files.append((
repo / 'tools' / 'msi' / 'distutils.command.bdist_wininst.py',
Path('distutils') / 'command' / 'bdist_wininst.py'
))
if p == 'venvlauncher.exe':
extra_files.append((
source / p,
Path('venv') / 'Scripts' / 'nt' / 'python.exe'
))
if p == 'venvwlauncher.exe':
extra_files.append((
source / p,
Path('venv') / 'Scripts' / 'nt' / 'pythonw.exe'
))
if p == 'venvlauncher_d.exe':
extra_files.append((
source / p,
Path('venv') / 'Scripts' / 'nt' / 'python_d.exe'
))
if p == 'venvwlauncher_d.exe':
extra_files.append((
source / p,
Path('venv') / 'Scripts' / 'nt' / 'pythonw_d.exe'
))
copied = copy_to_layout(output / t.rstrip('/'), chain(files, extra_files))
print('Copied {} files'.format(copied))

print("================================================================================")
Expand Down

0 comments on commit bbac193

Please sign in to comment.