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.4k
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
【shownet.conf_】多様化するネットワーク環境を柔軟に統合するルーティングテクノロジー
shownet
PRO
0
300
「ばん・さく・つき・たー!」にならないためにSHIROBAKOから 学んだこと
ysknsid25
3
570
Semantic Kernel の Agent 機能試してみた!
okazuki
1
110
ITエンジニアとして知っておいてほしい、電子メールという大きな穴
logica0419
3
470
MLOpsの「あるある」課題の解決と、そのためのライブラリgokart
mski_iksm
1
150
Azure App Service on Linux の Sidecar に Phi-3 を配置してインテリジェントなアプリケーションを作ってみよう/jazug-anniv14
thara0402
0
130
LINEヤフー新卒採用 コーディングテスト解説 アルゴリズム問題編
lycorp_recruit_jp
0
13k
YAPC::Hakodateの映像記録を支える技術
godan
3
160
【shownet.conf_】ShowNet 2024 ~ Inter * Network ~
shownet
PRO
0
410
kube-vipとkube-proxy置き換えCiliumを積んだ究極のK3sクラスタを建てる
logica0419
4
200
Azure Verified Moduleを触って分かった注目ポイント/azure-verified-module-begin
mhrtech
1
200
業務ヒアリングと知識の呪い
tamai_63
0
140
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
65
4.3k
GitHub's CSS Performance
jonrohan
1030
450k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Writing Fast Ruby
sferik
625
60k
Agile that works and the tools we love
rasmusluckow
327
21k
How to train your dragon (web standard)
notwaldorf
87
5.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
4
99
Learning to Love Humans: Emotional Interface Design
aarron
271
40k
The Language of Interfaces
destraynor
154
24k
Facilitating Awesome Meetings
lara
49
6k
Docker and Python
trallard
40
3k
A better future with KSS
kneath
235
17k
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 ૹΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠