tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

README.mozilla (3701B)


      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 
     19 
     20 # the commands in the following sections should be run in a bash shell
     21 # from the top of the mozilla repository (i.e. @TOPSRCDIR@)
     22 # additionally, exporting these variables is required for all sections
     23 export EXT_REPO_LOCATION=.moz-vendoring
     24 export REPO_PATH="$EXT_REPO_LOCATION/build"
     25 export REPO_URL="https://chromium.googlesource.com/chromium/src/build"
     26 export DEST_PATH="`pwd`/third_party/chromium/build"
     27 export BASE_COMMIT_FILE="$DEST_PATH/README.mozilla.last-vendor"
     28 export BUG_NUMBER=1234
     29 export SCRIPT_DIR="$DEST_PATH/moz-exp-scripts"
     30 export TMP_DIR=$EXT_REPO_LOCATION
     31 
     32 
     33 # prepare build repo
     34 rm -rf $REPO_PATH
     35 mkdir -p $EXT_REPO_LOCATION
     36 git clone $REPO_URL $REPO_PATH
     37 ( cd $REPO_PATH \
     38   && git checkout -b mozpatches `tail -1 $BASE_COMMIT_FILE` \
     39   && git am $DEST_PATH/moz-patch-stack/* \
     40 )
     41 
     42 
     43 # vendor build
     44 ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py \
     45     --from-local $REPO_PATH \
     46     --commit mozpatches build \
     47 && rm -rf $DEST_PATH/sanitizers \
     48 && (hg revert --include "**/moz.build" &> /dev/null) \
     49 && ( cd $REPO_PATH \
     50      && echo "# base of lastest vendoring" >> $BASE_COMMIT_FILE \
     51      && git rev-parse --short `git merge-base mozpatches main` >> $BASE_COMMIT_FILE \
     52    ) ; hg status
     53 
     54 
     55 # to save the newly vendored files
     56 hg status -nd | xargs hg rm
     57 hg status -nu | xargs hg add
     58 ( NEW_BASE_SHA=`tail -1 $BASE_COMMIT_FILE` ; \
     59   hg commit -m "Bug $BUG_NUMBER - vendor chromium/build from $NEW_BASE_SHA" )
     60 
     61 
     62 # to save the patch-stack as a separate commit
     63 ./mach python dom/media/webrtc/third_party_build/save_patch_stack.py \
     64   --state-path "" \
     65   --repo-path $REPO_PATH \
     66   --branch mozpatches \
     67   --target-branch-head `tail -1 $BASE_COMMIT_FILE` \
     68   --patch-path $DEST_PATH/moz-patch-stack \
     69   --no-pre-stack \
     70   --skip-startup-sanity \
     71   --separate-commit-bug-number $BUG_NUMBER
     72 
     73 
     74 # to save the patch-stack and amend it with the current commit
     75 ./mach python dom/media/webrtc/third_party_build/save_patch_stack.py \
     76   --state-path "" \
     77   --repo-path $REPO_PATH \
     78   --branch mozpatches \
     79   --target-branch-head `tail -1 $BASE_COMMIT_FILE` \
     80   --patch-path $DEST_PATH/moz-patch-stack \
     81   --no-pre-stack \
     82   --skip-startup-sanity
     83 
     84 
     85 # to extract a Mozilla commit and apply it to the git patch-stack
     86 ./mach python dom/media/webrtc/third_party_build/extract-for-git.py \
     87   --target build {commit-sha}
     88 mv mailbox.patch $REPO_PATH
     89 ( cd $REPO_PATH \
     90   && git am mailbox.patch \
     91 )
     92 
     93 
     94 # rebase to the next commit
     95 (cd $REPO_PATH && \
     96  git reset --hard mozpatches^^ && \
     97  MERGE_BASE=`git merge-base mozpatches main` ; \
     98  NEXT_COMMIT=`git log --oneline $MERGE_BASE..main --pretty=%h | tail -1` ; \
     99  echo $NEXT_COMMIT ; \
    100  git rebase $NEXT_COMMIT && \
    101  bash $SCRIPT_DIR/add_build_location_patches.sh && \
    102  bash $SCRIPT_DIR/add_target_cpu_patches.sh
    103 )