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

Issue 1759793003: Scripts to upload and update the mac toolchain. (Closed)

Created:
4 years, 9 months ago by justincohen
Modified:
4 years, 8 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Scripts to upload and update the mac toolchain. The following two scripts allow for the update and roll of the mac toolchain (Xcode) via DEPS instead of thru an infrastructure install script. The upload / download nature of the script follows somewhat what Windows does with visual studio files and what Mac already does for clang rolls. build/package_mac_toolchain.py takes an Xcode.app directory and packages up what the parts the Mac build uses into a tar file and uploads it to gs://chrome-mac-sdk/ build/mac_toolchain.py runs as part of hooks, downloads and decompresses the mac toolchain, and points system files to this new directory with the DEVELOPER_DIR environment variable. Setting DEVELOPER_DIR throughout gyp-ninja requires this GYP CL: https://codereview.chromium.org/1806733002/ BUG=474373 Committed: https://crrev.com/6a03a3dc9196b4474e7f5c08803f076a95055b44 Cr-Commit-Position: refs/heads/master@{#383461}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Use full path #

Total comments: 28

Patch Set 4 : Tighten up scripts #

Patch Set 5 : nits #

Patch Set 6 : Change data file name #

Total comments: 1

Patch Set 7 : More comments and sudoers check #

Patch Set 8 : Add dev version to comments #

Patch Set 9 : Comment typo #

Total comments: 5

Patch Set 10 : Ensure DownloadAndUnpack cleans up itself #

Total comments: 9

Patch Set 11 : Added per-file OWNERS #

Patch Set 12 : Set DEVELOPER_DIR #

Patch Set 13 : Use DEVELOPER_DIR flag instead #

Patch Set 14 : Accept Xcode license #

Total comments: 6

Patch Set 15 : Address Erik comments #

Patch Set 16 : Only run on mac #

Total comments: 10

Patch Set 17 : Roll to Xcode 7.3, address scottmg comments #

Total comments: 1

Patch Set 18 : Roll back to Xcode to 5.1.1 #

Patch Set 19 : Roll to Xcode 5.1.1 with 10.10 SDK #

Total comments: 10

Patch Set 20 : Address Nico comments #

Patch Set 21 : Change call to gyp_chromium from environment variable to param #

Patch Set 22 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -0 lines) Patch
M .gitignore View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +6 lines, -0 lines 0 comments Download
M build/OWNERS View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M build/gyp_chromium.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +5 lines, -0 lines 0 comments Download
A build/mac_toolchain.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +154 lines, -0 lines 0 comments Download
A build/package_mac_toolchain.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +98 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (9 generated)
justincohen
https://codereview.chromium.org/1759793003/diff/40001/third_party/mac_sdk/update.py File third_party/mac_sdk/update.py (right): https://codereview.chromium.org/1759793003/diff/40001/third_party/mac_sdk/update.py#newcode60 third_party/mac_sdk/update.py:60: def main(): I removed the GYP_DEFINE check, that needs ...
4 years, 9 months ago (2016-03-03 01:24:54 UTC) #1
erikchen
https://codereview.chromium.org/1759793003/diff/40001/DEPS File DEPS (right): https://codereview.chromium.org/1759793003/diff/40001/DEPS#newcode614 DEPS:614: 'name': 'mac_sdk', technically, we're pulling a partial toolchain, not ...
4 years, 9 months ago (2016-03-03 01:45:47 UTC) #3
justincohen
Going to add some more comments and then shop this around to infra and others. ...
4 years, 9 months ago (2016-03-03 18:58:33 UTC) #4
erikchen
Overall, this looks pretty reasonable. Let me know when you want a full review. https://codereview.chromium.org/1759793003/diff/100001/build/mac_toolchain.py ...
4 years, 9 months ago (2016-03-03 22:43:12 UTC) #5
justincohen
For your consideration This hasn't had a chance to run on trybots yet, but the ...
4 years, 9 months ago (2016-03-03 23:23:56 UTC) #9
Paweł Hajdan Jr.
In general looks fine to me. Leaving final review specifically to Mac folks. https://codereview.chromium.org/1759793003/diff/160001/build/mac_toolchain.py File ...
4 years, 9 months ago (2016-03-04 07:57:10 UTC) #10
justincohen
https://codereview.chromium.org/1759793003/diff/160001/build/mac_toolchain.py File build/mac_toolchain.py (right): https://codereview.chromium.org/1759793003/diff/160001/build/mac_toolchain.py#newcode2 build/mac_toolchain.py:2: # Copyright (c) 2012 The Chromium Authors. All rights ...
4 years, 9 months ago (2016-03-04 16:46:44 UTC) #11
Nico
Please add erikchen and you as per-file owners for this. Does this xcode-select the downloaded ...
4 years, 9 months ago (2016-03-08 18:48:46 UTC) #12
justincohen
xcode-select is system wide. We could also set DEVELOPER_DIR, but that's also system wide as ...
4 years, 9 months ago (2016-03-08 19:53:27 UTC) #13
Nico
would it be enough to set DEVELOPER_DIR in the env of the gyp / gn ...
4 years, 9 months ago (2016-03-08 19:54:45 UTC) #14
justincohen
Not as long as we call xcrun ibtool from ninja's mac-tool.py
4 years, 9 months ago (2016-03-08 19:59:13 UTC) #15
Nico
but that could expand to DEVELOPER_DIR/ibtool if that's set, no?
4 years, 9 months ago (2016-03-08 20:00:47 UTC) #16
justincohen
Yeah, that could work. It would look more like: env DEVELOPER_DIR=foo xcrun ibtool... That means ...
4 years, 9 months ago (2016-03-08 20:09:28 UTC) #17
justincohen
The script would still require calling xcodebuild -license accept with sudo, FWIW.
4 years, 9 months ago (2016-03-08 20:09:54 UTC) #18
Nico
On 2016/03/08 20:09:28, justincohen wrote: > Yeah, that could work. It would look more like: ...
4 years, 9 months ago (2016-03-08 20:16:56 UTC) #19
justincohen
Is there an existing pipe for taking a return value from a DEPS hook and ...
4 years, 9 months ago (2016-03-08 20:28:32 UTC) #20
Nico
The way this works on windows is that the toolchain downloader writes toolchain info to ...
4 years, 9 months ago (2016-03-08 20:31:39 UTC) #21
justincohen
Latest CL removes the need to change xcode-select, but now requires a gyp change, and ...
4 years, 9 months ago (2016-03-15 20:14:23 UTC) #23
erikchen
nits, but still looks good https://codereview.chromium.org/1759793003/diff/260001/build/gyp_chromium.py File build/gyp_chromium.py (right): https://codereview.chromium.org/1759793003/diff/260001/build/gyp_chromium.py#newcode20 build/gyp_chromium.py:20: import mac_toolchain sort lexically, ...
4 years, 9 months ago (2016-03-15 20:31:26 UTC) #24
justincohen
https://codereview.chromium.org/1759793003/diff/260001/build/gyp_chromium.py File build/gyp_chromium.py (right): https://codereview.chromium.org/1759793003/diff/260001/build/gyp_chromium.py#newcode20 build/gyp_chromium.py:20: import mac_toolchain On 2016/03/15 20:31:26, erikchen wrote: > sort ...
4 years, 9 months ago (2016-03-20 23:35:23 UTC) #25
scottmg
Looks fine to me. We should probably make Windows simpler like this (stamp rather than ...
4 years, 9 months ago (2016-03-21 20:42:21 UTC) #26
justincohen
https://codereview.chromium.org/1759793003/diff/300001/build/mac_toolchain.py File build/mac_toolchain.py (right): https://codereview.chromium.org/1759793003/diff/300001/build/mac_toolchain.py#newcode96 build/mac_toolchain.py:96: On 2016/03/21 20:42:20, scottmg wrote: > +\n Done. https://codereview.chromium.org/1759793003/diff/300001/build/mac_toolchain.py#newcode119 ...
4 years, 9 months ago (2016-03-22 17:16:10 UTC) #27
erikchen
https://codereview.chromium.org/1759793003/diff/320001/build/mac_toolchain.py File build/mac_toolchain.py (right): https://codereview.chromium.org/1759793003/diff/320001/build/mac_toolchain.py#newcode36 build/mac_toolchain.py:36: TOOLCHAIN_REVISION = '7D175' What version of Xcode is this? ...
4 years, 9 months ago (2016-03-22 17:51:39 UTC) #28
erikchen2
On 2016/03/22 17:51:39, erikchen wrote: > https://codereview.chromium.org/1759793003/diff/320001/build/mac_toolchain.py > File build/mac_toolchain.py (right): > > https://codereview.chromium.org/1759793003/diff/320001/build/mac_toolchain.py#newcode36 > ...
4 years, 9 months ago (2016-03-22 18:30:03 UTC) #29
justincohen
I haven't test it yet, but I updated the script to pull 5.1.1 instead. If ...
4 years, 9 months ago (2016-03-22 18:34:32 UTC) #30
Nico
Looks great, lgtm. Some suggestions below, mostly about using more dependency injection and fewer global ...
4 years, 9 months ago (2016-03-22 20:59:05 UTC) #31
justincohen
https://codereview.chromium.org/1759793003/diff/360001/build/gyp_chromium.py File build/gyp_chromium.py (right): https://codereview.chromium.org/1759793003/diff/360001/build/gyp_chromium.py#newcode326 build/gyp_chromium.py:326: mac_toolchain.SetEnvironment() On 2016/03/22 20:59:05, Nico (away until Mon Mar ...
4 years, 9 months ago (2016-03-23 17:12:44 UTC) #32
Paweł Hajdan Jr.
LGTM
4 years, 9 months ago (2016-03-24 10:57:32 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1759793003/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1759793003/420001
4 years, 9 months ago (2016-03-26 20:41:44 UTC) #36
commit-bot: I haz the power
Committed patchset #22 (id:420001)
4 years, 9 months ago (2016-03-26 21:44:52 UTC) #38
commit-bot: I haz the power
Patchset 22 (id:??) landed as https://crrev.com/6a03a3dc9196b4474e7f5c08803f076a95055b44 Cr-Commit-Position: refs/heads/master@{#383461}
4 years, 9 months ago (2016-03-26 21:46:04 UTC) #40
Nico
4 years, 8 months ago (2016-03-28 21:41:00 UTC) #41
Message was sent while issue was closed.
On 2016/03/23 17:12:44, justincohen wrote:
> https://codereview.chromium.org/1759793003/diff/360001/build/gyp_chromium.py
> File build/gyp_chromium.py (right):
> 
>
https://codereview.chromium.org/1759793003/diff/360001/build/gyp_chromium.py#...
> build/gyp_chromium.py:326: mac_toolchain.SetEnvironment()
> On 2016/03/22 20:59:05, Nico (away until Mon Mar 27) wrote:
> > Would it be possible to pass explicit flags to gyp for what you need instead
> of
> > going through the env here?
> 
> I could add something to args, but then will args be accessible in all the
> places necessary in https://codereview.chromium.org/1806733002/, the gyp side
of
> this CL?

Yes, but there aren't many.


> 
> https://codereview.chromium.org/1759793003/diff/360001/build/mac_toolchain.py
> File build/mac_toolchain.py (right):
> 
>
https://codereview.chromium.org/1759793003/diff/360001/build/mac_toolchain.py...
> build/mac_toolchain.py:98: def SwitchToolchain(directory):
> On 2016/03/22 20:59:05, Nico (away until Mon Mar 27) wrote:
> > Rename to AcceptLicense
> 
> Done.
> 
>
https://codereview.chromium.org/1759793003/diff/360001/build/mac_toolchain.py...
> build/mac_toolchain.py:108: force_pull = 'force_mac_toolchain' in gyp_defines
> On 2016/03/22 20:59:05, Nico (away until Mon Mar 27) wrote:
> > Hm, this won't work with gn. Is there an advantage for looking at
GYP_DEFINES
> > (instead of some other env var -- FORCE_MAC_TOOLCHAIN or something like
that)?
> 
> Changed to environ FORCE_MAC_TOOLCHAIN
> 
>
https://codereview.chromium.org/1759793003/diff/360001/build/mac_toolchain.py...
> build/mac_toolchain.py:129: toolchain_revision =
> gyp_defines.get('mac_toolchain_revision',
> On 2016/03/22 20:59:05, Nico (away until Mon Mar 27) wrote:
> > same question here
> 
> Changed to environ MAC_TOOLCHAIN_REVISION
> 
>
https://codereview.chromium.org/1759793003/diff/360001/tools/clang/scripts/up...
> File tools/clang/scripts/update.py (right):
> 
>
https://codereview.chromium.org/1759793003/diff/360001/tools/clang/scripts/up...
> tools/clang/scripts/update.py:340: mac_toolchain.SetEnvironment()
> On 2016/03/22 20:59:05, Nico (away until Mon Mar 27) wrote:
> > I'm not sure cmake will pay attention to that env var (?)
> > 
> > I think you can revert the change to this file for now, we can consider
> changing
> > this later on. This code is only used on some clang trunk bots which
currently
> > have Xcode, and only to build clang, not chromium.
> 
> Reverted.

Powered by Google App Engine
This is Rietveld 408576698