Skip to content
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

pod lib lint fails on 1.11.0 with build error: Build input file cannot be found: 'App/App-Info.plist' #10927

Closed
1 task done
jmagman opened this issue Sep 8, 2021 · 24 comments
Milestone

Comments

@jmagman
Copy link
Contributor

jmagman commented Sep 8, 2021

Report

What did you do?

Upgrading CocoaPods from 1.10.2 to 1.11.0 I'm seeing a new failure in our CI system.

$ pod lib lint /opt/s/w/ir/x/w/recipe_cleanup/tmpK9yZMz/flutter sdk/packages/integration_test/ios/integration_test.podspec --configuration=Debug --use-libraries --verbose

What did you expect to happen?

Validation to pass, as it does on 1.10.2.

What happened instead?

The consumer app App-Info.plist is written to a relative, incorrect directory (#10787 is in 1.11.0)

- Generating Info.plist file at `../CocoaPods-Lint-20210906-27999-176vrus-integration_test/App/App-Info.plist`
ProcessInfoPlistFile /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-bzrucbzorrpapvczllqelmqpwdql/Build/Products/Debug-iphonesimulator/App.app/Info.plist /opt/s/w/ir/x/t/App/App-Info.plist (in target 'App' from project 'App')
    cd /opt/s/w/ir/x/t/CocoaPods-Lint-20210906-27999-176vrus-integration_test
    builtin-infoPlistUtility /opt/s/w/ir/x/t/App/App-Info.plist -producttype com.apple.product-type.application -genpkginfo /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-bzrucbzorrpapvczllqelmqpwdql/Build/Products/Debug-iphonesimulator/App.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-bzrucbzorrpapvczllqelmqpwdql/Build/Products/Debug-iphonesimulator/App.app/Info.plist
error: Build input file cannot be found: '/opt/s/w/ir/x/t/App/App-Info.plist' (in target 'App' from project 'App')
...
  -> integration_test (0.0.1)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

CocoaPods Environment

For the life of me I couldn't get this to reproduce locally with the same version of CocoaPods and Xcode, and with the same tmp directories, even with the space in the path. So I only have logging from our CI; apologies this info is not in the correct format.

Xcode 12.3.0

bundler install

Fetching cocoapods-core 1.11.0
Installing cocoapods-core 1.11.0
Fetching cocoapods 1.11.0
Installing cocoapods 1.11.0

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836805892094071985/+/u/Install_gems/install_gems/stdout

gems directory list:

/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-1.11.0.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-core-1.11.0.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-deintegrate-1.0.5.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-downloader-1.5.0.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-plugins-1.0.0.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-search-1.0.1.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-trunk-1.6.0.gem
/opt/s/w/ir/x/w/gems/ruby/2.6.0/cache/cocoapods-try-1.2.0.gem

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836805892094071985/+/u/Install_gems/list_bundle/listdir

Project that demonstrates the issue

Here's the full pod lib lint --verbose output. I can get the --no-clean directory off the CI with effort, if needed, though hopefully it can be diagnosed from just the App-Info.plist incorrect relative directory.

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836805892094071985/+/u/run_plugin_lint_mac/test_stdout

Gemfile.lock bump PR where this was discovered:
flutter/flutter#89561

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

This is a great issue report thanks a lot. Will mark for 1.11.1. If this is fixed quickly I will release 1.11.1 this week.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

yeah I cant seem to be able to repro myself either........

if you do --no-clean can you inspect in CI where the file is present and maybe diagnose the workspace?

[plugin_lint_mac] [STDOUT] stdout:     ProcessInfoPlistFile /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-afcppvfagmjrsafrnlkaemrzozaf/Build/Products/Debug-iphonesimulator/App.app/Info.plist /opt/s/w/ir/x/t/App/App-Info.plist (in target 'App' from project 'App')
[plugin_lint_mac] [STDOUT] stdout:         cd /opt/s/w/ir/x/t/CocoaPods-Lint-20210906-27818-min1b6-integration_test
[plugin_lint_mac] [STDOUT] stdout:         builtin-infoPlistUtility /opt/s/w/ir/x/t/App/App-Info.plist -producttype com.apple.product-type.application -genpkginfo /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-afcppvfagmjrsafrnlkaemrzozaf/Build/Products/Debug-iphonesimulator/App.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/chrome-bot/Library/Developer/Xcode/DerivedData/App-afcppvfagmjrsafrnlkaemrzozaf/Build/Products/Debug-iphonesimulator/App.app/Info.plist
[plugin_lint_mac] [STDOUT] stdout:     error: Build input file cannot be found: '/opt/s/w/ir/x/t/App/App-Info.plist' (in target 'App' from project 'App')

@jmagman
Copy link
Contributor Author

jmagman commented Sep 8, 2021

if you do --no-clean can you inspect in CI where the file is present and maybe diagnose?

Thanks for investigating! I will try to grab the files off that CI machine and get back to you.

@jmagman
Copy link
Contributor Author

jmagman commented Sep 8, 2021

Here's a zip of the --no-clean directory:
https://storage.googleapis.com/flutter_logs/flutter/d3a8b15e-6899-414c-b001-632fcee8afc4/plugin_lint_mac/d3a8b15e-6899-414c-b001-632fcee8afc4/lint-2021-09-07T22:16:40.747458.zip

Full logs at https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836684408898221361/+/u/run_plugin_lint_mac/test_stdout. Note the test ran 3 times, the zipped directory is from just the first run.

I was wrong about the relative path, it's there:

- Generating Info.plist file at `../CocoaPods-Lint-20210907-22815-135xneb-integration_test/App/App-Info.plist`

The problem is that the INFOPLIST_FILE isn't right. It's ../App/App-Info.plist which is resolving to /opt/s/w/ir/x/t/App/App-Info.plist instead of /opt/s/w/ir/x/t/CocoaPods-Lint-20210907-22815-135xneb-integration_test/App/App-Info.plist.

Looks like this code hasn't changed in awhile.

relative_path_string = path.relative_path_from(sandbox.root).to_s
native_target.build_configurations.each do |c|
c.build_settings['INFOPLIST_FILE'] = relative_path_string
end

Maybe app_project.path.dirname in the new code isn't the right logic? I haven't Ruby'ed in awhile though. 🙂

info_plist_path = app_project.path.dirname.+('App/App-Info.plist')

Instead of using create_info_plist_file_with_sandbox, you could generate the Info.plist the same way, but set INFOPLIST_FILE to $(SRCROOT)/App/App-Info.plist instead of generating the relative sandbox path.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

this is awesome. Thanks again for the breakdown and diagnosis. Yeah I think you are right but let me see a bit further by app_project.path.dirname is not working.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

and you are certain nothing in your scripts or anything in CI manipulates the sandbox to cause this to happen? Its a bit weird only that CI environment has the issue but you and I cannot see it locally.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

alternatively yes we can change the the build setting not to use this.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

Hopefully we can resolve this by identifying something "unique" in the CI pipeline. Otherwise I cant seem to figure out why and when this can happen.

@jmagman
Copy link
Contributor Author

jmagman commented Sep 8, 2021

and you are certain nothing in your scripts or anything in CI manipulates the sandbox to cause this to happen? Its a bit weird only that CI environment has the issue but you and I cannot see it locally.

Not that I can think of, it's really just finding the podspec and then running pod lib lint --configuration=Debug --use-libraries --verbose
https://github.com/flutter/flutter/blob/d2de2adb6b4e3e3da53e98065d164712a6631070/dev/devicelab/bin/tasks/plugin_lint_mac.dart#L28-L37

The environment variables can be found at https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836684408898221361/+/u/run_plugin_lint_mac/execution_details under full environment: in case you see anything suspicious in there.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

yeah I looked around and couldnt find anything that stands out.

@jmagman if you edit the generated project manually and set it to $(SRCROOT)/App/App.plist does it fix the issue ?

@jmagman
Copy link
Contributor Author

jmagman commented Sep 8, 2021

From that zip I updated the Development Pods integration_test group absolute path to the correct paths on my machine (since it was referencing the tmp directories on the CI machine). I was then able to reproduce:

error: Build input file cannot be found: '/Users/m/Downloads/opt/s/w/ir/x/t/App/App-Info.plist' (in target 'App' from project 'App')

I then changed INFOPLIST_FILE to $(SRCROOT)/App/App-Info.plist (note you were missing the -Info in case you're copying 🙂 ) and it built correctly.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 8, 2021

ha, was not copying.

OK I think we might make this change since we cant understand why and when this happens.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

I will make a PR that changes this to use $(SRCROOT)/App/App-Info.plist instead.

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

@jmagman can you try #10937 in your CI perhaps? Thanks!

@jmagman
Copy link
Contributor Author

jmagman commented Sep 9, 2021

Trying in flutter/flutter#89783, it seems mad about grabbing the gem source from the ref, investigating...

[plugin_lint_mac] [STDOUT] stderr: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836535966480120881/+/u/run_plugin_lint_mac/test_stdout

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

@jmagman try using the :branch instead? I did force push but I had checked your CI logs and that error you pasted has happened before I forced pushed.

@jmagman
Copy link
Contributor Author

jmagman commented Sep 9, 2021

@jmagman try using the :branch instead? I did force push but I had checked your CI logs and that error you pasted has happened before I forced pushed.

I spotted that and already updated the ref. 🙂

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

I think you will hit the same error...but lets see :)

@dnkoutso
Copy link
Contributor

dnkoutso commented Sep 9, 2021

@jmagman same issue :|

@dnkoutso
Copy link
Contributor

@jmagman I ended up merging the PR, it might make it easier to test but I am also confident it will work. I can ship 1.11.1 after this is verified from your end later today (PST)

@jmagman
Copy link
Contributor Author

jmagman commented Sep 10, 2021

@jmagman I ended up merging the PR, it might make it easier to test but I am also confident it will work. I can ship 1.11.1 after this is verified from your end later today (PST)

Not sure why but I couldn't get any :git remote gems working on these machines so unfortunately I can't seem to validate it (and I did try... https://github.com/flutter/flutter/pull/89783/commits)

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836456440229135553/+/u/run_plugin_lint_mac/test_stdout

I did confirm that 1-11-stable branch pod lib lint commands worked on my machine, though that doesn't prove much since I wasn't able to reproduce on this machine. At a minimum it didn't regress anything that I could spot...
Screen Shot 2021-09-10 at 3 05 49 PM

I appreciate you fixing this so quickly, I'm sorry I couldn't be more help validating it.

@dnkoutso
Copy link
Contributor

@jmagman I released 1.11.2 (I had to do two releases because I missed a fix). Can you either try 1.11.1 or 1.11.2 now to verify? thank you!

@jmagman
Copy link
Contributor Author

jmagman commented Sep 13, 2021

It worked! https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8836185115385117969/+/u/run_plugin_lint_mac/test_stdout

Thank you so much for the quick fix, it's much appreciated!

@dnkoutso
Copy link
Contributor

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

No branches or pull requests

2 participants