SwiftLint: illegal instruction: 4 swiftlint on Xcode 11
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
On beta 2 everything worked fine, but on Xcode 11 beta 3 swiftlint starts failing with illegal instruction: 4 swiftlint
SwiftLint.build/Script-77CC59392189ADCC00127275.sh: line 9: 34044 Illegal instruction: 4 swiftlint
After commenting opt in rules one by one found that it was because of reduce_into and trailing_closure rules
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Linting 'AAAA.swift' (199/1121)
Linting 'AAAA.swift' (200/1121)
Linting 'AAAA.swift' (201/1121)
Linting 'AAAA.swift' (202/1121)
Linting 'AAAA.swift' (203/1121)
Illegal instruction: 4
After commenting:
#- reduce_into
#- trailing_closure
- SwiftLint version (run
swiftlint versionto be sure)? 0.33.0 - Installation method used (Homebrew, CocoaPods, building from source, etc)? package attached to github release
- Paste your configuration file:
opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_first_not_nil
- conditional_returns_on_newline
- discouraged_object_literal
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- fatal_error_message
- file_header
- first_where
- force_unwrapping
- identical_operands
- implicit_return
- joined_default_parameter
- let_var_whitespace
- literal_expression_end_indentation
- legacy_random
- lower_acl_than_parent
- modifier_order
- multiline_arguments
- multiline_parameters
- nimble_operator
- number_separator
- operator_usage_whitespace
- overridden_super_call
- private_action
- private_outlet
- prohibited_super_call
- reduce_into
- redundant_nil_coalescing
- redundant_type_annotation
- single_test_class
- sorted_first_last
- sorted_imports
- static_operator
- strict_fileprivate
- strong_iboutlet
- switch_case_on_newline
- toggle_bool
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unused_import
- unused_private_declaration
- vertical_parameter_alignment_on_call
- yoda_condition
- Are you using nested configurations? no If so, paste their relative paths and respective contents.
- Which Xcode version are you using (check
xcode-select -p)?
xcodebuild -version
Xcode 11.0
Build version 11M362v
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 23
Commits related to this issue
- Fix SwiftLint crash https://github.com/realm/SwiftLint/issues/2793 — committed to OpenCombine/OpenCombine by broadwaylamb 5 years ago
- Fix SwiftLint crash https://github.com/realm/SwiftLint/issues/2793 — committed to OpenCombine/OpenCombine by broadwaylamb 5 years ago
I’m still seeing it with 11.3.1, default toolchain
Xcode 11 GM with
0.34.0works for me. But have the same issue with0.35.0😢 Will waiting for the new update …Same issue with Xcode 11 Beta 7. Disabling
no_space_in_method_callhelps.It fails in raw strings with properties inside interpolation.
Thanks for sharing! Turns out that even though the fix https://github.com/apple/swift/pull/27186 was included in the
swift-5.1-branchbefore its version was set to 5.1.1, the fix hasn’t actually made it into Xcode’s Swift toolchains for 5.1.1 or 5.1.2 😞.You can work around this by using the latest Swift 5.1 OSS toolchain:
I’m still getting this with Swift 5.1.2 (Xcode 11.2) and SwiftLint 0.36.0.
This advice https://github.com/realm/SwiftLint/issues/2793#issuecomment-529342828 helps.
I’m also hitting this issue on Xcode 11.1. Not sure what file it’s happening on because if I lint just the last file it succeeds.
Looks like a fix was pushed to the Swift compiler (https://github.com/apple/swift/pull/26354), but it’s unclear when it’ll be on official toolchains.
Same issue in new rule
no_space_in_method_callin 0.35.Thanks for sharing steps to reproduce! I have a fix in progress here: https://github.com/jpsim/SourceKitten/pull/602