Rather than trying to symlink as an action after producing the bundle, do it
as an early-stage action. As part of this, mac_framework_bundle callers need
to explicitly specify the top-level symlinks (framework_contents) that should
be created. Frameworks are now packaged like so:
1. At `gn gen` time, an exec_script runs to write the framework_version to a
file. If the previous value written does not match the new value, the entire
framework output directory is clobbered. This must be done at gen-time to
ensure nothing tries to clean the framework while also attempting to copy
to it.
2. Also at `gn gen` time, a TOC file for the framework_contents is written.
This allows the build to emulate depending on the presence of the top-level
symlinks, since ninja does not stat symlinks correctly.
https://github.com/ninja-build/ninja/issues/1186
3. The package_framework.py action now runs before the main create_bundle().
This action depends on the TOC file from (2) and will create all the
required symlinks in the bundle. At the time this runs, the symlink target
may not yet exist.
4. The create_bundle target is now always the leaf edge for
mac_framework_bundle, and it copies all bundle contents to the fully
versioned path (rather than through a symlink).
This should resolve the issue of the build not stabilizing between specifying
a framework_version and not.
BUG=648757
Review-Url: https://codereview.chromium.org/2487763002
Cr-Original-Commit-Position: refs/heads/master@{#430778}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9522ddcc745f739414607811da8a2c6a17dbb17a
Write the current framework_version to a file at gen-time, and clobber the
entire framework bundle if it differs from the current value in the file.
This has to be done at gen-time because it is not possible to run a script at
the create_bundle stage before any other dependencies in its tree run. Take
this sample graph:
bundle_data --> shared_library
/
mac_framework_bundle
\
action("clean_framework_version")
It is not possible, from a mac_framework_bundle, to force the
clean_framework_version action to run before the shared_library. When the
action does run, its stamp will have a newer mtime than the shared_library.
Because bundle_data are hard linked into place, the link source file will
have an older mtime than the action, and the build will never stabilize.
BUG=648757
R=dpranke@chromium.org
Originally Committed: https://crrev.com/fed4fc1df8bab7159f19e04ed658c1f417e4e499
Reverted: https://crrev.com/d76ba00e6cc2625000d495e79bdc8d747645405e
Review-Url: https://codereview.chromium.org/2453043002
Cr-Original-Commit-Position: refs/heads/master@{#428366}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a74b313db5f7444667bcf6530f1b2740884f4bfd
Reason for revert:
rules.gni file is causing the build failure.
------
/b/c/b/Google_Chrome_Mac/src/buildtools/mac/gn gen //out/Release --check
-> returned 1
ERROR at //build/config/mac/rules.gni:313:3: Script returned non-zero exit code.
exec_script("//build/config/mac/prepare_framework_version.py",
^----------
Current dir: /b/c/b/Google_Chrome_Mac/src/out/Release/
Command: python -- /b/c/b/Google_Chrome_Mac/src/build/config/mac/prepare_framework_version.py /b/c/b/Google_Chrome_Mac/src/out/Release/obj/ui/base/ui_unittests_framework_version /b/c/b/Google_Chrome_Mac/src/out/Release/ui_unittests Framework.framework ''
Returned 1.
Original issue's description:
> [Mac/GN] Fix rebuilds when changing framework_version of a mac_framework_bundle.
>
> Write the current framework_version to a file at gen-time, and clobber the
> entire framework bundle if it differs from the current value in the file.
>
> This has to be done at gen-time because it is not possible to run a script at
> the create_bundle stage before any other dependencies in its tree run. Take
> this sample graph:
>
> bundle_data --> shared_library
> /
> mac_framework_bundle
> \
> action("clean_framework_version")
>
> It is not possible, from a mac_framework_bundle, to force the
> clean_framework_version action to run before the shared_library. When the
> action does run, its stamp will have a newer mtime than the shared_library.
> Because bundle_data are hard linked into place, the link source file will
> have an older mtime than the action, and the build will never stabilize.
>
> BUG=648757
> R=dpranke@chromium.org
>
> Committed: https://crrev.com/fed4fc1df8bab7159f19e04ed658c1f417e4e499
> Cr-Commit-Position: refs/heads/master@{#428183}
TBR=dpranke@chromium.org,brettw@chromium.org,rsesek@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=648757
Review-Url: https://codereview.chromium.org/2453933006
Cr-Original-Commit-Position: refs/heads/master@{#428212}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d76ba00e6cc2625000d495e79bdc8d747645405e
Write the current framework_version to a file at gen-time, and clobber the
entire framework bundle if it differs from the current value in the file.
This has to be done at gen-time because it is not possible to run a script at
the create_bundle stage before any other dependencies in its tree run. Take
this sample graph:
bundle_data --> shared_library
/
mac_framework_bundle
\
action("clean_framework_version")
It is not possible, from a mac_framework_bundle, to force the
clean_framework_version action to run before the shared_library. When the
action does run, its stamp will have a newer mtime than the shared_library.
Because bundle_data are hard linked into place, the link source file will
have an older mtime than the action, and the build will never stabilize.
BUG=648757
R=dpranke@chromium.org
Review-Url: https://codereview.chromium.org/2453043002
Cr-Original-Commit-Position: refs/heads/master@{#428183}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fed4fc1df8bab7159f19e04ed658c1f417e4e499
This ensures that the hermetic toolchain is only used if use_system_xcode is
false. This CL also causes two changes:
* svn is assumed to be installed on the system. It is not pulled from the
hermetic toolchain.
* mac_sdk_build was used to populate the SDK version in the Info.plist. This
was being populated with a different version than the SDK being used to build
Chrome, which is incorrect.
BUG=651267
Review-Url: https://codereview.chromium.org/2412353003
Cr-Original-Commit-Position: refs/heads/master@{#425170}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6218c34684254f1c090bf501f6c46b0a69b63ec5
The default is to produce a .app bundle. This CL also adds an option to produce
a .xpc bundle, which is a MH_EXECUTE-type bundle structure with a different
extension.
BUG=604809
Review-Url: https://codereview.chromium.org/2369583002
Cr-Original-Commit-Position: refs/heads/master@{#420760}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5ebcfa81e37ff1ebb2ef4baf00096598631c5aa2
The ios_framework_bundle and mac_framework_bundle templates were
sharing part of the implementation via the framework_bundle. This
template is unnecessarily complex due to differences between iOS
and macOS build so remove it and inline the implementation in the
two OS specific templates.
BUG=None
Review-Url: https://codereview.chromium.org/2209973002
Cr-Original-Commit-Position: refs/heads/master@{#409966}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9d5d9721db94c90e362f857be02b5f0de22a5219
This separates out the default values of configs for the various target types into well-named global variables that can be referred to in different places.
This allows us to move the set_defaults calls for various templates to the places where those templates are defined rather than putting them all in BUILDCONFIG. An example of this is the test() target defaults, where the actual template is declared in a .gni file but the defaults have to be global.
Review-Url: https://codereview.chromium.org/2150753002
Cr-Original-Commit-Position: refs/heads/master@{#405627}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: edb6ecc9667278999e8b885a4e79849887580d2d
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
Chrome on iOS needs to use tweak_info_plist, so port support
for info_plist_target from mac_info_plist to ios_info_plist.
BUG=617134
Review-Url: https://codereview.chromium.org/2033403003
Cr-Original-Commit-Position: refs/heads/master@{#397727}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e0ab61670fb9d7826de41e313004a0e4d0379da6
Refactor out common code between Mac and iOS Info.plist generation using gn and
make separate mac_info_plist and ios_info_plist templates for use with existing
mac_framework_bundle, mac_app_bundle, and ios_app_bundle templates.
BUG=297668
Review URL: https://codereview.chromium.org/1877523002
Cr-Original-Commit-Position: refs/heads/master@{#389682}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7df5f898fc2ccd951ac36fb18a485775586b4dcf
Several targets require a build-time dependency on a framework bundle, but not a
link-time one. This can be if the target is only using the framework for its
resources or if it dlopen()s it at run-time.
framework_bundle now adds another target (target_name+link) that can be used if
something wants a link-time dependency on the framework bundle. By default, only
a build-time dependency is created.
BUG=297668
R=sdefresne@chromium.org,brettw@chromium.org
Review URL: https://codereview.chromium.org/1910133002
Cr-Original-Commit-Position: refs/heads/master@{#389528}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 152572b1ae44de42b011c667c1d8bf317810851e
This leaves the existing bundle_data_xib rule for iOS but re-implements it
using a new compile_xibs template. This also adds mac_xib_bundle_data to
call the compile_xibs template and add a bundle_data.
BUG=297668
R=sdefresne@chromium.org
Review URL: https://codereview.chromium.org/1897853003
Cr-Original-Commit-Position: refs/heads/master@{#388186}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ef017e6f2fe72ce3cb2c2aa0150b898a044fd39c
Plugins are just loadable_module targets with a bundle directory
structure. This also builds two plugins in //ppapi that are required
to build //content/shell.
BUG=297668
Review URL: https://codereview.chromium.org/1878033002
Cr-Original-Commit-Position: refs/heads/master@{#387970}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 53dc3107bd03d046cc9d72dae1a41233660c1712
Fix the ios_framework_bundle template to create a new public config
so that anyone depending on the target will correctly link against
it. Change framework_bundle to use public_deps in order to make the
public config accessible.
Create //ios/third_party/earl_grey target.
BUG=599321
Review URL: https://codereview.chromium.org/1879003002
Cr-Original-Commit-Position: refs/heads/master@{#387265}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 22de3c95e286c337ebdf32e424f911d00f209350
This uses the new output_prefix_override flag to not prefix framework
shared libraries with "lib" and overrides the output_extension to be
empty.
BUG=297668
Review URL: https://codereview.chromium.org/1871143002
Cr-Original-Commit-Position: refs/heads/master@{#386692}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c7905381e103462334ea24c20f1de670d89bd1ec
Extract commonalities to framework_bundle and rename mac_framework to
mac_framework_bundle for consistency & introduce ios_framework_bundle.
Rename app template from build/config/ios/rules.gni to ios_app_bundle
for consistency.
BUG=None
Review URL: https://codereview.chromium.org/1871413002
Cr-Original-Commit-Position: refs/heads/master@{#386673}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1a969442c07ee8642074b4f204cdfb4c9e630995
Things that are incomplete:
- Processing Info.plist variables.
- Not placing the intermediate shared library output in the root_out_dir.
- Modifying the install_name of the library (or using the correct output name
initially).
- Not forcing Info.plist into binary format.
BUG=297668
Review URL: https://codereview.chromium.org/1865483002
Cr-Original-Commit-Position: refs/heads/master@{#385879}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 80fb939caf1967692381310a634279650508718e
The recent formatter alphebetizing change is causing a lot of noise in
code reviews. Figured it'd be worth a clean-up CL.
Exact command I ran:
find . -name "*.gn*" -exec gn format --in-place "{}" \;
TBR=ddorwin@chromium.org
BUG=554928
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1464873002
Cr-Original-Commit-Position: refs/heads/master@{#360891}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d7a71c88990b6788ceaf1ec9ee518099709ff3fd
I've taken ad591c629a
and merged it onto Chromium ToT, with a few lint and other cleanups,
and one fix to make sure that Mac still compiled (which may have broken
iOS, haven't tested yet).
R=brettw@chromium.org, sdfresne@chromium.org
BUG=459705
CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg
Review URL: https://codereview.chromium.org/1250913002
Cr-Original-Commit-Position: refs/heads/master@{#342297}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2a29462a04dabad3fc20dc922227c46b36459912