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

Carthage vs SPM differences #311

Open
icedice opened this issue Oct 14, 2021 · 0 comments
Open

Carthage vs SPM differences #311

icedice opened this issue Oct 14, 2021 · 0 comments

Comments

@icedice
Copy link

icedice commented Oct 14, 2021

So I'm currently migrating from Carthage to SPM. After doing so I started seeing crashes that looked to be related to PINCache, so i tested some more.

I made two projects one using PINCache with SPM and one with Carthage thats the only difference. They basically just have this code:

import UIKit
import PINCache

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let cache = PINCache(name: "test")
        cache.setObjectAsync("test", forKey: "test", withAgeLimit: 666666)
    }
}

The one using Carthage seems to be working just fine however the one using SPM immediately throws this exception

2021-10-14 18:35:46.328136+0200 CachingTest[11466:3492388] *** Assertion failure in -[PINDiskCache setObject:forKey:withAgeLimit:fileURL:], PINDiskCache.m:1184
2021-10-14 18:35:46.328130+0200 CachingTest[11466:3492384] *** Assertion failure in -[PINMemoryCache setObject:forKey:withCost:ageLimit:], PINMemoryCache.m:510
2021-10-14 18:35:46.357156+0200 CachingTest[11466:3492388] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ttlCache must be set to YES if setting an object-level age limit.'
*** First throw call stack:
(0x1827fc05c 0x19ad16f54 0x1840bd99c 0x1028fb688 0x1028fb39c 0x1028f1838 0x10290544c 0x102906b14 0x102907ef0 0x102c04a20 0x102c06700 0x102c098a0 0x102c08af0 0x102c1a688 0x102c1b08c 0x1f2c31174 0x1f2c30f50)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ttlCache must be set to YES if setting an object-level age limit.'
terminating with uncaught exception of type NSException

What on earth am I doing wrong here? How can the functionality change based on if I use Carthage or SPM?

Both SPM and Carthage dependencies have this version numbers:

PINOperation at "1.2.1"
PINCache at "3.0.3"

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

1 participant