README.mozilla (3596B)
1 # Generally, the steps to update the vendored repo are: 2 1. Run the section to prepare the repo, with our current patch-stack. 3 2. Run the section to vendor the current version of the repo to verify 4 there have been no Mozilla changes since the last vendoring. If 5 there have been no Mozilla changes, there will be only one modified 6 file (README.mozilla.last-vendor). If there are other modified 7 files: 8 - Note the commit shas modifying the repo. 9 - Run the section on extracting a Mozilla commit to update the 10 patch-stack. 11 - Run the section to save the patch-stack as a separate commit. 12 - Re-vendor to verify the single changed file. 13 3. Rebase the patch stack onto a new git commit from upstream. 14 4. Run the section to vendor the new version of the repo. 15 5. Run the section to save the newly vendored files. 16 6. Run the section to save the patch-stack and amend it with the 17 current commit. 18 7. If newly vendored code modifies any BUILD.gn files, run the section 19 to regenerate moz.build files. 20 21 22 # the commands in the following sections should be run in a bash shell 23 # from the top of the mozilla repository (i.e. @TOPSRCDIR@) 24 # additionally, exporting these variables is required for all sections 25 export EXT_REPO_LOCATION=.moz-vendoring 26 export REPO_PATH="$EXT_REPO_LOCATION/abseil-cpp" 27 export REPO_URL="https://chromium.googlesource.com/chromium/src/third_party" 28 export DEST_PATH="`pwd`/third_party/abseil-cpp" 29 export BASE_COMMIT_FILE="$DEST_PATH/README.mozilla.last-vendor" 30 31 32 # prepare abseil repo 33 mkdir -p $EXT_REPO_LOCATION 34 git clone $REPO_URL $REPO_PATH 35 ( cd $REPO_PATH \ 36 && git checkout -b mozpatches `tail -1 $BASE_COMMIT_FILE` \ 37 && git am $DEST_PATH/moz-patch-stack/* \ 38 ) 39 40 41 # vendor abseil-cpp 42 ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py \ 43 --from-local $REPO_PATH \ 44 --commit mozpatches abseil-cpp \ 45 && rm -rf $DEST_PATH/absl/time/internal/cctz/testdata \ 46 && (hg revert --include "**/moz.build" &> /dev/null) \ 47 && ( cd $REPO_PATH \ 48 && echo "# base of lastest vendoring" >> $BASE_COMMIT_FILE \ 49 && git rev-parse --short `git merge-base mozpatches main` >> $BASE_COMMIT_FILE \ 50 ) 51 52 53 # to save the newly vendored files 54 hg status -nd | xargs hg rm 55 hg status -nu | xargs hg add 56 ( NEW_BASE_SHA=`tail -1 $BASE_COMMIT_FILE` ; \ 57 hg commit -m "Bug xxx - vendor abseil-cpp from libwebrtc/third_party $NEW_BASE_SHA" ) 58 59 60 # to save the patch-stack as a separate commit 61 ./mach python dom/media/webrtc/third_party_build/save_patch_stack.py \ 62 --state-path "" \ 63 --repo-path $REPO_PATH \ 64 --branch mozpatches \ 65 --target-branch-head `tail -1 $BASE_COMMIT_FILE` \ 66 --patch-path $DEST_PATH/moz-patch-stack \ 67 --no-pre-stack \ 68 --skip-startup-sanity \ 69 --separate-commit-bug-number 1234 70 71 72 # to save the patch-stack and amend it with the current commit 73 ./mach python dom/media/webrtc/third_party_build/save_patch_stack.py \ 74 --state-path "" \ 75 --repo-path $REPO_PATH \ 76 --branch mozpatches \ 77 --target-branch-head `tail -1 $BASE_COMMIT_FILE` \ 78 --patch-path $DEST_PATH/moz-patch-stack \ 79 --no-pre-stack \ 80 --skip-startup-sanity 81 82 83 # to regenerate moz.build files 84 ./mach python build/gn_processor.py \ 85 dom/media/webrtc/third_party_build/gn-configs/abseil.json 86 hg status -nd | xargs hg rm 87 hg status -nu | xargs hg add 88 hg commit -m "Bug xxx - generated moz.build files" 89 90 91 # to extract a Mozilla commit and apply it to the git patch-stack 92 ./mach python dom/media/webrtc/third_party_build/extract-for-git.py \ 93 --target abseil-cpp {commit-sha} 94 mv mailbox.patch $REPO_PATH 95 ( cd $REPO_PATH \ 96 && git am mailbox.patch \ 97 )