tree: 9a057a205a17ef214655cdc9f5b57a7929894e92 [path history] [tgz]
  1. google/
  2. patches/
  3. src/
  4. .clang-format
  5. BUILD.gn
  6. DEPS
  7. DIR_METADATA
  8. LICENSE
  9. OWNERS
  10. README.chromium
  11. README.md
third_party/unrar/README.md

Process for rolling new versions of UnRAR

UnRAR is released on the official site, but Chromium uses a GitHub mirror for tracking and fuzzing. This means that at a high level, rolling a new version of UnRAR has the following steps:

  • Update the GitHub repo
  • Wait a week for fuzzing on the new version
  • Update the chromium repo

Updating the GitHub repo

You'll need a GitHub account to do this. Create a fork of the GitHub repo, and clone that fork to your local machine (replacing $username with your GitHub username):

git clone https://github.com/$username/unrar.git

You will likely need to configure this repo to use your GitHub account's name, email, and to sign commits. Follow these steps to create a GPG key for your account, then run the following:

git config user.name "FIRST_NAME LAST_NAME"
git config user.email "email-for-github@domain"
git config commit.gpgsign true

Then you can download the newest release from the official site. Overwrite the contents of your repo with the contents of that archive. Then commit the changes. Commit messages have historically used a format like:

v6.2.12: Extracted from https://www.rarlab.com/rar/unrarsrc-6.2.12.tar.gz

Pushing your commit to your GitHub fork requires a personal access token. Follow the steps here to create one, then:

git push

Create a pull request from your GitHub fork and notify a //third_party/unrar/OWNER about the change.

Updating the Chromium repo

Once the GitHub repo has been updated for about a week, you can bring the changes into the Chromium repo as well. Let $url be the URL with the current version of UnRAR, and do the following to overwrite the current source with the new source:

wget -O unrar.tar.gz $url
rm -r third_party/unrar/src/
tar xf unrar.tar.gz
mv unrar/ third_party/unrar/src
rm unrar.tar.gz

Commit these changes and upload a patchset. This will make it possible to generate the patch file later, and make review easier. Let $raw_src_hash be the resulting git hash.

Now apply the Chromium patch file. This command will apply the hunks that apply, and create .rej files in //third_party/unrar/src for hunks that do not:

git apply --reject third_party/unrar/patches/chromium_changes.patch

For each .rej file, identify whether it still applies and manually fix the conflict, then delete the .rej file. Then regenerate the chromium_changes.patch file with:

git diff $raw_src_hash -- third_party/unrar/src/* > third_party/unrar/patches/chromium_changes.patch

Update README.chromium to mention the new version and GitHub repo hash and upload a CL. You did it!