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
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
100
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
150
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
心が動くエンジニアリング ── 私が夢中になる理由
16bitidol
0
100
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Lambdaと地方とコミュニティ
miu_crescent
2
370
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
強いチームと開発生産性
onk
PRO
35
11k
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
890
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Statistics for Hackers
jakevdp
796
220k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Rails Girls Zürich Keynote
gr2m
94
13k
It's Worth the Effort
3n
183
27k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Happy Clients
brianwarren
98
6.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
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 ૹΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠