21.09.05. chromium issue-patch; commit 과정

Nayeon Kim·2021년 9월 5일
2

chromium

목록 보기
1/10

git issue patch 과정
<modify해야하는 파일 코드 수정 이후라는 전제 하>

-1. chromium/src 디렉토리 변경
-2. git status 통해 수정된 파일들 목록 확인
-3. ninja 통해 디버깅
-4. git commit 통해 commit message 수정
-5. git format 확인
-6. git upload하기(push)-> gerrit dashboard에 update되었는지 확인

#first try(ninja 과정에서 WARNING 발생)
-1

cd c:\src\chromium\src

-2

c:\src\chromium\src>git status
Refresh index: 100% (378872/378872), done.
On branch chromium/src
No commands done.
Next commands to do (100 remaining commands):
   pick 3ec3df2c72 Roll Perfetto Trace Processor Linux from 4328da9e58df to 31155364cd4e
   pick 520effef4e Roll ANGLE from ba6b8287d3c8 to e30dd478f0a3 (2 revisions)
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'chromium/src' on '320fb2d327'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   AUTHORS
        modified:   chrome/browser/resources/read_later/side_panel/side_panel.html

no changes added to commit (use "git add" and/or "git commit -a")

-3: WARNING 발생

c:\src\chromium\src>ninja -C out/Debug chrome
ninja: Entering directory `out/Debug'
[0/1] Regenerating ninja files
WARNING at build arg file (use "gn args <out_dir>" to edit):5:19: Build argument has no effect.
use_jumbo_build = true
                  ^---
The variable "use_jumbo_build" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <out_dir>"

The build continued as if that argument was unspecified.

ninja: error: '../../third_party/boringssl/src/crypto/asn1/a_strex.c', needed by 'obj/third_party/boringssl/boringssl/a_strex.obj', missing and no known rule to make it

#WARNING 해결 과정 (참고: https://github.com/NixOS/nixpkgs/issues/42189)
-gn check DIR buildtarget 통해 오류 뜬 이유 체크

c:\src\chromium\src>gn check out/Debug/ chrome /* out/Debug/chrome 으로 쓰면 인식 못함*/
WARNING at build arg file (use "gn args <out_dir>" to edit):5:19: Build argument has no effect.
use_jumbo_build = true
                  ^---
The variable "use_jumbo_build" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <out_dir>"

The build continued as if that argument was unspecified.

Header dependency check OK

-에러 메시지를 읽어보고 suggestion대로 gn args 입력해봄
(모든 가능한 args를 확인해보려고 --list를 포함해 입력하면, 굉장히 긴 메시지가 뜸. 하나하나 다 알아보긴 쉽지 않아 위 에러 메시지에서 문제로 보고 있는 use_jumbo_build 파일만 유심히 봐보기로 함.)

-에러 메시지에 뜨는 내용을 구글링해보았는데, https://github.com/NixOS/nixpkgs/issues/42189 처럼 패치가 필요한 이슈로 올라오기도 했던 것으로 보아, 코드 자체의 문제일 수도 있겠단 생각이 듬(fix 해야하는 부분?인지 뭔지 일단 급한 부분은 아니니 더 search해봐야 할듯)

-4. git commit 과정
이슈마다 branch를 새로 생성해주는 것이 좋음.
git commit -a, git cl format, git cl upload 순으로 입력해봤고,
git cl upload 과정에서

Cannot upload with a dirty tree. Commit, freeze or stash your changes first.
Uncommitted files: (git diff-index --name-status HEAD)
M       AUTHORS
M       chrome/browser/resources/read_later/side_panel/side_panel.html

-> 더러운 트리라 commit을 먼저 하라는 오류 메시지를 굉장히 많이 만나게 되는데, 이유인 즉슨 git add를 통해 수정된 파일들을 넣어주지 않아서였음.

c:\src\chromium\src>git add AUTHORS

c:\src\chromium\src>git add chrome/browser/resources/read_later/side_panel/side_panel.html

c:\src\chromium\src>

다시 git commit해봄, 그냥 git commit -a 하니까 오류 뜸.

error: cannot spawn .git/hooks/commit-msg: No such file or directory 

그래서 일단 git commit -a --no-verify 사용, git push origin HEAD:refs/for/main 넣어주니 gerrit에 올라오긴 했음.

profile
Department of Computer Science

0개의 댓글