개발을 시작하는 이야기

Legacy Build System vs New Build System 본문

사는 이야기/OU

Legacy Build System vs New Build System

Teiresias 2022. 7. 29. 20:14

들어가기

 지금 다니고있는 회사의 앱은 Legacy build system을 사용하고 있다. 나도 인계 받은대로 설정해서 사용하고 있지만 계속해서 Deprecated 경고가 뜨기도 하고, SPM을 사용할수도 없어서, 이번 기회에 앱을 손보면서 New Builde System으로 변경하려고 하는데 두개의 차이가 무엇이고 왜 Deprecated 되는건지 설명하고 설득하기 위해 작성하는 글.


New Build System History

Xcode 9, WWDC 2017에서 발표했다.

  • New in Xcode 9 – Preview of a new build system written in Swift. Currently, This system is optional but it will become the default in a future version of Xcode
    • Added a preview of a new build system written in Swift.
    • Provides higher reliability.
    • Catches many project configuration problems.
    • Improves overall build-system performance.
    • Note, build system performance does not include the compilers, linkers, and other tools used by the build system.
    To opt into the new build system for a project or workspace, choose File > Project Settings or File > Workspace Settings, and then choose New Build System (Preview) for the Build System type. For notes on compatibility with existing projects, see the Xcode Release Notes.

 

 

WWDC17 - Videos - Apple Developer

Accessibility & Inclusion 9:31 Designing for a Global Audience The worldwide reach of the App Store means that your app can be enjoyed by people from around the globe. Explore ways to make your app useful and appealing to as many people as possible. And pi

developer.apple.com

 

Xcode 10 Release Notes에서 다루었다.

 

Apple Developer Documentation

 

developer.apple.com


빌드 속도의 개선.

CocoaPod과 SPM의 빌드속도 차이 테스트와 같이 빌드속도를 테스트 한 글을이 있어 살펴보니, 약 2배 이상의 빌드 속도가 차이 난다는 결과가 나왔다. 해당 글의 작성시기가 2018년 이고, 이제 막 New Build System이 나왔음에도 실로 놀라운 속도 개선이 아닐 수 없다.

 

Xcode New Build System for Speedy Swift Builds

With Xcode 9, Apple announced the new build system at WWDC 2017. The new Xcode build system is written from scratch and purely in Swift. However, for some reason, it's not enabled by default and available as the preview. Apple said that they will make it d

shashikantjagtap.net

Deprecated

Xcode 12에서 부터 Deprecated가 예정되어있다. 사실 이것만큼 중요한 문제가 없다. Xcode 12에서 예정되었는데 이제 Xcode 14 Beta가 출시되었다. 언제 되어도 이상하지 않은 상황이다.

SPM(Swift Package Manager) 미지원

Apple에서 공식적으로 지원하는 SPM은 Legacy Build System에서는 사용이 불가능하다. 어짜피 CocoaPod을 사용하고 있으니 괜찮지 않냐 싶긴 한데 SPM을 사용하면 더 좋은데 굳이 과거의 유산에 머무를 필요가 있을까?

 

Cocoa Pods vs Swift Package Manager

2021년부터 Swift를 해온 나는 지금껏 Swift Package Manager (aka. SPM)를 사용해서 회사에가서 처음으로 Cocoa Pods을 마주했다. SeSac과정 진행중에 한번 설치하려고 했었으나 그당시 M1이 나오고 몇달 되지

teiresias.tistory.com

한우와 삼겹살중 선택지가 있는데 삼겹살을 굳이??

결론적으로

Xcode 10이하의 버전에서 앱이 제작되었다면(2018년 2월) 선택지가 없었겠지만, 내가 알기로는 회사의 프로젝트는 2020년 이후에 시작했다. 그렇다면 Default 값인 New Build System을 일부러 Legacy Build System으로 변경해서 사용했다는 것이다. 나름의 그 이유에 대해 도출해낸 결과는

 

1. 사용해야 하는 특정 SDK가 Legacy Build System을 사용해야 했다.(누군가 CI에 대해 이야기 해주었지만 우린 그런게 없는걸...ㅠㅠ)

2. 프로젝트를 생성하며 가이드를 따라 진행 하는데 있어서 가이드가 Xcode 10 이하의 예시여서 변경했다.

3. 그냥 아는 방식을 따르기 위해서 변경했다.

 

구글링을 해봐도 별다른 답이 없고, 개발자 단톡방에 의견을 구해봐도 뾰족한 원인을 찾을 수 없었다. 그만큼 특출난 원인은 없다고 봐도 될것 같다. 약 4년이 지나는 동안 인터넷에 별다른 이유가 포스팅 된것이 없다면 이유가 없지 않을까?

 

결과적으로 나는 회사의 앱을 Legacy Build System에서 New Build System으로 변경했다. 변경하는 과정에서 약간의 오류가 발생했지만, 생각보다 손쉽게 해결할 수 있었다. 이로 인해 pod으로 쓰던 프레임워크 일부분을 SPM으로 변경할 수 있었고, 새로운 프레임워크를 손쉽게 SPM으로 관리해줄수 있었다.