Skip to content

Avoid rebuilding Flutter tool on first run after vfox install - #39

Merged
linghengqian merged 1 commit into
mainfrom
diff
Oct 9, 2026
Merged

linghengqian merged 1 commit into
mainfrom
diff

Conversation

@linghengqian

@linghengqian linghengqian commented Oct 9, 2026 •

Copy link
Copy Markdown
Member
  • Fixes On Linux x86_64, the plugin differs in behavior from the standard Flutter installation process #37 .
  • Avoid rebuilding Flutter tool on first run after vfox install.
    • Root cause: vfox extracts archives with Go's archive/tar, which drops original mtimes. After install packages/flutter_tools/pubspec.yaml ends up newer than pubspec.lock, so bin/internal/shared.sh:upgrade_flutter sees yaml -nt lock and rebuilds the tool (Building flutter tool...), unlike official tar -xf where lock stays newer.
    • Change: PostInstall now rewrites pubspec.lock (manifest.touchPubspecLock) to bump its mtime past pubspec.yaml, restoring official first-run behavior. Safe for source/ohos installs (snapshot-missing rebuild still happens) and no-op when lock is absent.
    • Verified in Docker (flutter@3.47.5, linux/x64): before fix yaml > lock + first run rebuilds; after fix lock > yaml + flutter --disable-analytics prints only Analytics reporting disabled. Unit tests in tests/hooks_test.lua cover flat/nested layouts and missing-file cases.

@linghengqian linghengqian added the bug Something isn't working label Oct 9, 2026
@linghengqian
linghengqian force-pushed the diff branch 3 times, most recently from 01163f7 to 173ea0c Compare October 9, 2026 02:44
@linghengqian
linghengqian marked this pull request as ready for review October 9, 2026 03:41
@linghengqian
linghengqian merged commit 24ba478 into main Oct 9, 2026
9 checks passed
@linghengqian
linghengqian deleted the diff branch October 9, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Linux x86_64, the plugin differs in behavior from the standard Flutter installation process

1 participant