Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
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
17 changes: 12 additions & 5 deletions .github/workflows/update-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ defaults:
jobs:
build-stubs:
name: Build stub binaries
runs-on: windows-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
config:
- runner: windows-latest
arch: x64
suffix: ''
Comment thread
freakboy3742 marked this conversation as resolved.
Outdated
- runner: windows-11-arm
arch: ARM64
suffix: '-arm'
Comment thread
freakboy3742 marked this conversation as resolved.
Outdated
runs-on: ${{ matrix.config.runner }}
steps:
- name: Set Build Variables
id: build-vars
Expand Down Expand Up @@ -52,11 +59,11 @@ jobs:
briefcase build windows visualstudio

echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} console stub artefact"
mv "./build/console-stub/windows/visualstudio/x64/Release/console-stub.exe" ./Stub.exe
mv "./build/console-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/console-stub.exe" ./Stub.exe
7z a Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe

echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} GUI stub artefact"
mv "./build/gui-stub/windows/visualstudio/x64/Release/GUI Stub.exe" ./Stub.exe
mv "./build/gui-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/GUI Stub.exe" ./Stub.exe
7z a GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe

echo "Stub binaries:"
Expand All @@ -72,5 +79,5 @@ jobs:
python -m pip install -U setuptools
python -m pip install awscli

aws s3 cp stub/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip
aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip
aws s3 cp stub/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip
aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ However, if you *do* want use this template directly...
* **Deskop Development with C++** - default options, plus the "C++/CLI Support for v143 build tools".

4. `Obtain a Python Windows Embeddable package`_, and extract it into the
``My Project/x64/Release`` directory generated by the template. This will give you a
``My Project/x64/Release`` directory generated by the template (`ARM64` if you're on ARM64). This will give you a
Comment thread
freakboy3742 marked this conversation as resolved.
Outdated
``python3.dll`` (amongst other artefacts) in the ``My Project/x64/Release`` folder.

5. Add your code to the template, into the ``My Project/x64/Release/app`` directory.
Expand Down Expand Up @@ -87,6 +87,8 @@ file. Open a command prompt, and change into the ``My Project`` directory. Then:

C:\...>wix build -ext WixToolset.UI.wixext -arch x64 my-project.wxs -loc unicode.wxl -o "My Project.msi"

Use `-arch arm64` if you're on ARM64.

The MSI file can then be used to install your application. When installed, your
application will have an entry in your Start menu.

Expand Down
2 changes: 2 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"post_install_script": "",
"pre_uninstall_script": "",
"python_version": "3.X.0",
"host_arch": "AMD64",
"configuration": "{{ 'ARM64' if cookiecutter.host_arch == 'ARM64' else 'x64' }}",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"configuration" is a little vague here - and internal to VSCode, I think "Configuration" is more about "Release" or "Debug"; maybe "vscode_platform"?

"_extensions": [
"briefcase.integrations.cookiecutter.PythonVersionExtension",
"briefcase.integrations.cookiecutter.UUIDExtension",
Expand Down
8 changes: 4 additions & 4 deletions {{ cookiecutter.format }}/briefcase.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
target_version = "0.3.24"

[paths]
app_path = "x64/Release/app"
app_packages_path = "x64/Release/app_packages"
support_path = "x64/Release"
app_path = "{{ cookiecutter.configuration }}/Release/app"
app_packages_path = "{{ cookiecutter.configuration }}/Release/app_packages"
support_path = "{{ cookiecutter.configuration }}/Release"
extras_path = "extras"
{# Minor versions for 3.10, 3.11, and 3.12 cannot be bumped further -#}
{# since Python is not hosting embeddable zipped versions of them -#}
Expand All @@ -22,5 +22,5 @@ icon = "{{ cookiecutter.formal_name }}/icon.ico"
document_type_icon.{{ document_type_id }} = "{{ cookiecutter.app_name }}-{{ document_type_id }}.ico"
{% endfor %}
cleanup_paths = [
"x64/Release/python*.exe",
"{{ cookiecutter.configuration }}/Release/python*.exe",
]
6 changes: 6 additions & 0 deletions {{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
Debug|ARM64 = Debug|ARM64
Release|ARM64 = Release|ARM64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Debug|x64.ActiveCfg = Debug|x64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Debug|x64.Build.0 = Debug|x64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Release|x64.ActiveCfg = Release|x64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Release|x64.Build.0 = Release|x64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Debug|ARM64.ActiveCfg = Debug|ARM64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Debug|ARM64.Build.0 = Debug|ARM64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Release|ARM64.ActiveCfg = Release|ARM64
{6887C8E5-0B59-4F0A-84AC-6CB7282BF296}.Release|ARM64.Build.0 = Release|ARM64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
{% if cookiecutter.host_arch == 'ARM64' %}
<package id="pythonarm64" version="{{ cookiecutter.python_version|nuget_version }}" targetFramework="native" />
{% else %}
<package id="python" version="{{ cookiecutter.python_version|nuget_version }}" targetFramework="native" />
{% endif %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there no way for this to contain both, selected conditionally on which target is being used? Or, alternatively - produce two packages.config files selecting the right file as appropriate? It seems weird to have a VSCode file that works for both architectures, but a packages.config that only works for one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a way to do it dynamically. Looks like Visual Studio supports an alternative way of specifying packages in the project file (PackageReference) but the Platform property doesn't appear to be supported there.

</packages>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props" Condition="Exists('..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" />
<Import Project="..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props" Condition="'$(Platform)'=='x64' And Exists('..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" />
<Import Project="..\packages\pythonarm64.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props" Condition="'$(Platform)'=='ARM64' And Exists('..\packages\pythonarm64.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
Expand All @@ -10,6 +11,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
Expand All @@ -20,14 +29,14 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
Expand All @@ -39,20 +48,20 @@
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)'=='Debug'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)'=='Release'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>{% if cookiecutter.console_app %}{{ cookiecutter.app_name }}{% else %}{{ cookiecutter.formal_name }}{% endif %}</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>{% if cookiecutter.console_app %}{{ cookiecutter.app_name }}{% else %}{{ cookiecutter.formal_name }}{% endif %}</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -63,7 +72,7 @@
<EntryPointSymbol>Main</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down Expand Up @@ -109,6 +118,7 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props'))" />
<Error Condition="'$(Platform)'=='x64' And !Exists('..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\python.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props'))" />
<Error Condition="'$(Platform)'=='ARM64' And !Exists('..\packages\pythonarm64.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\pythonarm64.{{ cookiecutter.python_version|nuget_version }}\build\native\python.props'))" />
</Target>
</Project>