michaelbull / kotlin-result

A multiplatform Result monad for modelling success or failure operations.
ISC License
1.05k stars 63 forks source link

Struggle to run Gradle Check locally #62

Closed pablisco closed 3 years ago

pablisco commented 3 years ago

I've tried to run gradlew check locally but I'm encountering some odd issue that doesn't seem to happen on CI:

https://scans.gradle.com/s/xz4bgfv3rbzty/console-log?task=:kotlin-result:linkDebugTestIosX64

:kotlin-result:linkDebugTestIosX64 FAILED
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:

    kotlin.native.cacheKind.iosX64=none

Also, consider filing an issue with full Gradle log here: https://kotl.in/issue
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin//libclang_rt.ios.a, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin//libclang_rt.ios.a (4 slices)
Undefined symbols for architecture x86_64:
  "___cpu_model", referenced from:
      polyHash_x86(int, unsigned short const*) in libstdlib-cache.a(result.o)
ld: symbol(s) not found for architecture x86_64

Could there be something I'm missing? I've tried opening the iOS emulator as I saw people with a similar error had seemed to work. Although I think native here is not necessarily targeting iOS.

michaelbull commented 3 years ago

https://youtrack.jetbrains.com/issue/KT-47333

This issue seems to suggest updating Kotlin to 1.5.31 with XCode 13. I've no idea if it will work or not as I don't own any Apple hardware and rely on the CI to run the iOS-specific tests. Generally this shouldn't block you from building the project locally, as you can explicitly exclude the iOS specific tasks when executing check (or comment out the iOS build target entirely).

pablisco commented 3 years ago

Ok, that worked! Amazing 😅

michaelbull commented 3 years ago

Addressed in https://github.com/michaelbull/kotlin-result/pull/63