3 GN is a meta-build system that generates ninja files. It's meant to be faster
4 and simpler than GYP. It outputs Ninja build files and optionally GYP files
5 during the transitional period.
7 Chromium normally uses checked-in binary versions of GN, so that we don't
8 have to worry about bootstrapping a build of GN from scratch.
10 In order to make changes to GN and update the checked-in binaries, you must
11 have access to the "chromium-gn" bucket in Google Cloud Storage. To date,
12 only a few Googlers have this access; if you don't have it, ask someone
15 Assuming you have access to the bucket, do the following:
17 1) Make the changes to the GN source
21 3) Get it reviewed and landed.
23 4) Obtain local build machines (with Chromium checkouts with your change)
24 for Mac, Windows, and 32-bit and 64-bit Linux environments.
26 On Linux, make sure you have the debian sysroots needed to do proper builds:
27 % export GYP_DEFINES="branding=Chrome buildtype=Official"
30 5) Sync each checkout to the revision of Chromium containing your change (or
31 a suitable later one).
33 6) Ensure that you have initialized the gsutil credentials as described in
34 buildtools/README.txt . The username should be the one that is on the ACL
35 for the "chromium-gn" bucket (probably your @google.com address).
36 Contact the build team for help getting access if necessary.
38 7) Run the checked-in GN binary to create a new build directory. Use the args
39 specified in the buildtools/*/gn_args.txt files:
42 % gn gen //out/Release_gn_rel32 --args="<flags from buildtools/linux32/gn_args.txt>"
43 % ninja -C out/Release_gn_rel32 gn
44 % cp out/Release_gn_rel32/gn buildtools/linux32
45 % buildtools/linux32/upload_gn
46 % gn gen //out/Release_gn_rel64 --args="<flags from buildtools/linux32/gn_args.txt>"
47 % ninja -C out/Release_gn_rel64 gn
48 % cp out/Release_gn_rel64/gn buildtools/linux64
49 % buildtools/linux64/upload_gn
52 % gn gen //out/Release_gn_rel --args="<flags from buildtools/mac/gn_args.txt>"
53 % ninja -C out/Release_gn_rel gn
54 % cp out/Release_gn_rel/gn buildtools/mac/
55 % buildtools/mac/upload_gn
58 > gn gen //out/Release_gn_rel --args="<flags from buildtools/win/gn_args.txt>"
59 > ninja -C out\Release_gn_rel gn
60 > copy out\Release_gn_rel\gn.exe buildtools\win
61 > buildtools\win\upload_gn.bat
63 7) The uploads in the previous step will produce updated .sha1 files in
64 src/buildtools/*/*.sha1 . Those hashes need to be uploaded, reviewed,
65 and committed into the buildtools repo.
67 8) Once buildtools has been uploaded, roll the new version of buildtools/
68 back into chrome via src/DEPS.