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

Cuckoo get crash on Xcode 16 when protocol has @MainActor, @Sendable #513

Open
levantAJ opened this issue Oct 4, 2024 · 2 comments
Open
Labels

Comments

@levantAJ
Copy link

levantAJ commented Oct 4, 2024

Protocol

func takeSnapshot(
    with snapshotConfiguration: WKSnapshotConfiguration?,
    completionHandler: @escaping @MainActor @Sendable (UIImage?, (any Error)?) -> Void
)

Crash log

[✔] 🚀
+---------------------------------------------------------------------------------------+
|                                     Used plugins                                      |
+--------------------------------------+---------+--------------------------------------+
| Plugin                               | Version | Action                               |
+--------------------------------------+---------+--------------------------------------+
| fastlane-plugin-firebase_app_distri  | 0.8.1   | firebase_app_distribution_add_teste  |
| bution                               |         | rs,                                  |
|                                      |         | firebase_app_distribution_get_udids  |
|                                      |         | ,                                    |
|                                      |         | firebase_app_distribution_create_gr  |
|                                      |         | oup,                                 |
|                                      |         | firebase_app_distribution_delete_gr  |
|                                      |         | oup, firebase_app_distribution,      |
|                                      |         | firebase_app_distribution_get_lates  |
|                                      |         | t_release,                           |
|                                      |         | firebase_app_distribution_remove_te  |
|                                      |         | sters                                |
| fastlane-plugin-file_manager         | 0.2.0   | remove_files, copy_files             |
| fastlane-plugin-instabug_official    | 0.3.4   | instabug_official                    |
| fastlane-plugin-gitlab_comment       | 0.1.0   | gitlab_comment                       |
+--------------------------------------+---------+--------------------------------------+

[17:32:58]: ----------------------------------------
[17:32:58]: --- Step: Verifying fastlane version ---
[17:32:58]: ----------------------------------------
[17:32:58]: Your fastlane version 2.223.1 matches the minimum requirement of 2.161.0  ✅
[17:32:58]: ------------------------------
[17:32:58]: --- Step: default_platform ---
[17:32:58]: ------------------------------
[17:32:58]: Driving the lane 'ios generate_mocks' 🚀
[17:32:58]: ------------------------------------------------------------------------------------------------------------
[17:32:58]: Step: ./scripts/cuckoo-generate-mocks.sh "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module" "MyModuleName" "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods"
[17:32:58]: ------------------------------------------------------------------------------------------------------------
[17:32:58]: $ ./scripts/cuckoo-generate-mocks.sh "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module" "MyModuleName" "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods"
[17:32:58]: ▸ Generated Mocks File = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleNameTests/Mock/GeneratedMocks.swift
[17:32:58]: ▸ Mocks Input Directory = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleName
[17:32:59]: ▸ Script path: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo
[17:33:00]: ▸ xargs: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo/cuckoo_generator: terminated with signal 11; aborting
+---------------------------------------+
|             Lane Context              |
+------------------+--------------------+
| DEFAULT_PLATFORM | ios                |
| PLATFORM_NAME    | ios                |
| LANE_NAME        | ios generate_mocks |
+------------------+--------------------+
[17:33:00]: Called from Fastfile at line 19
[17:33:00]: ```
[17:33:00]:     17:	      project_name = "MyModuleName"
[17:33:00]:     18:	      pods_root = Dir.pwd + "/Pods"
[17:33:00]:  => 19:	      sh("./scripts/cuckoo-generate-mocks.sh \"#{project_dir}\" \"#{project_name}\" \"#{pods_root}\"")
[17:33:00]:     20:	    end
[17:33:00]:     21:	  end
[17:33:00]: ```
[17:33:00]: Exit status of command './scripts/cuckoo-generate-mocks.sh "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module" "MyModuleName" "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods"' was 1 instead of 0.
Generated Mocks File = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleNameTests/Mock/GeneratedMocks.swift
Mocks Input Directory = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleName
Script path: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo
xargs: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo/cuckoo_generator: terminated with signal 11; aborting


+----------------------------------------------------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying fastlane version          | 0           |
| 2    | default_platform                    | 0           |
| 💥   | ./scripts/cuckoo-generate-mocks.sh  | 1           |
|      | "/Users/my_machine_name/MyApp/sa          |             |
+------+-------------------------------------+-------------+

+-----------------------------------------------------------+
|                 Plugin updates available                  |
+---------------------------+--------------+----------------+
| Plugin                    | Your Version | Latest Version |
+---------------------------+--------------+----------------+
| firebase_app_distribution | 0.8.1        | 0.9.1          |
| instabug_official         | 0.3.4        | 0.3.5          |
+---------------------------+--------------+----------------+
[17:33:00]: To update all plugins, just run
[17:33:00]: $ bundle exec fastlane update_plugins

[17:33:00]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

bundler: failed to load command: fastlane (/Users/my_machine_name/.rbenv/versions/2.7.2/bin/fastlane)
FastlaneCore::Interface::FastlaneShellError: [!] Exit status of command './scripts/cuckoo-generate-mocks.sh "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module" "MyModuleName" "/Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods"' was 1 instead of 0.
Generated Mocks File = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleNameTests/Mock/GeneratedMocks.swift
Mocks Input Directory = /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/MyModuleName
Script path: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo
xargs: /Users/my_machine_name/MyApp/my-main-app/FeatureFrameworks/my-module/Pods/Cuckoo/cuckoo_generator: terminated with signal 11; aborting

  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/helper/sh_helper.rb:16:in `sh_no_action'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/fast_file.rb:225:in `block in sh'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/fast_file.rb:224:in `sh'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/fast_file.rb:216:in `sh'
  Fastfile:19:in `block (3 levels) in parsing_binding'
  Fastfile:15:in `chdir'
  Fastfile:15:in `block (2 levels) in parsing_binding'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/lane.rb:41:in `call'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/commands_generator.rb:363:in `run'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
  /Users/my_machine_name/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/fastlane-2.223.1/bin/fastlane:23:in `<top (required)>'
  /Users/my_machine_name/.rbenv/versions/2.7.2/bin/fastlane:23:in `load'
  /Users/my_machine_name/.rbenv/versions/2.7.2/bin/fastlane:23:in `<top (required)>'
@MatyasKriz MatyasKriz added the bug label Oct 9, 2024
@MatyasKriz
Copy link
Collaborator

What is the expected mock in this case? I don't think we have any @MainActor or @Sendable tests in the project at the moment, so it would be helpful to add some.

@levantAJ
Copy link
Author

This is the protocol that I want to generate the mocks

protocol WKWebViewProtocol: AnyObject {
  func takeSnapshot(
      with snapshotConfiguration: WKSnapshotConfiguration?,
      completionHandler: @escaping @MainActor @Sendable (UIImage?, (any Error)?) -> Void
  )
}

When generate mock, the job get crashed as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants