spotify / SPTPersistentCache

Everyone tries to implement a cache at some point in their iOS app’s lifecycle, and this is ours.
Apache License 2.0
1.24k stars 77 forks source link

Doesn't compile under Xcode 10 #105

Open DanEdgarTarget opened 6 years ago

DanEdgarTarget commented 6 years ago

@8W9aG Thank you in advance for taking a look at this.

SPTPersistentCache doesn't compile via standard Carthage pull under Xcode 10.

The error is:

CompileC /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/Objects-normal/armv7/SPTPersistentCache.o /Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/Sources/SPTPersistentCache.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: SPTPersistentCache-iOS)
    cd /Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/SPTPersistentCacheFramework
    export LANG=en_US.US-ASCII
    /Users/z002r44/Downloads/Xcode10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/ModuleCache.noindex -fno-autolink -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=SPTPersistentCache -Wno-trigraphs -fpascal-strings -Os -fno-common -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Wmissing-field-initializers -Wmissing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wnullable-to-nonnull-conversion -Wimplicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Warc-repeated-use-of-weak -Wno-arc-maybe-repeated-use-of-weak -Wexplicit-ownership-type -Wimplicit-retain-self -Wduplicate-method-match -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wfloat-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wassign-enum -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -Wselector -Wstrict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Users/z002r44/Downloads/Xcode10.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=8.0 -g -Wsign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fembed-bitcode -iquote /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/SPTPersistentCache-generated-files.hmap -I/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/SPTPersistentCache-own-target-headers.hmap -I/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/SPTPersistentCache-all-non-framework-target-headers.hmap -ivfsoverlay /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/all-product-headers.yaml -iquote /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/SPTPersistentCache-project-headers.hmap -I/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/BuildProductsPath/Release-iphoneos/include -I../include -I/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/DerivedSources/armv7 -I/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/DerivedSources -Weverything -Wno-error=deprecated -Wno-objc-missing-property-synthesis -Wno-gnu-conditional-omitted-operand -Wno-gnu -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-auto-import -Wno-missing-variable-declarations -Wno-c++98-compat -Werror -Wno-direct-ivar-access -Wno-padded -F/Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/BuildProductsPath/Release-iphoneos -MMD -MT dependencies -MF /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/Objects-normal/armv7/SPTPersistentCache.d --serialize-diagnostics /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/Objects-normal/armv7/SPTPersistentCache.dia -c /Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/Sources/SPTPersistentCache.m -o /Users/z002r44/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A254a/SPTPersistentCache/1.1.1/Build/Intermediates.noindex/ArchiveIntermediates/SPTPersistentCache-iOS/IntermediateBuildFilesPath/SPTPersistentCacheFramework.build/Release-iphoneos/SPTPersistentCache-iOS.build/Objects-normal/armv7/SPTPersistentCache.o
/Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/Sources/SPTPersistentCache.m:737:80: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'ObjectType _Nonnull' (aka 'id') [-Werror,-Wnullable-to-nonnull-conversion]
                                        userInfo:@{ NSLocalizedDescriptionKey: @(errorString) }];
                                                                               ^
/Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/Sources/SPTPersistentCache.m:965:30: warning: messaging unqualified id [-Wobjc-messaging-id]
        currentCacheSize += [image[SPTDataCacheFileAttributesKey][NSFileSize] integerValue];
                             ^
/Users/z002r44/Dustin-Harmony-iOS/Carthage/Checkouts/SPTPersistentCache/Sources/SPTPersistentCache.m:984:30: warning: messaging unqualified id [-Wobjc-messaging-id]
        currentCacheSize -= [image[SPTDataCacheFileAttributesKey][NSFileSize] integerValue];

I put in a PR to fix, but can't figure out why the CI process fails on the PR. Would like to use SPTPersistentCache from master if possible, not from a fork that I took: https://github.com/DanEdgarTarget/SPTPersistentCache

Thank you for any help.

kmcbride commented 6 years ago

Fixed by https://github.com/spotify/SPTPersistentCache/pull/106

Szymon-sf commented 6 years ago

Can someone release a new version? For now the fix is github "spotify/SPTPersistentCache" "master"