Cuckoo icon indicating copy to clipboard operation
Cuckoo copied to clipboard

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

Open levantAJ opened this issue 1 year ago • 3 comments

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)>'

levantAJ avatar Oct 04 '24 01:10 levantAJ

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.

MatyasKriz avatar Oct 09 '24 16:10 MatyasKriz

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

levantAJ avatar Oct 10 '24 08:10 levantAJ

func takeSnapshot( with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, (any Error)?) -> Void ) this can be the chnages you should make

deepakstwt avatar Feb 16 '25 07:02 deepakstwt

Will this be fixed?

zie-miz avatar Jun 25 '25 08:06 zie-miz