mockolo icon indicating copy to clipboard operation
mockolo copied to clipboard

xcode 13.3 - fatal error - SwiftSyntax.ParserError 1

Open SredzinskiPatryk opened this issue 2 years ago • 13 comments

MockoloFramework/SourceParser.swift:103: Fatal error: The operation couldn’t be completed. (SwiftSyntax.ParserError error 1.)

I do receive that error after updating my Xcode to 13.3. I was working previously on 13.2.1

SredzinskiPatryk avatar Mar 28 '22 19:03 SredzinskiPatryk

same issue with brew installation (1.7.0).

It's probably linked to the swift 5.6 compatibility (cf. Package.swift line 9)

var mockoloFrameworkTargetDependencies: [Target.Dependency] = [
//    .product(name: "SwiftSyntax", package: "SwiftSyntax"),
]

I rebuild it from source code (option 4 in the installation doc) and removed this line in the Package.swift and solved the issue.

ManuC2001 avatar Mar 28 '22 21:03 ManuC2001

What version of Mockolo is installed by Homebrew? I am wondering if 1.7.0 also causes an error.

uhooi avatar Mar 29 '22 07:03 uhooi

Yes it fails on 1.7.0

Tested on CI (code magic) and local Mac

patryk-sredzinski avatar Mar 29 '22 07:03 patryk-sredzinski

I have version 1.7.0 and have same issue with Xcode 13.3

bezoadam avatar Mar 29 '22 07:03 bezoadam

Hello,

Any news with this issue, I'm pretty sure my quick fix is not the proper way to fix it. I didn't check what was the purpose of this array of dependencies.

Cheers.

ManuC2001 avatar Mar 30 '22 15:03 ManuC2001

I have same issue with Xcode 13.3. Mockolo was installed by Mint.

uber/[email protected]

Below is the build log.

/Applications/Xcode.app/Contents/Developer/usr/bin/make generate-mocks-with-mockolo
mint run mockolo --sourcedirs ./{APPNAME}/ -d ./{APPNAME}/Helper/Mock/MockResults.swift -i {APPNAME} --mock-final --enable-args-history
Start...
["Process input mock files..."]
["Took", 5.900859832763672e-05]
["Process source files and generate an annotated/protocol map..."]
MockoloFramework/SourceParser.swift:103: Fatal error: The operation couldn’t be completed. (SwiftSyntax.ParserError error 1.)

entaku0818 avatar Apr 04 '22 03:04 entaku0818

I have same issue with Xcode 13.3. I'm using Mockolo v1.7.0 installed by Homebrew.

szk2s avatar Apr 04 '22 06:04 szk2s

1.7.0 works on 13.3 when installed using MINT

patryk-sredzinski avatar Apr 06 '22 07:04 patryk-sredzinski

Ran into the same issue. Worked if I cloned it and ran it locally. Reinstalling and building from source fixed it for me.

brew reinstall --build-from-source mockolo

wickwirew avatar Apr 20 '22 23:04 wickwirew

I think this is an issue caused by brew and not the source code, can we open a ticket there and close this one?

maxwellE avatar Apr 27 '22 16:04 maxwellE

Is there a link to the brew ticket?

Solace-Studios avatar Aug 25 '22 01:08 Solace-Studios

Is there a link to the brew ticket?

Feel free to make another, or even better make a PR to the brew formula

tinder-maxwellelliott avatar Aug 25 '22 01:08 tinder-maxwellelliott

For anyone who installs mockolo by Mint or Homebrew: This happened by missing lib_InternalSwiftSyntaxParser.dylib come along with the mockolo released binary. We need to fix how Mint and Homebrew install these files.

My workaround: Step 1: Download tar.gz binary zipped file from https://github.com/uber/mockolo/releases/tag/1.7.1 Step 2: Extract, and copy all the files in the extracted folder into the current installed folder. For Mint:

~/.mint/packages/github.com_uber_mockolo/build/<your_installed_version>/

For Homebrew:

/opt/homebrew/Cellar/mockolo/<your_installed_version>/bin

huypq-1004 avatar Sep 19 '22 05:09 huypq-1004

I think this error had already been fixed since 1.8.0.

ref.

  • brew side
    • https://github.com/Homebrew/homebrew-core/pull/116229
  • mint side
    • https://github.com/yonaskolb/Mint/pull/248
    • https://github.com/yonaskolb/Mint/pull/253

please try updating mockolo to the latest (1.8.1) by running brew upgrade mockolo / mint install uber/[email protected].

fummicc1 avatar Mar 04 '23 04:03 fummicc1

Issues around lib_InternalSwiftSyntaxParser.dylib are soleved at version 2.0.0

sidepelican avatar May 19 '23 02:05 sidepelican