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

Fastlane reports succes when xcodebuild fails #20685

Open
4 tasks done
dudarenko-io opened this issue Sep 22, 2022 · 3 comments · May be fixed by #20739
Open
4 tasks done

Fastlane reports succes when xcodebuild fails #20685

dudarenko-io opened this issue Sep 22, 2022 · 3 comments · May be fixed by #20739

Comments

@dudarenko-io
Copy link
Contributor

New Regression Checklist

Regression Information

  • Breaking version: 2.201.0
  • Last working version: 2.200.0

Regression Description

This is one of the most craziest heizenbugs i had :)
So I have a Xcode project with some tests on it and a pipeline with separate build-for-testing and test jobs.
fastlane reports succesful build-for-testing lane execution when scan definitely should fail getting exit status 65 from xcodebuild. It sometimes happens randomly and as far as understand depends on which files are compiled first by xcodebuild.
So I digged in scan sources and found that error_handler matches xcode output against word 'Executed'. If any file has 'Executed' pattern in its path, this match fires and no exception about build failure will be raised.
I've checked previous fastlane versions and found this issue on all of them starting from 2.201.0

Demo project with this bug
Build reproducing this bug

Complete output when running fastlane, including the stack trace and command used
[15:15:55]: �[32mDriving the lane 'build' 🚀�[0m
[15:15:55]: �[32m------------------�[0m
[15:15:55]: �[32m--- Step: scan ---�[0m
[15:15:55]: �[32m------------------�[0m
[15:15:55]: �[33mResolving Swift Package Manager dependencies...�[0m
[15:15:55]: �[36m$ xcodebuild -resolvePackageDependencies -scheme Demo -project ./Demo.xcodeproj�[0m
[15:15:55]: ▸ �[35m2022-07-21 15:15:55.959 xcodebuild[86495:1260041] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore�[0m
[15:15:55]: ▸ �[35m2022-07-21 15:15:55.960 xcodebuild[86495:1260041] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore�[0m
[15:15:56]: ▸ �[35mCommand line invocation:�[0m
[15:15:56]: ▸ �[35m    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -scheme Demo -project ./Demo.xcodeproj�[0m
[15:15:56]: ▸ �[35mUser defaults from command line:�[0m
[15:15:56]: ▸ �[35m    IDEPackageSupportUseBuiltinSCM = YES�[0m
[15:15:56]: ▸ �[35mresolved source packages: �[0m
[15:15:56]: �[36m$ xcodebuild -showBuildSettings -scheme Demo -project ./Demo.xcodeproj�[0m
[15:15:58]: Found simulator "iPhone 8 (15.5)"

+------------------------------------------------+-------------------------------------------------------------------------------+
| �[32mSummary for scan 2.208.0�[0m |
+------------------------------------------------+-------------------------------------------------------------------------------+
| clean | true |
| build_for_testing | true |
| project | ./Demo.xcodeproj |
| scheme | Demo |
| skip_detect_devices | false |
| ensure_devices_found | false |
| force_quit_simulator | false |
| reset_simulator | false |
| disable_slide_to_type | true |
| reinstall_app | false |
| open_report | false |
| output_directory | ./fastlane/test_output |
| output_types | html,junit |
| buildlog_path | ~/Library/Logs/scan |
| include_simulator_logs | false |
| xcodebuild_formatter | xcbeautify |
| output_remove_retry_attempts | false |
| derived_data_path | /Users/User/Developer/iOS/fastlane-build-status-issue/DerivedData/Demo |
| should_zip_build_products | false |
| output_xctestrun | false |
| result_bundle | false |
| use_clang_report_name | false |
| disable_concurrent_testing | false |
| skip_build | false |
| slack_use_webhook_configured_username_and_icon | false |
| slack_username | fastlane |
| slack_icon_url | https://fastlane.tools/assets/img/fastlane_icon.png |
| skip_slack | false |
| slack_only_on_failure | false |
| xcodebuild_command | env NSUnbufferedIO=YES xcodebuild |
| skip_package_dependencies_resolution | false |
| disable_package_automatic_updates | false |
| use_system_scm | false |
| number_of_retries | 0 |
| fail_build | true |
| xcode_path | /Applications/Xcode.app |
+------------------------------------------------+-------------------------------------------------------------------------------+

[15:15:58]: Disabling 'Slide to Type' iPhone 8
[15:15:58]: �[36m$ /usr/libexec/PlistBuddy -c "Add :KeyboardContinuousPathEnabled bool false" /Users/User/Library/Developer/CoreSimulator/Devices/86564ED3-6985-4772-8CD6-E65DC45803F7/data/Library/Preferences/com.apple.keyboard.ContinuousPath.plist >/dev/null 2>&1�[0m
[15:15:58]: �[36m$ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme Demo -project ./Demo.xcodeproj -derivedDataPath /Users/User/Developer/iOS/fastlane-build-status-issue/DerivedData/Demo -destination 'platform=iOS Simulator,id=86564ED3-6985-4772-8CD6-E65DC45803F7' clean build-for-testing | tee '/Users/User/Library/Logs/scan/Demo-Demo.log' | xcbeautify�[0m
[15:15:58]: ▸ �[35mLoading...�[0m
[15:15:59]: ▸ �[35m2022-07-21 15:15:59.068 xcodebuild[86530:1260301] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore�[0m
[15:15:59]: ▸ �[35m2022-07-21 15:15:59.068 xcodebuild[86530:1260301] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore�[0m
[15:15:59]: ▸ �[35m�[32;1mClean Succeeded�[0m
[15:16:00]: ▸ �[35m[�[36mDemo�[0m] �[1mCompiling�[0m ContentView.swift�[0m
[15:16:00]: ▸ �[35m[�[36mDemo�[0m] �[1mCompiling�[0m Executed.swift�[0m
[15:16:00]: ▸ �[35m[�[36mDemo�[0m] �[1mCompiling�[0m DemoApp.swift�[0m
[15:16:00]: ▸ �[35m❌ /Users/User/Developer/iOS/fastlane-build-status-issue/Demo/DemoApp.swift:17:9: �[31mcannot find 'nonExistentVariable' in scope�[0m
[15:16:00]: ▸ �[35m nonExistentVariable.call()�[0m
[15:16:00]: ▸ �[35m�[36m ^~~~~~~~~~~~~~~~~~~�[0m
[15:16:00]: ▸ �[35m** TEST BUILD FAILED **�[0m
[15:16:00]: ▸ �[35mThe following build commands failed:�[0m
[15:16:00]: ▸ �[35m CompileSwift normal x86_64 /Users/User/Developer/iOS/fastlane-build-status-issue/Demo/DemoApp.swift (in target 'Demo' from project 'Demo')�[0m
[15:16:00]: ▸ �[35m CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Demo' from project 'Demo')�[0m
[15:16:00]: ▸ �[35m(2 failures)�[0m
2022-07-21 15:15:59.068 xcodebuild[86530:1260301] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-21 15:15:59.068 xcodebuild[86530:1260301] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
�[32;1mClean Succeeded�[0m
[�[36mDemo�[0m] �[1mCompiling�[0m ContentView.swift
[�[36mDemo�[0m] �[1mCompiling�[0m Executed.swift
[�[36mDemo�[0m] �[1mCompiling�[0m DemoApp.swift
❌ /Users/User/Developer/iOS/fastlane-build-status-issue/Demo/DemoApp.swift:17:9: �[31mcannot find 'nonExistentVariable' in scope�[0m
nonExistentVariable.call()
�[36m ^~~~~~~~~~~~~~~~~~~�[0m
** TEST BUILD FAILED **

The following build commands failed:
CompileSwift normal x86_64 /Users/User/Developer/iOS/fastlane-build-status-issue/Demo/DemoApp.swift (in target 'Demo' from project 'Demo')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Demo' from project 'Demo')
(2 failures)
[15:16:00]: �[31mExit status: 65�[0m

+------+--------+-------------+
| �[32mfastlane summary�[0m |
+------+--------+-------------+
| Step | Action | Time (in s) |
+------+--------+-------------+
| 1 | scan | 5 |
+------+--------+-------------+

[15:16:00]: �[32mfastlane.tools finished successfully 🎉�[0m

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 12.4
Ruby 2.7.5
Bundler? false
Git git version 2.32.1 (Apple Git-133)
Installation Source ~/.rbenv/versions/2.7.5/bin/fastlane
Host macOS 12.4 (21F79)
Ruby Lib Dir ~/.rbenv/versions/2.7.5/lib
OpenSSL Version OpenSSL 1.1.1l 24 Aug 2021
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 13.4.1
Swift Version 5.6.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
lane :build do
    scan(
        clean: true,
        build_for_testing: true
    )
end

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.208.0 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.4.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
terminal-table 1.8.0
plist 3.6.0
addressable 2.8.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-cookie_jar 0.0.7
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.0
faraday_middleware 1.2.0
gh_inspector 1.1.3
mini_magick 4.11.0
naturally 2.2.1
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
simctl 1.6.8
rexml 3.2.5
nanaimo 0.3.0
colored2 3.1.2
claide 1.1.0
CFPropertyList 3.0.5
atomos 0.1.3
xcodeproj 1.22.0
unicode-display_width 1.8.0
public_suffix 4.0.7
excon 0.92.4
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.5
faraday-multipart 1.0.4
fastimage 2.2.6
json 2.6.2
rubyzip 2.3.2
bundler 2.3.10
jwt 2.4.1
webrick 1.7.0
httpclient 2.8.3
multi_json 1.15.0
signet 0.17.0
os 1.1.4
memoist 0.16.2
googleauth 1.2.0
mini_mime 1.1.2
retriable 3.1.2
trailblazer-option 0.1.2
declarative 0.0.20
uber 0.1.0
representable 3.2.0
google-apis-core 0.7.0
google-apis-playcustomapp_v1 0.10.0
google-apis-androidpublisher_v3 0.25.0
rake 13.0.6
digest-crc 0.6.4
google-apis-storage_v1 0.18.0
google-apis-iamcredentials_v1 0.13.0
google-cloud-errors 1.2.0
google-cloud-env 1.6.0
google-cloud-core 1.6.0
google-cloud-storage 1.37.0
emoji_regex 3.2.3
aws-eventstream 1.2.0
aws-sigv4 1.5.1
aws-partitions 1.609.0
jmespath 1.6.1
aws-sdk-core 3.131.3
aws-sdk-kms 1.58.0
aws-sdk-s3 1.114.0
forwardable 1.3.1
logger 1.4.2
cgi 0.1.0.1
date 3.0.3
timeout 0.1.0
stringio 0.1.0
uri 0.10.0
ipaddr 1.2.2
openssl 2.1.3
zlib 1.1.0
mutex_m 0.1.0
rack-test 2.0.2
rack 2.2.4
fileutils 1.4.1
delegate 0.1.0
ostruct 0.2.0
strscan 1.0.3
io-console 0.5.6
singleton 0.1.0
open3 0.1.0
nokogiri 1.13.7
racc 1.6.0
yaml 0.1.0
psych 3.1.0

generated on: 2022-07-21

@dudarenko-io
Copy link
Contributor Author

Reopening #20496

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@dudarenko-io
Copy link
Contributor Author

Pls, check the resolution of this issue in the MR #20739

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

Successfully merging a pull request may close this issue.

2 participants