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.9k
魅せるデバッグ技術
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
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
150
AIチャットボット開発への生成AI活用
ryomrt
0
170
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
100
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
Lambdaと地方とコミュニティ
miu_crescent
2
370
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Why Our Code Smells
bkeepers
PRO
334
57k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Writing Fast Ruby
sferik
627
61k
Fireside Chat
paigeccino
34
3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
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 ૹΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠