Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

What You Will Learn?

Slide 3

Slide 3 text

What You Will Learn? - How we solved and contributed to … - Apple Platform (Xcode Beta, Swift Compiler) - OSS Tools

Slide 4

Slide 4 text

What You Will Learn? - How we solved and contributed to … - Apple Platform (Xcode Beta, Swift Compiler) - OSS Tools How you can be world-wide engineer

Slide 5

Slide 5 text

Yuki Aki (freddi) Software Engineer at Developer Experience team, Mobile Experience dept - Joined LINE Fukuoka (2019) - Joined LINE (2022) - OSS Contributor - International Speaker - ὑ 2 Cats (Haruko and Tom)

Slide 6

Slide 6 text

Developer Experience Team - Improving Developer Experience of iOS/Android Development - 1 Android, 5 iOS members

Slide 7

Slide 7 text

Example: Fast Build system - Build system management - Jung talked about Bazel in LINE - Ref: iOSDC Japan 2022

Slide 8

Slide 8 text

Agenda - Problem with Xcode 14 Beta - Solution: Contribution to Apple Platform - Solution: Contribution to OSS - Achievements and Future

Slide 9

Slide 9 text

Agenda - Problem with Xcode 14 Beta - Solution: Contribution to Apple Platform - Solution: Contribution to OSS - Achievements and Future

Slide 10

Slide 10 text

iOS16 and Xcode14 WWDC 2022 https://developer.apple.com/wwdc22/

Slide 11

Slide 11 text

Changes of WWDC2022

Slide 12

Slide 12 text

Changes of WWDC2022 Swift 5.7 - New compiler version with new features

Slide 13

Slide 13 text

Changes of WWDC2022 - Build time improvement - Development environment for iOS16 Xcode 14 Swift 5.7 - New compiler version with new features

Slide 14

Slide 14 text

new Xcode/iOS → (Especially for BETA) "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 15

Slide 15 text

Xcode 14 Beta - OSS Tools problem Swift 5.7 - Compiler Bug LINE with the new environment had issues Changes of WWDC2022

Slide 16

Slide 16 text

Compiler Bug class Test { static func test() { return [0, 1, 2].compactMap { _ in @SomeWrapper var value: Bool? = false if value != nil { return false } return value ?? false } } } Xcode 13 with Swift 5.6 "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 17

Slide 17 text

Compiler Bug class Test { static func test() { return [0, 1, 2].compactMap { _ in @SomeWrapper var value: Bool? = false if value != nil { return false } return value ?? false } } } Xcode 13 with Swift 5.6 Xcode 14 Beta with Swift 5.7 "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 18

Slide 18 text

With Xcode13 OSS Tools problem XcodeGen fastlane

Slide 19

Slide 19 text

Deploy to AppStore Connect Project Generation for iOS16 XcodeGen OSS Tools problem With Xcode14 Beta fastlane "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 20

Slide 20 text

Apple Platform Contribution OSS Contribution Our Solution

Slide 21

Slide 21 text

Agenda - Problem with Xcode 14 Beta - Solution: Contribution to Apple Platform - Solution: Contribution to OSS - Achievements and Future

Slide 22

Slide 22 text

Compiler Bug class Test { static func test() { return [0, 1, 2].compactMap { _ in @SomeWrapper var value: Bool? = false if value != nil { return false } return value ?? false } } } Xcode 14 Beta with Swift 5.7 "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 23

Slide 23 text

How to work for Apple Platform Report Pull Request (OSS only)

Slide 24

Slide 24 text

How to work for Apple Platform Report Pull Request (OSS only)

Slide 25

Slide 25 text

Report Compiler Issue - https://feedbackassistant.apple.com/ Feedback to Apple (Private) - https://github.com/apple/swift Issue on Github (Public)

Slide 26

Slide 26 text

Example: Feedback Assistant

Slide 27

Slide 27 text

Example: Feedback Assistant

Slide 28

Slide 28 text

Example: Feedback Assistant

Slide 29

Slide 29 text

Example: Github Issue

Slide 30

Slide 30 text

Example: Github Issue

Slide 31

Slide 31 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 32

Slide 32 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 33

Slide 33 text

Remove Code’s Context class SomeViewController { public override func viewDidLoad() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } }

Slide 34

Slide 34 text

Remove Code’s Context class SomeViewController { public override func viewDidLoad() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Remove iOS Context

Slide 35

Slide 35 text

Remove Code’s Context class Test { public override func viewDidLoad() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Remove iOS Context

Slide 36

Slide 36 text

Remove Code’s Context class Test { public override func viewDidLoad() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Remove iOS Context

Slide 37

Slide 37 text

Remove Code’s Context class Test { static func test() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Remove iOS Context

Slide 38

Slide 38 text

Remove Code’s Context class Test { static func test() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Reduce Business Logic

Slide 39

Slide 39 text

Remove Code’s Context class Test { static func test() { ɹɹɹɹɹɹɹɹɹɹɹɹ ɹɹɹɹɹɹɹɹɹɹɹɹ return [0, 1, 2].compactMap { _ in @SomeWrapper var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Reduce Business Logic

Slide 40

Slide 40 text

class Test { static func test() { return [0, 1, 2].compactMap { _ in @SomeWrapper var flag: Bool? = false if flag != nil { return false } return flag ?? false } } } Minimum Code class SomeViewController { public override func viewDidLoad() { … viewModel.fetchMessage() dataStore.compactMap { _ in @UserDefault var flag: Bool? = false if flag != nil { return false } return flag ?? false } } }

Slide 41

Slide 41 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 42

Slide 42 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 43

Slide 43 text

Environment Xcode 14 Swift 5.7 $ swift --version swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 …

Slide 44

Slide 44 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 45

Slide 45 text

Xcode 14 Beta with Swift 5.7 Crash Compiler error: compile command failed due to signal 4 (use -v to see invocation) Please submit a bug report (https://swift.org/contributing/#reporting-bugs) .… Stack dump: 0. Program arguments: "/Applications/Xcode-14 beta.app/… 1. Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2) 2. Compiling with the current language version 3. While evaluating request TypeCheckSourceFileRequest(source_file … 4. While evaluating request TypeCheckFunctionBodyRequest … 5. While type-checking statement at [testtest.swift:30:22 - line:39:3] … return [0, 1, 2].compactMap { _ in … Compiler crash with stack trace "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 46

Slide 46 text

Log (Stack Trace) error: compile command failed due to signal 4 (use -v to see invocation) Please submit a bug report (https://swift.org/contributing/#reporting-bugs) .… Stack dump: 0. Program arguments: "/Applications/Xcode-14 beta.app/… 1. Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2) 2. Compiling with the current language version 3. While evaluating request TypeCheckSourceFileRequest(source_file "testtest.swift") 4. While evaluating request TypeCheckFunctionBodyRequest … 5. While type-checking statement at [testtest.swift:30:22 - line:39:3] RangeText="{ return [0, 1, 2].compactMap { _ in … "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 47

Slide 47 text

Report Items Code • Minimum code to reproduce • DO NOT include private information Environment • Xcode version • swift --version Log • Stack trace • Error log • Expected behavior

Slide 48

Slide 48 text

Example: apple/swift Issue

Slide 49

Slide 49 text

Minimum Code

Slide 50

Slide 50 text

Log

Slide 51

Slide 51 text

Environment

Slide 52

Slide 52 text

Process for Fixing Bugs Feedback Github Issue Change feedback status Pull Request opened Pull Request Reply to feedback 2 ~ 3 Later Xcode version Investigation Fix Release Report

Slide 53

Slide 53 text

Result Fixed: - https://github.com/apple/swift/issues/59294 - https://github.com/apple/swift/issues/59295

Slide 54

Slide 54 text

How to work for Apple Platform Report Pull Request (OSS only)

Slide 55

Slide 55 text

How to work for Apple Platform Report Pull Request (OSS only)

Slide 56

Slide 56 text

Pull Request - Our team’s Next Challenge: Open a Pull Request - Swift Compiler is OSS (C++) - Feel free to open Pull Requests

Slide 57

Slide 57 text

Pull Request to Compiler Example: - https://github.com/apple/swift/pull/33851

Slide 58

Slide 58 text

- Problem with Xcode 14 Beta - Solution: Contribution to Apple Platform - Solution: Contribution to OSS - Achievements and Future Agenda

Slide 59

Slide 59 text

OSS Tools in LINE XcodeGen fastlane

Slide 60

Slide 60 text

OSS Tools in LINE XcodeGen fastlane New Extension Issue "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 61

Slide 61 text

Difference of Extension .pbxproj .pbxproj … = { isa = PBXNativeTarget; … productType = "com.apple.product-type.app-extension"; }; … = { isa = PBXNativeTarget; … productType = "com.apple.product-type.extensionkit-extension"; }; AS-IS Extension (Notification Service Extension etc.) iOS 16 New Extension (App Intents etc.)

Slide 62

Slide 62 text

… = { isa = PBXNativeTarget; … productType = "com.apple.product-type.extensionkit-extension"; }; … = { isa = PBXNativeTarget; … productType = "com.apple.product-type.app-extension"; }; Difference of Extension .pbxproj .pbxproj AS-IS Extension (Notification Service Extension etc.) iOS 16 New Extension (App Intents etc.)

Slide 63

Slide 63 text

App/ExtensionKit Extension App Extension - Product type: app-extension - Example: Notification Service, Share Extension ExtensionKit Extension (Xcode 14) - Product type: extensionkit-extension - Example: App Intents

Slide 64

Slide 64 text

Difference of Extension .pbxproj .pbxproj … = { isa = PBXNativeTarget; … productType = "com.apple.product-type.app-extension"; }; … = { isa = PBXNativeTarget; … productType = "com.apple.product-type.extensionkit-extension"; }; AS-IS Extension (Notification Service Extension etc.) iOS 16 New Extension (App Intents etc.) XcodeGen: Not supporting

Slide 65

Slide 65 text

Motivation to XcodeGen - Good impact to other engineers if fixed - Easy and fast to check new features of Xcode 14 - Our team has 2 Core Committers (@giginet, @freddi-kit)

Slide 66

Slide 66 text

Opened PR to XcodeGen Fixed (@mtj0928): - https://github.com/yonaskolb/XcodeGen/pull/1230

Slide 67

Slide 67 text

OSS Tools in LINE XcodeGen fastlane "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0 Deployment Issue

Slide 68

Slide 68 text

Issue of fastlane Reported: - https://github.com/fastlane/fastlane/issues/20371

Slide 69

Slide 69 text

Deployment Tools Bundled in Xcode + Xcode 13 iTMSTransporter Application Loader fastlane(pilot)

Slide 70

Slide 70 text

Bundled Tools of Xcode for Deployment Xcode 14 Application Loader + iTMSTransporter fastlane(pilot) "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0 REMOVED

Slide 71

Slide 71 text

Problems - No-investigation for the issue - Intended changes of Xcode 14 "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 72

Slide 72 text

- No-investigation for the issue Catch it as our team task! - Intended changes of Xcode 14 Interact with Apple in Feedback (and Intended changes) Solution "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 73

Slide 73 text

Impact of issue - All iOS engineer in the world cannot deploy with Xcode 14 "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 74

Slide 74 text

Fixed: - https://github.com/fastlane/fastlane/pull/20631 Opened PR to fastlane

Slide 75

Slide 75 text

Result (OSS) - LINE with Xcode 14 was success! - LINE (app version: 12.16.0) in App Store - Our team took the initiative for many world-wide problems!

Slide 76

Slide 76 text

Agenda - Problem with Xcode 14 Beta - Solution: Contribution to Apple Platform - Solution: Contribution to OSS - Achievements and Future

Slide 77

Slide 77 text

Achievements and Future - Contribution to World-wide problems - XcodeGen, fastlane, Swift Compiler … - LINE with Xcode 14.0 now released - 12.16.0 ~ - Next: Take ownership of More difficult World-wide problems - Swift Compiler, Build System etc…

Slide 78

Slide 78 text

Let’s contribute world-wide Developer Experience! "Twemoji" by Copyright 2022 Twitter, Inc and other contributors is licensed under CC-BY 4.0

Slide 79

Slide 79 text

Thank you