Is there an existing issue for this?
Which plugins are affected?
Zstandard, Zstandard iOS
Which platforms are affected?
iOS
Description
ios/zstandard_ios.podspec (v1.5.0) defines two build-time script phases:
- Sync zstd — copies the zstd C sources into
Classes/zstd/ (:execution_position => :before_headers)
- Remove synced zstd —
rm -rf "${PODS_TARGET_SRCROOT}/Classes/zstd" with :execution_position => :any
Because the removal phase uses :any and declares no input/output files, Xcode's parallel build system is free to schedule it before or during compilation of the very sources it deletes.
Expected: iOS builds succeed deterministically.
Actual: builds fail intermittently with Build input file cannot be found for zstd C sources (compress/zstdmt_compress.c, legacy/zstd_v06.c, legacy/zstd_v07.c), then succeed on retry with no changes, then fail again. Xcode also warns the phase "will be run during every build because it does not specify any outputs."
Side effect worth flagging: PODS_TARGET_SRCROOT resolves (through Flutter's .symlinks) into the user's pub cache, so this phase deletes files from ~/.pub-cache/hosted/pub.dev/zstandard_ios-1.5.0/ — mutating the shared package cache on every build.
Suggested fix: delete the Remove synced zstd script phase. The Sync zstd phase plus the prepare_command already guarantee the sources exist, and consumers never need them removed at build time. I verified locally that removing the phase and re-running pod install makes builds deterministic.
Reproducing the issue
- Add
zstandard: 1.5.0 to a Flutter app.
- Run
flutter build ios --simulator --debug repeatedly (a clean DerivedData makes the failure more likely).
- Builds alternate between success and "Build input file cannot be found" for zstd C sources, with no code changes between runs.
Flutter Version
3.44.5
Relevant Log Output
Error (Xcode): Build input file cannot be found:
'/Users/<user>/.pub-cache/hosted/pub.dev/zstandard_ios-1.5.0/ios/Classes/zstd/compress/zstdmt_compress.c'.
Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Also seen for:
.../zstandard_ios-1.5.0/ios/Classes/zstd/legacy/zstd_v06.c
.../zstandard_ios-1.5.0/ios/Classes/zstd/legacy/zstd_v07.c
Xcode warning:
Run script build phase '[CP-User] Remove synced zstd' will be run during every build
because it does not specify any outputs.
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
This looks related to the script phases introduced for #127 ("Apple scripts out of packages") — the sync phase works, but the removal phase's :execution_position => :any lets Xcode schedule it against the compiler. SPM support is already tracked in #141, so not raising that here.
Is there an existing issue for this?
Which plugins are affected?
Zstandard, Zstandard iOS
Which platforms are affected?
iOS
Description
ios/zstandard_ios.podspec(v1.5.0) defines two build-time script phases:Classes/zstd/(:execution_position => :before_headers)rm -rf "${PODS_TARGET_SRCROOT}/Classes/zstd"with:execution_position => :anyBecause the removal phase uses
:anyand declares no input/output files, Xcode's parallel build system is free to schedule it before or during compilation of the very sources it deletes.Expected: iOS builds succeed deterministically.
Actual: builds fail intermittently with
Build input file cannot be foundfor zstd C sources (compress/zstdmt_compress.c,legacy/zstd_v06.c,legacy/zstd_v07.c), then succeed on retry with no changes, then fail again. Xcode also warns the phase "will be run during every build because it does not specify any outputs."Side effect worth flagging:
PODS_TARGET_SRCROOTresolves (through Flutter's.symlinks) into the user's pub cache, so this phase deletes files from~/.pub-cache/hosted/pub.dev/zstandard_ios-1.5.0/— mutating the shared package cache on every build.Suggested fix: delete the
Remove synced zstdscript phase. TheSync zstdphase plus theprepare_commandalready guarantee the sources exist, and consumers never need them removed at build time. I verified locally that removing the phase and re-runningpod installmakes builds deterministic.Reproducing the issue
zstandard: 1.5.0to a Flutter app.flutter build ios --simulator --debugrepeatedly (a clean DerivedData makes the failure more likely).Flutter Version
3.44.5
Relevant Log Output
Flutter dependencies
Expand
Flutter dependenciessnippetReplace this line with the contents of your `flutter pub deps -- --style=compact`.Additional context and comments
This looks related to the script phases introduced for #127 ("Apple scripts out of packages") — the sync phase works, but the removal phase's
:execution_position => :anylets Xcode schedule it against the compiler. SPM support is already tracked in #141, so not raising that here.