Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: docs/updating_clang_format_binaries.md

Issue 1319543002: A batch of docs style fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: docs/updating_clang_format_binaries.md
diff --git a/docs/updating_clang_format_binaries.md b/docs/updating_clang_format_binaries.md
index 8ba523e13f59044d12aa492fb2a02a18c67e3e3b..5aebd71ac9fb54474d6320a1b541976dbeeea491 100644
--- a/docs/updating_clang_format_binaries.md
+++ b/docs/updating_clang_format_binaries.md
@@ -1,24 +1,34 @@
-Instructions on how to update the [clang-format binaries](ClangFormat.md) that come with a checkout of Chromium.
+# Updating Clang format binaries
-<h2>Prerequisites</h2>
+Instructions on how to update the [clang-format binaries](clang_format.md) that
+come with a checkout of Chromium.
-You'll need a Windows machine, a Linux machine, and a Mac; all capable of building clang-format. You'll also need permissions to upload to the appropriate google storage bucket. Chromium infrastructure team members have this, and others can be granted the permission based on need. Talk to ncarter or hinoka about getting access.
+## Prerequisites
-<h2>Pick a head svn revision</h2>
+You'll need a Windows machine, a Linux machine, and a Mac; all capable of
+building clang-format. You'll also need permissions to upload to the appropriate
+google storage bucket. Chromium infrastructure team members have this, and
+others can be granted the permission based on need. Talk to ncarter or hinoka
+about getting access.
-Consult http://llvm.org/svn/llvm-project/ for the current head revision. This will be the CLANG\_REV you'll use later to check out each platform to a consistent state.
+## Pick a head svn revision
-<h2>Build a release-mode clang-format on each platform</h2>
+Consult http://llvm.org/svn/llvm-project/ for the current head revision. This
+will be the CLANG_REV you'll use later to check out each platform to a
+consistent state.
-Follow the the official instructions here: http://clang.llvm.org/get_started.html.
+## Build a release-mode clang-format on each platform
+
+Follow the the official instructions here:
+http://clang.llvm.org/get_started.html.
Windows step-by-step:
-```
-[double check you have the tools you need]
-where cmake.exe # You need to install this.
-where svn.exe # Maybe fix with: set PATH=%PATH%;D:\src\depot_tools\svn_bin
-"c:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" amd64_x86
+```shell
+# [double check you have the tools you need]
+# where cmake.exe # You need to install this.
Bons 2015/08/25 16:51:01 these shouldn't be all comments.
nodir 2015/08/25 17:05:04 Done.
+# where svn.exe # Maybe fix with: set PATH=%PATH%;D:\src\depot_tools\svn_bin
+# "c:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" amd64_x86
set CLANG_REV=198831 # You must change this value (see above)
@@ -33,13 +43,16 @@ svn co http://llvm.org/svn/llvm-project/cfe/trunk@%CLANG_REV% clang
cd ..\..\llvm-build
set CC=cl
set CXX=cl
-cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO -DPYTHON_EXECUTABLE=d:\src\depot_tools\python276_bin\python.exe
+cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT \
+ -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO \
+ -DPYTHON_EXECUTABLE=d:\src\depot_tools\python276_bin\python.exe
ninja clang-format
bin\clang-format.exe --version
```
Mac & Linux step-by-step:
-```
+
+```shell
# Check out.
export CLANG_REV=198831 # You must change this value (see above)
rm -rf llvm
@@ -52,43 +65,62 @@ svn co http://llvm.org/svn/llvm-project/cfe/trunk@$CLANG_REV clang
cd ../../llvm-build
# Option 1: with cmake
- MACOSX_DEPLOYMENT_TARGET=10.9 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ../llvm/
- time caffeinate ninja clang-format
- strip bin/clang-format
-
- # (On Linux, to build with clang, which produces smaller binaries, add this to your cmake invocation.
- # On Mac, the system compiler is already clang so it's not needed there.)
- -DCMAKE_C_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang -DCMAKE_CXX_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang++
+MACOSX_DEPLOYMENT_TARGET=10.9 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ../llvm/
+time caffeinate ninja clang-format
+strip bin/clang-format
+
+# (On Linux, to build with clang, which produces smaller binaries, add this to
+# your cmake invocation.
+# On Mac, the system compiler is already clang so it's not needed there.)
+-DCMAKE_C_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang -DCMAKE_CXX_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang++
```
+
+TODO: these ^^ instructions looks odd. Are they correct???
+
Platform specific notes:
- * Windows: Visual Studio 2013 only.
- * Linux: so far (as of January 2014) we've just included a 64-bit binary. It's important to disable threading, else clang-format will depend on libatomic.so.1 which doesn't exist on Precise.
- * Mac: Remember to set `MACOSX_DEPLOYMENT_TARGET` when building! If you get configure warnings, you may need to install XCode 5 and avoid a goma environment.
-<h2>Upload each binary to google storage</h2>
+* Windows: Visual Studio 2013 only.
+* Linux: so far (as of January 2014) we've just included a 64-bit binary. It's
+ important to disable threading, else clang-format will depend on
+ libatomic.so.1 which doesn't exist on Precise.
+* Mac: Remember to set `MACOSX_DEPLOYMENT_TARGET` when building! If you get
+ configure warnings, you may need to install XCode 5 and avoid a goma
+ environment.
+
+## Upload each binary to google storage
-Copy the binaries into your chromium checkout (under `src/buildtools/(win|linux64|mac)/clang-format(.exe?)`).
-For each binary, you'll need to run upload\_to\_google\_storage.py according to the instructions in [README.txt](https://code.google.com/p/chromium/codesearch#chromium/src/buildtools/clang_format/README.txt). This will upload the binary into a publicly accessible google storage bucket, and update `.sha1` file in your Chrome checkout. You'll check in the `.sha1` file (but NOT the clang-format binary) into source control. In order to be able to upload, you'll need write permission to the bucket -- see the prerequisites.
+Copy the binaries into your chromium checkout (under
+`src/buildtools/(win|linux64|mac)/clang-format(.exe?)`). For each binary, you'll
+need to run upload_to_google_storage.py according to the instructions in
+[README.txt](/buildtools/clang_format/README.txt). This will upload the binary
+into a publicly accessible google storage bucket, and update `.sha1` file in
+your Chrome checkout. You'll check in the `.sha1` file (but NOT the clang-format
+binary) into source control. In order to be able to upload, you'll need write
+permission to the bucket -- see the prerequisites.
-<h2>Copy the helper scripts and update README.chromium</h2>
+## Copy the helper scripts and update README.chromium
-There are some auxiliary scripts that ought to be kept updated in lockstep with the clang-format binary. These get copied into third\_party/clang\_format/scripts in your Chromium checkout.
+There are some auxiliary scripts that ought to be kept updated in lockstep with
+the clang-format binary. These get copied into
+third_party/clang_format/scripts in your Chromium checkout.
The `README.chromium` file ought to be updated with version and date info.
-<h2>Upload a CL according to the following template</h2>
+## Upload a CL according to the following template
-```
-Update clang-format binaries and scripts for all platforms.
+ Update clang-format binaries and scripts for all platforms.
-I followed these instructions:
-https://code.google.com/p/chromium/wiki/UpdatingClangFormatBinaries
+ I followed these instructions:
+ https://code.google.com/p/chromium/wiki/UpdatingClangFormatBinaries
Bons 2015/08/25 16:51:01 update link
nodir 2015/08/25 17:05:04 Done.
-The binaries were built at clang revision ####### on ####DATETIME####.
+ The binaries were built at clang revision ####### on ####DATETIME####.
-BUG=
-```
+ BUG=
-The change should <b>always</b> include new `.sha1` files for each platform (we want to keep these in lockstep), should <b>never</b> include `clang-format` binaries directly. The change should <b>always</b> update `README.chromium`
+The change should **always** include new `.sha1` files for each platform (we
+want to keep these in lockstep), should **never** include `clang-format`
+binaries directly. The change should **always** update `README.chromium`
-clang-format binaries should weigh in at 1.5MB or less. Watch out for size regressions.
+clang-format binaries should weigh in at 1.5MB or less. Watch out for size
+regressions.

Powered by Google App Engine
This is Rietveld 408576698