Skip to content

fix: support Windows hook execution with native-asset deps - #1677

Open
amrgetment wants to merge 1 commit into
felangel:masterfrom
amrgetment:fix/windows-native-assets-hooks
Open

fix: support Windows hook execution with native-asset deps#1677
amrgetment wants to merge 1 commit into
felangel:masterfrom
amrgetment:fix/windows-native-assets-hooks

Conversation

@amrgetment

Copy link
Copy Markdown

Status

READY

Description

Closes #1676.

This PR keeps the change in a single PR and addresses the Windows hook execution regression that led to reverting win32 v6 support in #1662 (after #1650 introduced it).

What changed

  1. Windows-safe hook execution path in packages/mason/lib/src/hooks.dart

    • On Windows, hooks are now executed via a dart run process path instead of Isolate.spawnUri.
    • Hook vars are passed in/out through JSON files (--vars-input / --vars-output) so variable mutation still round-trips back to Mason.
    • Existing non-Windows path remains unchanged.
  2. Generated hook entrypoint now supports both execution modes

    • Isolate mode (existing behavior) for non-Windows.
    • Process mode for Windows with optional --working-directory.
  3. Regression coverage

    • Added fixture: packages/mason/test/fixtures/windows_native_assets/**
    • Added test: supports hook dependencies with native assets on Windows in packages/mason/test/src/hooks_test.dart.
  4. Restored mason_logger win32 v6 compatibility

Type of Change

  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Verification

  • dart analyze in packages/mason: ✅
  • dart test test/src/hooks_test.dart --plain-name "supports hook dependencies with native assets on Windows" in packages/mason: ✅
  • dart test test/src/hooks_test.dart in packages/mason: ⚠️ one environment-specific failure here on macOS due missing dartaotruntime for the existing aot-snapshot programmatic usage test.
  • dart analyze in packages/mason_logger: ✅

Related

@amrgetment
amrgetment requested a review from felangel as a code owner May 18, 2026 16:08
@amrgetment
amrgetment force-pushed the fix/windows-native-assets-hooks branch 2 times, most recently from cae83e5 to 58cb529 Compare May 18, 2026 16:23
@amrgetment
amrgetment force-pushed the fix/windows-native-assets-hooks branch from 58cb529 to e8d5214 Compare May 18, 2026 16:28
@amrgetment amrgetment mentioned this pull request May 18, 2026
7 tasks
@yurtemre7

Copy link
Copy Markdown

@felangel we need this fix =)!

@felangel

felangel commented Jul 8, 2026

Copy link
Copy Markdown
Owner

@felangel we need this fix =)!

Sorry I’ve been busy but this is on my todo list. I should have time to review and merge later today

@xShuusui

Copy link
Copy Markdown

Would be awesome 💯

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.

fix: support native-asset hook execution on Windows

5 participants