Mint icon indicating copy to clipboard operation
Mint copied to clipboard

XCode 11.5 using mint run in script phase for non macOS project

Open cltnschlosser opened this issue 5 years ago • 7 comments

Given xcode environment variables the swift compiler gets confused because sysroot is set for iOS and target is macOS. I don't have the exact error message anymore, but adding unset SDKROOT before calling mint fixes it.

Even if this isn't something mint wants to handle, figured I'd leave this here to help anyone else that runs into this issue.

cltnschlosser avatar Jun 02 '20 15:06 cltnschlosser

@cltnschlosser I have also run into this Thanks for mentioning the workaround

adamjcampbell avatar Jun 16 '20 04:06 adamjcampbell

Same issue here.

⚠️: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX': module 'Swift' was created for incompatible target

🛑: x86_64-apple-ios13.0: /var/folders/95/56dg4mm10hq3gh4ks84qf41h0000gn/C/org.llvm.clang/ModuleCache/Swift-XC2YA6783J4B.swiftmodule

unset SDKROOT works indeed. Not sure though if this has any side effects

PatrickDotStar avatar Jun 25 '20 09:06 PatrickDotStar

Same issue here too with Xcode 11.6. unset SDKROOT works indeed too. Thank you :)

スクリーンショット_2020-07-19_15_40_17_skitch スクリーンショット_2020-07-19_16_03_02_skitch

But I'm wondering if there are any side effects:sweat_smile:

uhooi avatar Jul 19 '20 07:07 uhooi

There shouldn't be, the goal is just to get the swift compiler execution by spm to avoid this branch https://github.com/apple/swift/blame/c7da0f2f658db600ff43af49dd204eaa625e858f/lib/Driver/Driver.cpp#L1711 It's been there for a long time, so maybe spm changed something in 5.2.

cltnschlosser avatar Jul 19 '20 13:07 cltnschlosser

Same issue here.

Screenshot 2020-10-13 at 11 20 51

asam139 avatar Oct 13 '20 09:10 asam139

I have just resolved using the version 0.40.3 of SwiftLint and adding the line unset SDKROOT at the beginning.

Screenshot 2020-10-13 at 11 40 37

asam139 avatar Oct 13 '20 09:10 asam139

Running unset SDKROOT sometimes results in 'Missing value for SDKROOT'.

Because tools built in Mint are run on macOS, It's good to specify the SDK as xcrun --sdk macosx mint run ....

スクリーンショット_2020-11-24_15_16_01

uhooi avatar Nov 24 '20 06:11 uhooi