Currently, linking with goma causes goma 'local fallback', and goma
allows at most 1 link in parallel (without special flag).
In 520f95147c821e13003362194a5de003a9f5c8f9, linking with goma is
enabled (maybe accidentally). It's better not to use goma for
linking now.
Review-Url: https://codereview.chromium.org/2667383002
Cr-Original-Commit-Position: refs/heads/master@{#447858}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c398506e3abc0799330e39144194d70c00e4032e
If "use_clang_static_analyzer" is enabled in args.gn, Clang builds will redirect compilation to use Clang's ccc-analyzer and cxx-analyzer for static analysis.
Review-Url: https://codereview.chromium.org/2617283002
Cr-Original-Commit-Position: refs/heads/master@{#445854}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 520f95147c821e13003362194a5de003a9f5c8f9
Stop going through goma (or other compiler wrapper) for the "link"
tool when building for macOS/iOS (to follow gcc_compiler.gni).
BUG=None
Review-Url: https://codereview.chromium.org/2613503002
Cr-Original-Commit-Position: refs/heads/master@{#442245}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5adef79d6f465dddc30e88db148c5b69c7059448
iOS builds can set use_xcode_clang = true and use_system_xcode = false when
chromium clang is broken. This requires prepending DEVELOPER_DIR to clang/clang++, etc
BUG=669094
Review-Url: https://codereview.chromium.org/2578273002
Cr-Original-Commit-Position: refs/heads/master@{#439028}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c360dbf9da64cbf1c6b2d63e87aab8eda61dd424
With Xcode 8, the invocation of actool need to contain the type of
the bundle containing the asset catalog, pass the information from
the create_bundle target to the actool command.
BUG=634373
Review-Url: https://codereview.chromium.org/2236973004
Cr-Original-Commit-Position: refs/heads/master@{#411865}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bf8b26608b67a274cf7b5ca99446043e9e197394
This cleans up some variable definitions around templates not marking variables used.
The chromevox directory worked around the bug by putting the variables to share
in a .gni file. This file can now be deleted and the contents merged with the
BUILD file (the only place it was included).
The iOS code referencing this bug seems to be mistaken, at least in some of the
cases. The conditions in that file do not trigger the variable used bug. The
build seems to work without this code, so I removed it.
BUG=395883
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2237233002
Cr-Original-Commit-Position: refs/heads/master@{#411738}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 84f93c430207e806a6a3746d4163990391c1fbc1
The Posix toolchain definitions forwarded the target_cpu and target_os to all secondary toolchains. But the computation of these values should be invariant of the toolchain. This removes the forwarding.
Review-Url: https://codereview.chromium.org/2229063002
Cr-Original-Commit-Position: refs/heads/master@{#410883}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ec467a46f0e8760fae1928e4040d053caae843df
toolchain_args is changing from a function call to a scope that can be passed around. Pipe these args through the various toolchain templates. This adds complexity in some cases, but it eliminates the need for the toolchain templates to know about every build flag they might ever be called with.
BUG=634446
Review-Url: https://codereview.chromium.org/2219953002
Cr-Original-Commit-Position: refs/heads/master@{#410853}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3c38c5cdab9e6fc35852ae79be5351be2bd6d49e
Parse output of actool and discard uninteresting messages and
fail on unexpected warning messages (as actool termines with
a success error code even if some resources are missing).
BUG=635306
Review-Url: https://codereview.chromium.org/2224763002
Cr-Original-Commit-Position: refs/heads/master@{#410824}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5b150b0a5a28f95f651767f901819390fc065676
To simplify the creation of binary bundles on iOS, always use lipo
to create the final binary, even when not generating fat binaries
(in that case the lipo invocation is just a simple copy unless dSYM
generation or code stripping are enabled).
BUG=635302
Review-Url: https://codereview.chromium.org/2222753003
Cr-Original-Commit-Position: refs/heads/master@{#410600}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c7091801f98c82e3a1a0aa5c89feed19738c713c
Chrome on iOS wants to use the content of .dSYM directory generated
when enable_dsyms is set to true, so explicitly list the files that
are found inside.
Change some deps to public deps so that the .dSYM files are visible
via a public dependency when depending on the create_bundle target.
BUG=634777
Review-Url: https://codereview.chromium.org/2224583004
Cr-Original-Commit-Position: refs/heads/master@{#410486}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8d79e46082552107fdcd2016fd08c0fd5795fd48
Define an explicit pool //build/toolchain:link_pool with a depth
of concurrent_links and convert all the toolchain link targets to
use it instead of setting concurrent_links property of the tool.
BUG=612786
Review-Url: https://codereview.chromium.org/2201363004
Cr-Original-Commit-Position: refs/heads/master@{#409846}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 96e7407d139b8a8e43f6db7d4af3118078aba7de
Fix unused variable error in //build/toolchain/mac/BUILD.gn by
moving the _compiler_prefix variable inside the mac_toolchain
template.
Only check the use_clang_xcode variable for the default toolchain
as some file are build with "mac" current_os on iOS.
BUG=633978
Review-Url: https://codereview.chromium.org/2209713002
Cr-Original-Commit-Position: refs/heads/master@{#409570}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ecc33473f3dbebda070e0ceedb9316591414949f
Fix build when dSYM generation is enabled and output is a thin binary
by correctly informing gn and ninja of the location where the .dSYM
file is generated.
When defining "dsym_switch" in the toolchain definition, the value of
root_out_dir is not yet known (it is only known later when we know if
the toolchain is the default toolchain or not), so use {{root_out_dir}}
to lazily perform the expansion when the information is known.
When determining whether dSYM generation is enabled in the toolchain
definition, look at "toochain_os" instead of "is_ios" as "is_ios" is
defined based on target_os (i.e. is incorrect in the toolchain).
Use output_dir/output_name instead of using rebase_path() to generate
an output name containing directory information because 1. this is a
hack that output_dir was introduced to fix, 2. link tool and ninja do
not agree about the location of the .dSYM file.
BUG=630901
Review-Url: https://codereview.chromium.org/2174373002
Cr-Original-Commit-Position: refs/heads/master@{#407737}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 92754a40e7bd74f5a4b3437d33fa4d90068c01d2
When creating fat binaries, the generation of the .dSYM file need to
use the fat binary and not the intermediate binaries. So for a fat
build, //build/config/mac:strip_all is an empty configuration and the
linker tools do not pass the flag requesting generation of the .dSYM
file to linker_driver.py, instead the flags are passed when "lipo" is
invoked.
Fix //build/toolchain/mac/linker_driver.py to look for both "-o" and
"-output" when looking for the linker output to allow wrapping "lipo"
in addition to the compiler linker (as "lipo" only accept "-output"
flag to specify the output file).
Always add //build/config/mac:strip_all to the dependencies of all
linkable targets on iOS (as is done on Mac) and fix cronet.
BUG=593582
Review-Url: https://codereview.chromium.org/2160653002
Cr-Original-Commit-Position: refs/heads/master@{#406253}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6e714433f6749c3664ca816d1c64a488828ef75d
This declares a new GN arg save_unstripped_output that can be enabled if
enable_stripping=true. If true, then an unstripped copy of the linker output
will be saved in the output directory with an ".unstripped" suffix.
BUG=628052
R=mark@chromium.org
Review-Url: https://codereview.chromium.org/2157573002
Cr-Original-Commit-Position: refs/heads/master@{#406110}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7fa0d497278e20eb8f38e02269f0e88d8cffa9c2
All .strings files that need to be in binary1 format are now
converted by using the "bundle_data_strings" template so the
conversion can be remove from "copy_bundle_data" tool.
BUG=625578
Review-Url: https://codereview.chromium.org/2130813002
Cr-Original-Commit-Position: refs/heads/master@{#404621}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f52c49dc18851aaf7ca4f3a78b5312350193f5ba
When building Chrome on iOS there are 60000+ copy_bundle_data steps,
so using a python script is slow. Instead re-implement the logic in
pure shell and using hard-links when possible.
Improve the build time of a clobber build by 4.6x (measured on a
Mac Pro using goma with a reduction from 32m24.498s to 7m1.310s
according to "time").
Commands used to time the build:
$ gn clean out/gn-Debug-iphoneos
$ time ninja -j 1000 -C out/gn-Debug-iphoneos All_iOS
BUG=621030
Review-Url: https://codereview.chromium.org/2106353004
Cr-Original-Commit-Position: refs/heads/master@{#403696}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d5e358f61f3d6257062cdc6a6ec6a76104273ca7
Chrome on iOS downstream developer wants to be able to control the
size of the "bundle_pool" independently of the number of concurrent
link targets.
BUG=612786
Review-Url: https://codereview.chromium.org/2085463002
Cr-Original-Commit-Position: refs/heads/master@{#402166}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f42145ad884229d1bd0f1b9012d5afeedb180f68
Those toolchain definition are not used (and not working as building
with gcc on Mac does not currently work).
BUG=None
Review-Url: https://codereview.chromium.org/2088823002
Cr-Original-Commit-Position: refs/heads/master@{#401232}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 944038877a37801b29a42ae5fbca04963df14ae1
The official Chrome on iOS build are build using the version of clang
shipped with Xcode (a.k.a. the system version of clang). This CL adds
a flag to allow building with this version of clang instead of the
hermetic shipped with Chromium source (i.e. ToT clang).
When building with system version of clang, some compiler warning have
to be flipped as they are unsupported and the plugins are disabled (as
they only work for a single version of clang).
Refactor the definition of the toolchain for iOS and correctly set the
default_toolchain when targetting iOS based on target_cpu (used to be
incorrectly set to "//build/toolchain/mac:ios_clang_arm").
BUG=620376
Review-Url: https://codereview.chromium.org/2079283002
Cr-Original-Commit-Position: refs/heads/master@{#401119}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fe65591ff09b9180898e303ec4831d4e7dfb10e9
When a tool is implemented as a script, modification of the script does not
cause any dependent build steps to be dirtied and rebuilt, since the script
isn't listed as an input. To hack around this, use another script to get the
tool script's modification time and use that as the command line tool version.
This still won't cause rebuild if just the script changes, but when the build
files are regenerated (like after apply_patch and generate_build_files on the
bots), the dependent build steps will get rebuilt.
BUG=619083
R=brettw@chromium.org, sdefresne@chromium.org
Review URL: https://codereview.chromium.org/2075703002 .
Cr-Original-Commit-Position: refs/heads/master@{#400519}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f2eb108ab1e65962104bfde275743369b0e7665b
The OS expects the localized .strings file to be in binary1 plist format
on iOS devices, so convert the files when copying the to the application
bundle (use CoreFoundation module to do the conversion instead of plutil
as the module is already loaded to validate the file format).
Rename functions in copy_bundle_data.py to follow the python style guide.
Fixes 3D touch shortcuts on Chrome on iOS when building with GN.
BUG=618398
Review-Url: https://codereview.chromium.org/2052333002
Cr-Original-Commit-Position: refs/heads/master@{#400221}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2063e083d9fed1165fe30a5e791de4fc7b960090
Reason for revert:
Broke both Mac GN builders; tests are failing with errors such as:
AcceleratorsCocoaBrowserTest.MainMenuAcceleratorsInMapping (run #1):
[ RUN ] AcceleratorsCocoaBrowserTest.MainMenuAcceleratorsInMapping
[1361:515:0615/193339:210535270587:FATAL:crashpad_client_mac.cc(411)] execvp /b/swarm_slave/work/isolated/isolated_runTnrdHD/out/Release/Chromium.app/Contents/Versions/53.0.2769.0/Chromium Framework.framework/Helpers/crashpad_handler: No such file or directory
Original issue's description:
> [Mac/iOS/GN] Use rsync in copy_bundle_data instead of shutil.copytree.
>
> As the TODO this fixes states, copytree preserves mtimes. This can cause
> overbuild when building bundled products. Switch to using rsync to have more
> control over copy parameters.
>
> BUG=297668
> R=dpranke@chromium.org
>
> Committed: https://crrev.com/0cc137a639e9eb687b0fbde47983d672bcc8ef9f
> Cr-Commit-Position: refs/heads/master@{#400047}
TBR=dpranke@chromium.org,rsesek@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=297668
Review-Url: https://codereview.chromium.org/2074523003
Cr-Original-Commit-Position: refs/heads/master@{#400081}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e127bb46966c5d7eec116a9612502e1cd0ea20cf
As the TODO this fixes states, copytree preserves mtimes. This can cause
overbuild when building bundled products. Switch to using rsync to have more
control over copy parameters.
BUG=297668
R=dpranke@chromium.org
Review-Url: https://codereview.chromium.org/2075463002
Cr-Original-Commit-Position: refs/heads/master@{#400047}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0cc137a639e9eb687b0fbde47983d672bcc8ef9f
Bundled directory structures use symlinks relative to other components in the
bundle, and those should be preserved as symlinks, rather than copying the
file contents.
BUG=297668,604809
R=sdefresne@chromium.org
Review-Url: https://codereview.chromium.org/2050963002
Cr-Original-Commit-Position: refs/heads/master@{#398880}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c83d846a78e4d291bee8681bab917af7b9e12faf
This was causing overbuild for targets that override the output directory,
since the linker_driver.py is configured to place dSYMs in root_out_dir, but
the linker output was listed in the target_out_dir.
BUG=330301,431177
R=brettw@chromium.org
Review-Url: https://codereview.chromium.org/2049003004
Cr-Original-Commit-Position: refs/heads/master@{#398739}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0dda1538d9a8e10e8ad5288b3c2a71cd2437b643
Reduce the number of tasks using the copy_bundle_data and compile_xcassets
tools as they can cause lots of I/O contention when invoking ninja with a
large number of parallel jobs (e.g. when using distributed build like goma).
Use the same depth as the link_pool (but in a separate pool).
BUG=612786
Review-Url: https://codereview.chromium.org/2018553003
Cr-Original-Commit-Position: refs/heads/master@{#398585}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a78c5b20b9d0d8cb6e883e3efb83dafbc7849655
The Mac and iOS GN bots don't currently limit the number of concurrent
links. The official continuous win bots aren't on MB because they can't
limit the number of concurrent links through MB.
This CL adds a 'concurrent_links' arg to GN, which calls the
get_concurrent_links script to get the appropriate default value
(making this consistent across platforms), and also adds a hack
to MB to translate a gyp_link_concurrent "GYP_DEFINE" to the
GYP_LINK_CONCURRENCY env var.
The CL also adds a test for this MB hack and the similar, already existing
LLVM_FORCE_HEAD_REVISION hack.
R=scottmg@chromium.org, brettw@chromium.org
BUG=602480, 611491, 616390
Review-Url: https://codereview.chromium.org/2031233002
Cr-Original-Commit-Position: refs/heads/master@{#398200}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ec079268641d3d284884a5acf55d75af6065f549
This creates a new script called the linker driver, which runs all three
steps of linking: the image link, debug info link, and stripping. In GYP,
the last two steps were handled as postbuilds, but GN lacks those. Instead,
the linker driver performs all three operations in one build step.
BUG=330301,431177
R=mark@chromium.org,dpranke@chromium.org
Review-Url: https://codereview.chromium.org/1999513002
Cr-Original-Commit-Position: refs/heads/master@{#397880}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b89811bd0b77ae38f45359c6d78a5e06b997e499
Implement the assets catalog compilation without using mac_tool.py
from tools/gyp in order to make //build independent from the rest
of Chromium checkout.
BUG=616813
Review-Url: https://codereview.chromium.org/2023223002
Cr-Original-Commit-Position: refs/heads/master@{#397469}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17dd77eb2af78643ffeb32bbb2ee48c2d22106e7
This adds the required framework to libs[] wherever they are required (most
of the changes in this CL). It also enables the component build optimization
of creating a non-bundled dylib to roll up all the sources and dependencies.
The framework then links that, which allows the build to not copy the bundled
library if any sources change. This is based on the technique implemented
https://codereview.chromium.org/11420019/.
BUG=431177
R=thakis@chromium.org,brettw@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/1961473003
Cr-Original-Commit-Position: refs/heads/master@{#392823}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 02aa51cf444626f4781824c17178376c0459ad83
Add a new script to copy data into an iOS/Mac bundle based on the gyp
script (but removing extra work that is not required as it is done in
previous steps).
BUG=297668
Review-Url: https://codereview.chromium.org/1946203002
Cr-Original-Commit-Position: refs/heads/master@{#392332}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 62321627a76f6990ce912fc24fd5d1c6d0ab7c74
The gyp-mac-tool is written every time .ninja files are regenerated.
This can cause significant overbuild. This change simply avoids writing
it (and touching its time-stamp) if nothing has changed.
The equivalent fix was done for Windows in crrev.com/1932133002
BUG=607776
Review-Url: https://codereview.chromium.org/1928303003
Cr-Original-Commit-Position: refs/heads/master@{#390983}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0305180fdbb1b8413f1d67b2f8d4af1cb70259d7
Reason for revert:
As with the previous attempts to land this cl, android and GPU builders are failing compile with OOM errors:
https://bugs.chromium.org/p/chromium/issues/detail?id=607673
Original issue's description:
> Implement arflags in the GN build.
>
> This flag was recently added in GN. This patch hooks it up to the toolchains
> and moves some flags to use it that previously had to be hardcoded on the
> tool command itself.
>
> Remove concurrent_links variable from gcc_toolchain which was unused.
>
> BUG=598599
> Reland of http://crrev.com/1909163002 with no changes (now that a GN binary push to fix the bug has gone in) which was a reland of http://crrev.com/1896163003 with fix.
TBR=brucedawson@chromium.org,brettw@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=598599
Review-Url: https://codereview.chromium.org/1930293002
Cr-Original-Commit-Position: refs/heads/master@{#390545}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 500a5624ab6d616b503bf75449cfc772b9c3d2c2
This flag was recently added in GN. This patch hooks it up to the toolchains
and moves some flags to use it that previously had to be hardcoded on the
tool command itself.
Remove concurrent_links variable from gcc_toolchain which was unused.
BUG=598599
Reland of http://crrev.com/1909163002 with no changes (now that a GN binary push to fix the bug has gone in) which was a reland of http://crrev.com/1896163003 with fix.
Review-Url: https://codereview.chromium.org/1907403002
Cr-Original-Commit-Position: refs/heads/master@{#390424}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 897cde76d084732227ea88af76163e33eda18778
Reason for revert:
speculatively reverting: issues with linking on the gpu bots again: https://build.chromium.org/p/chromium.gpu/builders/Android%20Debug%20%28Nexus%206%29/builds/8079
Original issue's description:
> Implement arflags in the GN build.
>
> This flag was recently added in GN. This patch hooks it up to the toolchains
> and moves some flags to use it that previously had to be hardcoded on the
> tool command itself.
>
> Remove concurrent_links variable from gcc_toolchain which was unused.
>
> BUG=598599
> Reland of http://crrev.com/1896163003 with fix.
TBR=brucedawson@chromium.org,brettw@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=598599
Review URL: https://codereview.chromium.org/1910393002
Cr-Original-Commit-Position: refs/heads/master@{#389000}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2ce39e29422675764e94de94458ce3bb22fe53d3