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

_InternalSwiftSyntaxParser is missing again #346

Open
Konskii opened this issue May 12, 2023 · 2 comments
Open

_InternalSwiftSyntaxParser is missing again #346

Konskii opened this issue May 12, 2023 · 2 comments

Comments

@Konskii
Copy link

Konskii commented May 12, 2023

Tried to re-generate mocks and get the following output from CLI(below is full output).
Xcode 14.3, MacOS 13.3.1a

Decided to use last available sorcery (2.0.2) installed via home-brew and than it works!
Seems that SwiftyMocky need update in required version of sorcery version(current 1.8.0).

❌  Error: ShellOut encountered an error
Status code: 1
Message: "warning: 'github.com_krzysztofzablocki_sourcery': Invalid Exclude '/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/Templates/default.profraw': File not found.
🌱 Encountered error during "swift build -c release --product sourcery -Xswiftc -target -Xswiftc arm64-apple-macosx13.3". Use --verbose to see full output
🌱  Failed to build Sourcery 1.6.0 with SPM"
Output: "🌱 Cloning Sourcery 1.6.0
🌱 Resolving package
🌱 Building product sourcery
Building for production...
[0/10] Copying ejs.js
[1/10] Compiling writer.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[2/10] Compiling atomic-counter.c
[3/10] Compiling reader.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[4/13] Compiling api.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[5/13] Compiling emitter.c
[6/13] Compiling parser.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[7/15] Compiling scanner.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[8/15] Compiling TryCatch TryCatch.m
[10/16] Compiling PathKit PathKit.swift
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[11/16] Compiling AEXML Document.swift
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[12/20] Compiling SourceryJS EJSTemplate.swift
[13/20] Compiling SourceryUtils Path+Extensions.swift
[14/20] Compiling Stencil Context.swift
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[15/21] Compiling Yams Constructor.swift
[16/21] Compiling Commander ArgumentConvertible.swift
[17/21] Compiling StencilSwiftKit CallMacroNodes.swift
[18/21] Compiling SourceryRuntime AccessLevel.swift
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryRuntime/Sources/Composer.swift:340:13: warning: initialization of immutable value 'modules' was never used; consider replacing with assignment to '_' or removing it
        let modules = state.modules
        ~~~~^~~~~~~
        _
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryRuntime/Sources/Composer.swift:341:13: warning: initialization of immutable value 'typealiases' was never used; consider replacing with assignment to '_' or removing it
        let typealiases = state.resolvedTypealiases
        ~~~~^~~~~~~~~~~
        _
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryRuntime/Sources/TemplateContext.swift:64:22: warning: heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional
            "types": [
                     ^
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryRuntime/Sources/TemplateContext.swift:86:34: warning: 'unarchiveObject(withFile:)' was deprecated in macOS 10.14: Use +unarchivedObjectOfClass:fromData:error: instead
        return NSKeyedUnarchiver.unarchiveObject(withFile: arguments[1]) as? TemplateContext
                                 ^
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[19/23] Compiling SourcerySwift SourceryRuntime.content.generated.swift
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourcerySwift/Sources/SwiftTemplate.swift:196:36: warning: 'archivedData(withRootObject:)' was deprecated in macOS 10.14: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
        let data = NSKeyedArchiver.archivedData(withRootObject: context)
                                   ^
[20/23] Compiling SwiftSyntax AbsolutePosition.swift
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/.build/checkouts/swift-syntax/Sources/SwiftSyntax/SyntaxParser.swift:17:29: error: no such module '_InternalSwiftSyntaxParser'
@_implementationOnly import _InternalSwiftSyntaxParser
                            ^
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryStencil/Sources/TypedNode.swift:33:42: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
        let bindings: [Binding] = chunks.flatMap { binding in
                                         ^
/private/var/folders/7f/w7hl1f994014fkr2frhszk8m0000gn/T/mint/github.com_krzysztofzablocki_Sourcery/SourceryStencil/Sources/TypedNode.swift:33:42: note: use 'compactMap(_:)' instead
        let bindings: [Binding] = chunks.flatMap { binding in
                                         ^~~~~~~
                                         compactMap"
@Konskii
Copy link
Author

Konskii commented May 12, 2023

If you get a same error, just install sorcery using hombrew install sourcery, than specify sourcery command in your MockFile:

sourceryCommand: sourcery
sourceryTemplate: null

@EduardJelenski
Copy link

EduardJelenski commented Jun 5, 2023

I would add, that lots of people face this issue when moving to M1 chips (M1 Pro to be certain, not sure about common M1's)

Xcode 14.3, MacOS 13.0.1 (22A400)

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