Skip to content

fix(windows): bundle Tcl/Tk data in PyInstaller builds - #1976

Merged
amilcarlucas merged 1 commit into
masterfrom
fix_windows_release
Aug 25, 2026
Merged

fix(windows): bundle Tcl/Tk data in PyInstaller builds#1976
amilcarlucas merged 1 commit into
masterfrom
fix_windows_release

Conversation

@amilcarlucas

Copy link
Copy Markdown
Collaborator

Description

Pin the Windows build toolchain and verify bundled Tcl/Tk data to prevent the configurator from failing at startup.

Checklist

  • Run pre-commit checks locally
  • Verified by a human programmer
  • All commits are signed off (use git commit --signoff)
  • Code follows our coding standards
  • Documentation updated if needed
  • No breaking changes or properly documented

Testing

Describe how you tested these changes:

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • Tested on flight controller hardware

Pin the Windows build toolchain and verify bundled Tcl/Tk data to
prevent the configurator from failing at startup.
Copilot AI lite review requested due to automatic review settings August 24, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pins the Windows packaging toolchain and ensures PyInstaller bundles Tcl/Tk library data so the Windows configurator doesn’t fail at startup due to missing tkinter runtime data.

Changes:

  • Set TCL_LIBRARY / TK_LIBRARY in the PyInstaller spec to force bundling of Tcl/Tk data.
  • Pin/update packaging dependencies (including pyinstaller-hooks-contrib) and lock uv to an exact version.
  • Make the CI Windows build more reproducible (exact Python version) and add verification that Tcl/Tk data was bundled.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
windows/ardupilot_methodic_configurator.spec Forces discovery of Tcl/Tk library directories at build time so PyInstaller collects the right data.
pyproject.toml Pins/extends build tool dependencies (hooks contrib) and locks uv version for reproducibility.
.github/workflows/build_windows_macos.yml Pins Windows Python patch version and adds CI checks to validate Tcl/Tk bundling and runtime introspection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +8 to +20
import sys


def _find_tcl_tk_library(directory: Path, prefix: str) -> Path:
"""Return the Tcl/Tk library directory shipped with the build Python."""
library_file = "init.tcl" if prefix == "tcl" else "tk.tcl"
candidates = sorted(
(path for path in directory.glob(f"{prefix}*") if path.is_dir() and (path / library_file).is_file()),
reverse=True,
)
if not candidates:
raise SystemExit(f"Could not find {prefix} library data below {directory}")
return candidates[0]
Comment on lines +89 to +91
if (-not (Test-Path "dist\\ardupilot_methodic_configurator\\_internal\\_tcl_data\\init.tcl") -or
-not (Test-Path "dist\\ardupilot_methodic_configurator\\_internal\\_tk_data\\tk.tcl")) {
throw "PyInstaller did not bundle the Tcl/Tk library data."
@amilcarlucas
amilcarlucas merged commit f59554c into master Aug 25, 2026
25 of 31 checks passed
@amilcarlucas
amilcarlucas deleted the fix_windows_release branch August 25, 2026 07:59
@github-actions

Copy link
Copy Markdown
Contributor

☂️ Code Coverage

current status: ❌

Overall Coverage

Statements Covered Coverage Threshold Status
18456 16412 89% 89% 🔴

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: d6f5a94 by action🐍

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 32777142343

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 88.958%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 18456
Covered Lines: 16418
Line Coverage: 88.96%
Relevant Branches: 5540
Covered Branches: 4547
Branch Coverage: 82.08%
Branches in Coverage %: No
Coverage Strength: 2.65 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants