조용한 담장

[Yocto] 빌드가 왜 오래 걸리나 알아보자. 본문

Yocto

[Yocto] 빌드가 왜 오래 걸리나 알아보자.

iosroid 2023. 10. 25. 18:25

Yocto 홈페이지에서 보게 된 내용.

https://www.yoctoproject.org/yocto-project-at-embedded-open-source-summit-2023/

 

Yocto Project at Embedded Open-Source Summit 2023 – Yocto Project

The Yocto Project was present at the Embedded Open-Source Summit, which took place in Prague, Czech Republic, between June 26 and 30, 2023. The Yocto Project Dev Day, the first edition since 2019, was a big success, and was sold out. We even had to add tab

www.yoctoproject.org

발표자의 비디오도 있다.

아래는 슬라이드

https://rossburton.gitlab.io/why-build-slow/

 

https://rossburton.gitlab.io/why-build-slow/

We can avoid many rebuilds with a hash equivalence server. note that this requires reproducible builds, where building the identical recipe twice results in literally identical outputs, this is always enabled in langdale onwards and an option in dunfell. I

rossburton.gitlab.io

sstate cache 와 download 폴더는 공유하자.

아래의 블로그가 설명을 잘 해주었다.

https://bootlin.com/blog/yocto-sharing-the-sstate-cache-and-download-directories/

 

Yocto: sharing the sstate cache and download directories - Bootlin's blog

When developing projects based on Yocto Project / OpenEmbedded, a quite common practice is to have multiple build environments in different directories: one per product, or one for each development branch, or for other scenarios. Each build environment cou

bootlin.com

내 프로젝트의 빌드를 이해하자

왜 빌드가 같이 되는지 파악하고 정리하자.

$ bitbake -g mypp
$ cat pn-buildlist
mypp
quilt-native
patch-native
binutils-cross-arm
pseudo-native
rpm-native
...
$ grep gcc pn-buildlist
gcc-cross-aarch64
gcc
$ oe-depends-dot task-depends.dot -w -k myppdep.do_populate_sysroot
Because: mypp.do_prepare_recipe_sysroot
mypp.do_prepare_recipe_sysroot -> myppdep.do_populate_sysroot
# GUI
$ bitbake -u taskexp -g mypp

oe-depends-dot 로 일일이 찾기보다 GUI 로 보면 편하다.

-u taskexp 옵션을 활용.

taskexp

그래도 보기는 힘들다.

pybootchartgui.py 로 buildstats 를 살펴보자.

buildstats 의 내용을 GUI 로 볼 수 있다.

cairo 라이브러리가 필요할 수 있음.

$ sudo apt install libcairo2 python-cairo
...
$ poky/scripts/pybootchartgui/pybootchartgui.py build/tmp/buildstats/20230925162844/

buildstats tree

한눈에 범인이 보인다.

막대가 긴 녀석들이 시간을 오래 잡아먹는 원인들이다.

buildstats tree 2

2번 작업의 시작까지 멍 때렸던 이유는 1번 작업이 완료되는데 시간이 오래 걸리기 때문이었다.

뭐 이런 것도 보여준다.

Hash Equivalence

속도 향상을 위해 적용되어 있다고 한다.

https://docs.yoctoproject.org/overview-manual/concepts.html#hash-equivalence

 

4 Yocto Project Concepts — The Yocto Project ® 4.2.999 documentation

Some tasks are easier to implement when allowed to perform certain operations that are normally reserved for the root user (e.g. do_install, do_package_write*, do_rootfs, and do_image_*). For example, the do_install task benefits from being able to set the

docs.yoctoproject.org

기존에 빌드되어 있는 것들 중 아무런 변동사항이 없는 것들은 스킵한다.

하드웨어 향상

좋은 하드웨어를 사용하자...

요즘 ssd 가격이 싸다...

I/O 부하가 큰 Yocto 에게 지금 낸드 가격은 축복이다...

 

빌드가 오래 걸리는 이유는 우선 내 빌드 머신이 구린게 아닌지부터 확인하자. 

'Yocto' 카테고리의 다른 글

[Yocto] packagegroup 에 조건부 레시피 추가와 삭제  (0) 2023.08.30
Comments