Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Only run pod install on the first iOS build #108205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Jul 23, 2022

  1. pod install is skipped based on SHAs stored in a fingerprint file. Fix the bug where the fingerprint file isn't being written to the first time when the directory structure isn't created.
  2. Do not run pod install when Generated.xcconfig changes. The build settings in the file should not impact any of the dependencies anymore, and that file changes all the time like every time you run a different integration_test test.

Fixes #108202

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jul 23, 2022
@jmagman jmagman self-assigned this Jul 23, 2022
@@ -11,15 +11,15 @@ import 'test_utils.dart';

void main() {
test('flutter build ios --config only updates generated xcconfig file without performing build', () async {
final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world');
final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'flutter_gallery');
Copy link
Member Author

Choose a reason for hiding this comment

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

Change to example project that has pods.

@jmagman

This comment was marked as outdated.

@jmagman jmagman marked this pull request as draft July 25, 2022 18:09
@jmagman jmagman force-pushed the xcconfig-cache branch 3 times, most recently from 78a9880 to e0b7cb1 Compare July 26, 2022 01:30
@jmagman jmagman changed the title Add test to validate pod install only run once Only run pod install on the first iOS build Jul 26, 2022
@jmagman jmagman marked this pull request as ready for review July 26, 2022 03:30
_fileSystem.file(fingerprintPath).writeAsStringSync(fingerprint.toJson());
final File fingerprintFile = _fileSystem.file(fingerprintPath);
fingerprintFile.createSync(recursive: true);
fingerprintFile.writeAsStringSync(fingerprint.toJson());
Copy link
Member Author

@jmagman jmagman Jul 26, 2022

Choose a reason for hiding this comment

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

Fingerprint write error: FileSystemException: Cannot open file, path = 'build/ios/pod_inputs.fingerprint' (OS Error: No such file or directory, errno = 2)

writeAsStringSync wasn't recursively creating the directory structure. This write succeeded after the first successful build.

Copy link
Contributor

Choose a reason for hiding this comment

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

d'oh

testWithoutContext('fingerprint does match if identical', () {
fileSystem.file('a.dart').createSync();
fileSystem.file('b.dart').createSync();

const String fingerprintPath = 'path/to/out.fingerprint';
Copy link
Member Author

Choose a reason for hiding this comment

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

This test failed on master.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

Nice catch, LGTM

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 26, 2022
@auto-submit auto-submit bot merged commit 50474b2 into flutter:master Jul 26, 2022
@jmagman jmagman deleted the xcconfig-cache branch July 26, 2022 19:49
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jul 28, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flutter build ios/macos/run is running pod install on every build even when nothing changes, adding 2s
2 participants