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

Sourcery 1.0.2 not compatible with Xcode 13 #16

Open
BsBrabi opened this issue Oct 4, 2021 · 2 comments
Open

Sourcery 1.0.2 not compatible with Xcode 13 #16

BsBrabi opened this issue Oct 4, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@BsBrabi
Copy link

BsBrabi commented Oct 4, 2021

I currently use the fork SergeyKovalenko/SwiftyMockyCLI which adds support for Xcode 13. However, SwiftyMocky wants to install Sourcery 1.0.2, which is not compatible with Xcode 13.

🌱 Cloning Sourcery 1.0.2
🌱 Resolving package
🌱 Building package
remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimization[1/15] Compiling SourceKit SourceKit.m
[2/15] Compiling Clang_C Clang_C.m
[3/15] Compiling writer.c
[4/15] Compiling reader.c
[5/15] Compiling parser.c
[6/15] Compiling emitter.c
[7/15] Compiling scanner.c
[8/15] Compiling api.c
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[9/16] Compiling TryCatch TryCatch.m
[10/16] Compiling PathKit PathKit.swift
/private/var/folders/rl/9ykwdfps5sq6gb386g34dfmd2d7tbj/T/mint/github.com_krzysztofzablocki_Sourcery/.build/checkouts/PathKit/Sources/PathKit.swift:98:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'Path' to 'Hashable' by implementing 'hash(into:)' instead
  public var hashValue: Int {
             ^
/private/var/folders/rl/9ykwdfps5sq6gb386g34dfmd2d7tbj/T/mint/github.com_krzysztofzablocki_Sourcery/.build/checkouts/PathKit/Sources/PathKit.swift:591:12: error: value of optional type 'UnsafeMutablePointer<CChar>?' (aka 'Optional<UnsafeMutablePointer<Int8>>') must be unwrapped to a value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>')
      free(cPattern)
           ^
/private/var/folders/rl/9ykwdfps5sq6gb386g34dfmd2d7tbj/T/mint/github.com_krzysztofzablocki_Sourcery/.build/checkouts/PathKit/Sources/PathKit.swift:591:12: note: coalesce using '??' to provide a default when the optional value contains 'nil'
      free(cPattern)
           ^
                    ?? <#default value#>
/private/var/folders/rl/9ykwdfps5sq6gb386g34dfmd2d7tbj/T/mint/github.com_krzysztofzablocki_Sourcery/.build/checkouts/PathKit/Sources/PathKit.swift:591:12: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
      free(cPattern)
           ^
                   !

I also tried to manually install the latest Sourcery version (1.6.0) and use it with the sourceryCommand in the Mockfile, but that also did not work:

Status code: 3
Message: "myproject/.mocky/.template.swifttemplate: 2021-10-04 13:03:44.570 dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj0Bh9TbVtuw%3D[98719:1385983] *** Terminating app due to uncaught exception 'NSParseErrorException', reason: 'Key 'functions' not found.'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000018c49f838 __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x000000018c1c90a8 objc_exception_throw + 60
	2   CoreFoundation                      0x000000018c4caab0 -[NSException description] + 0
	3   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101050efc $s15SourceryRuntime15TemplateContextC5coderACSgSo7NSCoderC_tcfc + 524
	4   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101051434 $s15SourceryRuntime15TemplateContextC5coderACSgSo7NSCoderC_tcfcTo + 40
	5   Foundation                          0x000000018d178310 _decodeObjectBinary + 2288
	6   Foundation                          0x000000018d17792c _decodeObject + 180
	7   Foundation                          0x000000018d1777ec -[NSKeyedUnarchiver decodeObjectForKey:] + 176
	8   Foundation                          0x000000018d29d6b8 +[NSKeyedUnarchiver unarchiveObjectWithFile:] + 136
	9   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101052dfc $sSo13NSProcessInfoC15SourceryRuntimeE7contextAC15TemplateContextCSgvg + 204
	10  dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x000000010107dd30 main + 1680
	11  libdyld.dylib                       0x000000018c341430 start + 4
)
libc++abi: terminating with uncaught exception of type NSException"
Output: "Using configuration file at 'myproject/.mocky/.config.yml.tmp'
Scanning sources...
Found 624 types in 152 files, 0 changed from last run.
Loading templates...
Loaded 1 templates.
Generating code...
error: myproject/.mocky/.template.swifttemplate: 2021-10-04 13:03:44.570 dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj0Bh9TbVtuw%3D[98719:1385983] *** Terminating app due to uncaught exception 'NSParseErrorException', reason: 'Key 'functions' not found.'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000018c49f838 __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x000000018c1c90a8 objc_exception_throw + 60
	2   CoreFoundation                      0x000000018c4caab0 -[NSException description] + 0
	3   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101050efc $s15SourceryRuntime15TemplateContextC5coderACSgSo7NSCoderC_tcfc + 524
	4   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101051434 $s15SourceryRuntime15TemplateContextC5coderACSgSo7NSCoderC_tcfcTo + 40
	5   Foundation                          0x000000018d178310 _decodeObjectBinary + 2288
	6   Foundation                          0x000000018d17792c _decodeObject + 180
	7   Foundation                          0x000000018d1777ec -[NSKeyedUnarchiver decodeObjectForKey:] + 176
	8   Foundation                          0x000000018d29d6b8 +[NSKeyedUnarchiver unarchiveObjectWithFile:] + 136
	9   dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x0000000101052dfc $sSo13NSProcessInfoC15SourceryRuntimeE7contextAC15TemplateContextCSgvg + 204
	10  dG8LBB5XHtbPZQHmK9%2BkWPze36KfwNYQj 0x000000010107dd30 main + 1680
	11  libdyld.dylib                       0x000000018c341430 start + 4
)
libc++abi: terminating with uncaught exception of type NSException
"

Is it possible to update Sourcery to the latest version?

@g-amichnia g-amichnia self-assigned this Oct 5, 2021
@g-amichnia g-amichnia added the bug Something isn't working label Oct 5, 2021
@g-amichnia
Copy link
Collaborator

Hello,
I am working on this. I already have most of template fixed, but I still need to finish workaround for swift compiler 5.5 change, that makes adding @available clause impossible to enum cases.

@pschneider
Copy link

If you need another project to verify the changes against, I could offer to run it with our test suite. (Nothing too fancy, basically utilising AutoMockable only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants