hyperoslo / Cache

:package: Nothing but Cache.
Other
2.97k stars 336 forks source link

Xcode 12 / Swift 5 #238

Closed innoreq closed 4 years ago

innoreq commented 5 years ago

I forked Cache because I got a Carthage error when building my main project. In the fork, I migrated to newest Swift (e.g., 5) syntax and set iOS 12 and macOS Mojave as OS versions.

In Xcode, everything builds fine, no problems, everything's clean.

When executing a carthage build (carthage build --no-skip-current --platform iOS), I get this error: ` xcodebuild output can be found in /var/folders/hk/9cl_0hwx1czbgzsb26_tl2lc295kd8/T/carthage-xcodebuild.5LIvOf.log Building scheme "Cache-iOS" in Cache.xcodeproj Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Users/.../Cache/Cache.xcodeproj -scheme Cache-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/hk/9cl_0hwx1czbgzsb26_tl2lc295kd8/T/Cache SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/.../Cache)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/hk/9cl_0hwx1czbgzsb26_tl2lc295kd8/T/carthage-xcodebuild.5LIvOf.log`

Ths log does not give a helpful indication for the reason: `error: Bus error: 10

:0: error: unable to execute command: Bus error: 10 :0: error: compile command failed due to signal 10 (use -v to see invocation) ** ARCHIVE FAILED ** The following build commands failed: CompileSwift normal arm64 CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (2 failures) `
enoelboostmi commented 5 years ago

This issue has been mentioned here: https://github.com/hyperoslo/Cache/issues/233

And there's also an open PR to solve it: https://github.com/hyperoslo/Cache/pull/236

We are waiting for the owners of this repo to make any sign of life..... It doesn't seem to be maintained anymore unfortunately.

Fogh commented 5 years ago

I have the same problem. Would be awesome if https://github.com/hyperoslo/Cache/pull/236 could be merged

tomzr commented 5 years ago

Found workaround by setting SWIFT_OPTIMIZATION_LEVEL to -Onone (thats why your local build is ok)

yspreen commented 5 years ago

Okay, so we really need to push a new build of our application. And removing swift optimization seems like a bad idea. Should I just use a legacy XCode version? Would that fix the issue?

ergunkocak commented 5 years ago

@leeadkins Thanks

MrAsterisco commented 5 years ago

In my pull request (#240), I've changed the optimisation to "Optimize for Size" and it seems to be working fine. I honestly don't see any change in speed in my apps. Unfortunately, it looks like this repo is no longer maintained…

innoreq commented 5 years ago

When using Cocoapods, I get "bus error 10", or "illegal instruction: 4" errors during build - very strange.

yaw2020 commented 5 years ago

When using Cocoapods, I get "bus error 10", or "illegal instruction: 4" errors during build - very strange. I have the same problem during archive

atereshkov commented 5 years ago

Using Cocoapods there is a workaround on how to support Xcode 10.2 and Swift 5 with Release configuration until MD5 issue is not resolved: https://github.com/hyperoslo/Cache/issues/233#issuecomment-477749560

JeankyWang commented 5 years ago

When using Cocoapods, I get "bus error 10", or "illegal instruction: 4" errors during build - very strange. I have the same problem during archive

me too

inchtime commented 5 years ago

is there any update?

JeankyWang commented 5 years ago

post_install do |installer| installer.pods_project.targets.each do |target|

Cache pod does not accept optimization level '-O', causing Bus 10 error. Use '-Osize' or '-Onone'

    if target.name == 'Cache'
        target.build_configurations.each do |config|
            level = '-Osize'
            config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
            puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
        end
    end
end

end

this code is function

SebastianBO commented 5 years ago

But for carthage?...

evermeer commented 5 years ago

Thanks @JeankyWang adding that to my pod file solved this issue!

yspreen commented 5 years ago

This code is function well.

lucasromanomr commented 5 years ago

But for carthage?...

aehlke commented 5 years ago

Use github "Igor-Palaguta/Cache" "560f00a9a9549db161ca70d96eed74fc580b03e3" for Carthage until this project gets updated

onmyway133 commented 5 years ago

Hi all, I don't maintain and don't have access to this repo anymore. Sorry for the inconvenience, but since this is MIT, anyone can just make a fork and apply PRs from there. May your code continue to compile.

hlc0000 commented 4 years ago

一个使用Swift 5编写的轻量级iOS通用缓存库SwiftlyCache,如果有兴趣可以试试https://github.com/hlc0000/SwiftlyCache/