Skip to content

feat(win32): support prebuilt assets in the build hook#1064

Merged
halildurmus merged 1 commit intomainfrom
prebuilt
Apr 22, 2026
Merged

feat(win32): support prebuilt assets in the build hook#1064
halildurmus merged 1 commit intomainfrom
prebuilt

Conversation

@halildurmus
Copy link
Copy Markdown
Owner

@halildurmus halildurmus commented Apr 22, 2026

Description

The build hook currently compiles native code from C source on the user's machine using package:native_toolchain_c, which requires MSVC to be installed. This is a significant friction point for users that don't have the necessary tools installed — even when they're not targeting Windows desktop themselves (e.g., they just have package:win32 as a transitive dependency).

This PR changes the build hook to download prebuilt binaries from the GitHub release artifacts instead of compiling from source, by default.

Key details

  • Prebuilt .dll assets are downloaded from the corresponding GitHub release tag at build time
  • Downloads are verified by MD5 hash to detect corruption or partial transfers
  • Retry logic with exponential backoff handles transient network failures
  • Users who prefer or require local compilation can opt out via the local_build user-define in their pubspec.yaml:
hooks:
  user_defines:
    win32:
      local_build: true

Related Issue

fluttercommunity/plus_plugins#3794

Type of Change

  • 🚀 feat – New feature (non-breaking change that adds functionality)
  • 🛠️ fix – Bug fix (non-breaking change that fixes an issue)
  • ! – Breaking change (fix or feature that causes existing functionality to change)
  • perf – Performance improvement
  • 🧹 refactor – Code refactor (no functionality change)
  • 📝 docs – Documentation update
  • 🎨 style – Code style changes (formatting, renaming, etc.)
  • 🧪 test – Test update or addition
  • 🔧 build – Build related changes
  • ci – CI related changes
  • 🗑️ chore – Chore (maintenance, non-production code change)
  • ◀️ revert – Revert a previous commit

@github-actions github-actions Bot added package: generator Issue with package:generator ci Updates to CI workflows or scripts package: win32 Issue with package:win32 labels Apr 22, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.92%. Comparing base (7569f7a) to head (e582919).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1064      +/-   ##
==========================================
+ Coverage   85.69%   87.92%   +2.23%     
==========================================
  Files          91      216     +125     
  Lines        5202    10530    +5328     
==========================================
+ Hits         4458     9259    +4801     
- Misses        744     1271     +527     
Flag Coverage Δ
ffi_leak_tracker 83.96% <ø> (ø)
generator 86.09% <ø> (+<0.01%) ⬆️
win32 80.07% <ø> (ø)
win32_clipboard 93.00% <ø> (ø)
win32_registry 88.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 126 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@halildurmus halildurmus merged commit 9d58266 into main Apr 22, 2026
72 checks passed
@halildurmus halildurmus deleted the prebuilt branch April 22, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Updates to CI workflows or scripts package: generator Issue with package:generator package: win32 Issue with package:win32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants