$30 off During Our Annual Pro Sale. View Details »

Contributing to Global Development Through Handling for the LINE iOS App

Contributing to Global Development Through Handling for the LINE iOS App

Yuki Aki (freddi) (LINE / Developer Experience Dev Team / Software Engineer)

https://tech-verse.me/ja/sessions/22
https://tech-verse.me/en/sessions/22
https://tech-verse.me/ko/sessions/22

Tech-Verse2022
PRO

November 18, 2022
Tweet

More Decks by Tech-Verse2022

Other Decks in Technology

Transcript

  1. View Slide

  2. What You Will Learn?

    View Slide

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

    View Slide

  4. 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

    View Slide

  5. 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)

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  11. Changes of WWDC2022

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  16. 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

    View Slide

  17. 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

    View Slide

  18. With Xcode13
    OSS Tools problem
    XcodeGen fastlane

    View Slide

  19. 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

    View Slide

  20. Apple Platform
    Contribution
    OSS
    Contribution
    Our Solution

    View Slide

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

    View Slide

  22. 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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  26. Example: Feedback Assistant

    View Slide

  27. Example: Feedback Assistant

    View Slide

  28. Example: Feedback Assistant

    View Slide

  29. Example: Github Issue

    View Slide

  30. Example: Github Issue

    View Slide

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

    View Slide

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

    View Slide

  33. 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
    }
    }
    }

    View Slide

  34. 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

    View Slide

  35. 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

    View Slide

  36. 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

    View Slide

  37. 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

    View Slide

  38. 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

    View Slide

  39. 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

    View Slide

  40. 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
    }
    }
    }

    View Slide

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

    View Slide

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

    View Slide

  43. 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 …

    View Slide

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

    View Slide

  45. 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

    View Slide

  46. 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

    View Slide

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

    View Slide

  48. Example: apple/swift Issue

    View Slide

  49. Minimum Code

    View Slide

  50. Log

    View Slide

  51. Environment

    View Slide

  52. 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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  59. OSS Tools in LINE
    XcodeGen fastlane

    View Slide

  60. 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

    View Slide

  61. 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.)

    View Slide

  62. … = {
    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.)

    View Slide

  63. 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

    View Slide

  64. 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

    View Slide

  65. 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)

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  70. 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

    View Slide

  71. 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

    View Slide

  72. - 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

    View Slide

  73. 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

    View Slide

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

    View Slide

  75. 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!

    View Slide

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

    View Slide

  77. 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…

    View Slide

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

    View Slide

  79. Thank you

    View Slide