Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
swift build と Xcode での Build の違い
Search
Toshihiro Morimoto
June 27, 2016
Technology
3
2k
swift build と Xcode での Build の違い
Tokyo Server-Side Swift Meetup #4
Toshihiro Morimoto
June 27, 2016
Tweet
Share
More Decks by Toshihiro Morimoto
See All by Toshihiro Morimoto
Xcode8 で開発はどうかわったのか
dealforest
10
5.8k
魅せるデバッグ技術
dealforest
4
1.5k
LLDB の世界からみた Swift
dealforest
4
4.9k
Xcode で快適なデバッグライフを追い求める
dealforest
29
22k
Intrducing debug in WWDC2016
dealforest
3
750
RIP Xcode Plugin 🙏
dealforest
0
4.7k
Introducing Xcode Editor Extension
dealforest
2
4.5k
Introducing Anglerfish
dealforest
2
3.2k
音声ガイダンスを導入した話
dealforest
0
3.8k
Other Decks in Technology
See All in Technology
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
650
Java x Spring Boot Warm up
kazu_kichi_67
2
490
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
3
590
オニオンアーキテクチャで実現した 本質課題を解決する インフラ移行の実例
hryushm
14
3k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
49k
新卒1年目が向き合う生成AI事業の開発を加速させる技術選定 / ai-web-launcher
cyberagentdevelopers
PRO
7
1.5k
APIテスト自動化の勘所
yokawasa
7
4.1k
VPC間の接続方法を整理してみた #自治体クラウド勉強会
non97
1
830
スプリントゴールにチームの状態も設定する背景とその効果 / Team state in sprint goals why and impact
kakehashi
2
100
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
4
2.5k
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
3
270
CyberAgent 生成AI Deep Dive with Amazon Web Services / genai-aws
cyberagentdevelopers
PRO
1
480
Featured
See All Featured
A better future with KSS
kneath
238
17k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Code Review Best Practice
trishagee
64
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Done Done
chrislema
181
16k
Teambox: Starting and Learning
jrom
132
8.7k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Transcript
swift build ͱ Xcode Ͱͷ Build ͷҧ͍ 2016/06/27 Tokyo Server-Side
Swift Meetup #4 @dealforest Toshihro Morimoto
ࣗݾհ
None
ࠓ͓͢͠Δ͜ͱ 1. Slimane Λ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ 2. swift build ͱ
Xcode Ͱͷ Build ͷҧ͍
1. Slimane Λ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ
None
Slimane express ϥΠΫͳ server side swift framework Ͱ͢
׆ൃʹ։ൃ͞Ε͍ͯ·͢
ͱΓ͋͑ͣ Terminal ͔Βͱ Xcode ͔Β Build Ͱ͖ΔΑ͏ʹ͠·ͨ͠
ͦͷաఔΛͲ͏ͧ
ઌʹݴ͓ͬͯ͘ͱ slimane-cli ͔Β࡞ͬͨϓϩδΣΫτ ͩͱ Build Ͱ͖·ͤΜͰͨ͠
ࠓͳ͓ͬͨΈ͍ͨͰ͢ 2016/06/27 18:00
https://github.com/noppoMan/Slimane/wiki/Install-Guide
ࣄલ४උ • DEVELOPMENT-SNAPSHOT-2016-05-31-a ΛΠϯετʔϧ (commit ʹΑͬͯมΘΓ·͢) $ brew install libuv
openssl hiredis $ brew link libuv --force $ brew link openssl --force $ brew link -f hiredis
αʔόʔΛىಈ $ git clone https://github.com/noppoMan/Slimane-Fullstack $ cd Slimane-Fullstack $ make
debug $ ./.build/debug/Example Slimane server is listening at 0.0.0.0:3000
֬ೝ $ curl http://localhost:3000 Welcome to Slimane!
Terminal ͔Β؆୯Ͱ͢Ͷ
࣍ Xcode ͰϏϧυͯ͠Έ·͠ΐ͏
swift package generate-xcodeproj
͜ΕΛ࣮ߦ͢Δͱ Xcode ͷϓϩδΣΫτ͕࡞ΒΕ·͢
Xcode Ͱ SlimaneFullstack Λ։͘ $ swift package generate-xcodeproj $ open
SlimaneFullstack.xcodeproj
ҙࣄ߲ͱͯ͠ Xcode 7.3.1 Ͱ͋Δඞཁ͕͋Γ·͢
ҙࣄ߲ͱͯ͠ Xcode 7.3.1 Ͱ͋Δඞཁ͕͋Γ·͢
ʂʂʂʂʂʂʂʂʂ
ͳΜͱͦͷ··Ͱ Build Ͱ͖·ͤΜ
൵͍͠Ͱ͢Ͷ
ͱ͍͏Θ͚Ͱ ย͔ͬΒΤϥʔΛ௵͍͖ͯ͠·͢
Xcode Ͱ Build Ͱ͖ΔΑ͏ʹͳΔ·Ͱ 1. 'uv.h' file not found 2.
ld: library not found for -luv for architecture x86_64 3. ld: library not found for -lCURIParser for architecture x86_64
1. 'uv.h' file not found ͜Εઌ΄Ͳ Homebrew ͰೖΕͨϥΠϒϥϦͷ ϔομʔ͕ݟ͔ͭΒͳ͍ͷ͕ݪҼͰ͢
Header Search Paths ʹ /usr/local/include ΛՃ
2. ld: library not found for -luv for architecture x86_64
͜Εઌ΄Ͳ Homebrew ͰೖΕͨϥΠϒϥϦͷ dynamic library ͕ݟ͔ͭΒͳ͍ͷ͕ݪҼͰ͢
Library Search Paths ʹ /usr/local/lib ΛՃ
3. ld: library not found for -lCURIParser for architecture x86_64
͜Ε SPM Ͱґଘ͍ͯ͠ΔϥΠϒϥϦʹؚ·ΕΔ dylib ͕Ϗϧυ࣌ʹղܾͰ͖ͳ͍ͷ͕ݪҼͰ͢
3. ld: library not found for -lCURIParser for architecture x86_64
ͪΌΜͱղܾ͕࣌ؒͳ͔ͬͨͷͰɹɹɹɹɹɹɹ ఆରԠͱͳΓ·͢ Ұ swift build Λ࣮ߦ͓ͯ͘͠ඞཁ͕͋Γ·͢ (slimane Ͱ͍͏ make debug ͷ͜ͱͰ͢)
Library Search Paths ʹ $(SRCROOT)/.build/debug ΛՃ
͜ΕͰΊͰͨ͘ Build Ͱ͖ΔΑ͏ʹͳΓ·ͨ͠
ΊΜͲ͍͘͞Ͱ͢Ͷ
Ͳ͏ͯ͜͠ͷΑ͏ͳ͕ࠩ ͰΔͷ͔ݟ͍͖ͯ·͠ΐ͏
2. swift build ͱ Xcode Ͱͷ Build ͷҧ͍
swift build • ࣮ߦόΠφϦΛࣗͰ࣮ߦ (./.build/debug/Example) • $(SRC_ROOT)/.build ԼʹதؒϑΝΠϧ͕Ͱ͖Δ • ґଘϥΠϒϥϦ
swiftc ͰίϯύΠϧ͠ -emit-executable Ͱ link ͍ͯ͠Δ
Xcode • Xcode Ͱ target Λબ͍ͯ Run Ͱ࣮ߦ • DerivedData
ԼʹதؒϑΝΠϧ͕Ͱ͖Δ • ґଘϥΠϒϥϦ dynamic framework Ͱ link ͍ͯ͠Δ • xcodebuild Ͱͬͯಉ͡ (CONFIGURATION_BUILD_DIRಈ͘) xcodebuild build -project "SlimaneFullstack.xcodeproj" ɹɹ-scheme "Example" -configuration Debug ɹ ɹɹ-sdk macosx10.11 CONFIGURATION_BUILD_DIR=build
so ͱ dylib ͱ framework ٛͰಉ͡ (ͨͿΜ…)
/Applications/Xcode-7.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode-7.3.1.app/Contents/Developer/Platforms/MacOSX.platform/ Developer/SDKs/MacOSX10.11.sdk -L/Users/dealforest/Library/Developer/Xcode/DerivedData/ SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Products/Debug -F/Users/dealforest/Library/Developer/
Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Products/Debug -filelist /Users/ dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/ Intermediates/SlimaneFullstack.build/Debug/URI.build/Objects-normal/x86_64/URI.LinkFileList -install_name @rpath/URI.framework/Versions/A/URI -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift- DEVELOPMENT-SNAPSHOT-2016-05-31-a.xctoolchain/usr/lib/swift/macosx -mmacosx-version-min=10.10 - fobjc-link-runtime -L/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-05-31- a.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/dealforest/Library/Developer/Xcode/ DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/Intermediates/SlimaneFullstack.build/ Debug/URI.build/Objects-normal/x86_64/URI.swiftmodule -framework C7 -framework CURIParser -framework String -single_module -Xlinker -dependency_info -Xlinker /Users/ dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/Build/ Intermediates/SlimaneFullstack.build/Debug/URI.build/Objects-normal/x86_64/URI_dependency_info.dat -o / Users/dealforest/Library/Developer/Xcode/DerivedData/SlimaneFullstack-bahaftgmcprmzfgeqgmkpxlvnuog/ Build/Products/Debug/URI.framework/Versions/A/URI
ld: library not found for -lCURIParser for architecture x86_64
Ͳ͏ͯ͠ -framework Ͱ link ͠Α͏ͱ ͍ͯ͠Δͷʹ -l Λ͢Δͷ͔
dylib ͱ framework ͕བྷΉͱ Ͳ͏͏·͍͜ͱ͍͔ͳ͍Έ͍ͨ
͔Δਓ͕͍Εڭ͍͑ͯͩ͘͞
Ұॹʹߟ͑·͠ΐ͏
·ͱΊ ෳࡶͳґଘΛղܾ͢Δ߹ swift build Λૉ ʹͬͯ Build ͨ͠΄͏͕ͤʹͳΕ·͢ Xcode Ͱ͍͍ͬͯͰ͕͢ཕଟ͍Ͱ͢
·ͱΊ swift package generate-xcodeproj ͕ ݡ͘ͳΔͷΛ͔ͭ PR ૹΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠