New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 740693 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Consider updating or removing mac_sdk_min_build_override.

Project Member Reported by erikc...@chromium.org, Jul 10 2017

Issue description

Chrome supplies mac_sdk_min_build_override to allow other projects [v8, webrtc, libyuv, pdfium] to supply their own min sdk when built as standalone projects.

Most of these projects are now using the same SDK version as Chrome.

Chrome:
mac_sdk_min_build_override = "10.10"

webrtc: 
mac_sdk_min_build_override = "10.11"
[This isn't indexed by cs.chromium.org, check out webrtc source and see build_overrides/build.gni].

v8:
mac_sdk_min_build_override = "10.10"

libyuv:
mac_sdk_min_build_override = "10.11"

pdfium:
mac_sdk_min_build_override = "10.10"

libyuv's change was introduced at: https://codereview.chromium.org/1870473002, with the stated intention of using the same overrides at webrtc.


In the not too distant future, Chrome is going to be rolling to the 10.12 SDK. At the very least, we should remove the v8 and pdfium overrides. We may want to consider rolling webrtc/libyuv to 10.12 as well, at which point we could get rid of this override entirely. That being said, it may be convenient for subprojects to be able to roll their SDK at a different rate from Chromium.
 
Actually, the whole concept of "_build_override" variables can go away now. We added a better mechanism for allowing projects to set default values for args by setting things in the `default_args` scope in the dotfile:

https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#dotfile

i.e., if pdfium wanted to stay on 10.10, they could just set `default_args = { mac_sdk_min = "10.10" }`.
dpranke: I tried to update this for webrtc:
https://codereview.webrtc.org/2979603002/

But I get a compile error because I'm setting mac_sdk_min on non-mac OSes, but, I also can't use "if (is_mac)" since that gets loaded at "build/config/BUILDCONFIG.gn", which I guess hasn't been loaded at the time ".gn" is being loaded?
Cc: brettw@chromium.org
Ah. You're getting an "unused arg" warning from GN, which isn't normally fatal. However, the way that recipe works, it calls out to GN to get a list of targets to build, and it looks like they way they're parsing the list is broken (not filtering out the warning message).

*However*, that doesn't actually address your problem, which is a real one, i.e.: how do you specify an argument in default_args that may only be declared in some configurations?

That's a good question. I don't actually have a good answer at the moment, here's some rambling:

First, it is possible to hack around this in at least one way, but I don't particularly like the idea.

For example, you could add the following to //build/toolchain/toolchain.gni:

if (!is_mac) {
  declare_args() {
    mac_sdk_min = "unused"
  }
  assert(mac_sdk_min == "unused" || true)
}

This would work because pretty much every config ends up including toolchain.gni, but, in theory, the only toolchains that did include mac_sdk.gni would also have is_mac==true. But, I don't like this for the probably obvious reason that the dependency is not at all obvious.

Another alternative would be to modify toolchain.gni to unconditionally include mac_sdk.gni and, more generally, do something like move all of the variables that you want to be able to override per-project into some file that *is* commonly included. But, this seems almost as bad as using build_overrides.

Yet another alternative would be to expose more variables to the context that the dotfile is parsed in. For example, you could make the builtin vars like host_os be defined. But, that probably wouldn't solve every need.

A fourth alternative would be to modify GN to not complain about variables declared in default_args {} if they weren't used. I'm not wild about this idea either, but it might be the best option.

brettw@, WDYT?
Cc: oprypin@chromium.org

Comment 5 by brettw@chromium.org, Jul 11 2017

I prefer keeping the checking for unused variables in the build overrides: there is some danger that these can get out of sync for various projects and we should tell people when things are obsolete.

My preference would be to move the declare_args for the variables we expect people to be able to override to a separate .gni file that the //build/config/BUILD.gn can include (along with the existing mac_sdk.gni). Then have an if (!is_mac) { assert... thing in that build file to unconditionally mark those used.
Creating a new .gni file SGTM.
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f42b89b85146f1cf98bb7424e88227ed9d9da623

commit f42b89b85146f1cf98bb7424e88227ed9d9da623
Author: Erik Chen <erikchen@chromium.org>
Date: Thu Jul 13 02:56:20 2017

Create build/config/overrides.gni to host subproject-overridable variables.

Move mac_sdk_min into build/config/overrides.gni and assert that it is used.
This prevents unused arg warnings from subprojects that override it.

Bug:  740693 
Change-Id: Ib40a52c59c852aab46781a0d44812b07b0e5061c
Reviewed-on: https://chromium-review.googlesource.com/566595
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486240}
[modify] https://crrev.com/f42b89b85146f1cf98bb7424e88227ed9d9da623/build/config/BUILD.gn
[modify] https://crrev.com/f42b89b85146f1cf98bb7424e88227ed9d9da623/build/config/mac/mac_sdk.gni
[add] https://crrev.com/f42b89b85146f1cf98bb7424e88227ed9d9da623/build/config/mac/mac_sdk_overrides.gni

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/webrtc.git/+/0ff780005965f366d7238773127999dda15c6a1b

commit 0ff780005965f366d7238773127999dda15c6a1b
Author: erikchen <erikchen@chromium.org>
Date: Thu Jul 13 16:03:13 2017

Update .gn to set a min SDK for macOS.

Currently, WebRTC is setting this config via mac_sdk_min_build_override. The old
mechanism is deprecated, but cannot be removed until chromium is updated to no
longer require mac_sdk_min_build_override.

BUG= chromium:740693 
TBR=kjellander@webrtc.org

Review-Url: https://codereview.webrtc.org/2979603002
Cr-Commit-Position: refs/heads/master@{#19006}

[modify] https://crrev.com/0ff780005965f366d7238773127999dda15c6a1b/.gn

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/libyuv/libyuv.git/+/95a20b677d626bd21f5bf3df2e94482bb7630336

commit 95a20b677d626bd21f5bf3df2e94482bb7630336
Author: Frank Barchard <fbarchard@google.com>
Date: Thu Jul 13 17:34:42 2017

Update .gn to set a min SDK for macOS via GN.

Currently, libyuv is setting this config via mac_sdk_min_build_override. The old
meechanism is deprecated, but cannot be removed until chromium is updated to no
longer require mac_sdk_min_build_override.

TBR=kjellander@chromium.org
Bug: chromium:740693 
Change-Id: I71533c9ef20ac8d7584d50751ac5437da54e2cb5
Reviewed-on: https://chromium-review.googlesource.com/565636
Reviewed-by: Frank Barchard <fbarchard@google.com>

[modify] https://crrev.com/95a20b677d626bd21f5bf3df2e94482bb7630336/.gn

Project Member

Comment 10 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2820caa3e3c8e908963255ba3f6cb13e05b18530

commit 2820caa3e3c8e908963255ba3f6cb13e05b18530
Author: Erik Chen <erikchen@chromium.org>
Date: Thu Jul 13 23:01:50 2017

Remove mac_sdk_min_build_override.

All projects that need to change the default mac min SDK now directly do so via
a GN arg.

Bug:  chromium:740693 
Change-Id: I99f04d482177e6ec8a5d1306f68cb2410b0beb0e
Reviewed-on: https://chromium-review.googlesource.com/566078
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486514}
[modify] https://crrev.com/2820caa3e3c8e908963255ba3f6cb13e05b18530/build/config/mac/mac_sdk.gni
[modify] https://crrev.com/2820caa3e3c8e908963255ba3f6cb13e05b18530/build/config/mac/mac_sdk_overrides.gni
[modify] https://crrev.com/2820caa3e3c8e908963255ba3f6cb13e05b18530/build_overrides/build.gni

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/9fa0d097158e7ae2a254fbf587b6e1ac93bfa3e1

commit 9fa0d097158e7ae2a254fbf587b6e1ac93bfa3e1
Author: erikchen <erikchen@chromium.org>
Date: Fri Jul 14 18:24:44 2017

Remove build_override for macOS min SDK and deployment target.

v8 now uses the same SDK as Chromium, even when built as a standalone project.
The deployment target override has no effect.

Bug:  chromium:740693 
Change-Id: I089f74d5ad1590ff7167564f83b0110620a92ef9
Reviewed-on: https://chromium-review.googlesource.com/565887
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46686}
[modify] https://crrev.com/9fa0d097158e7ae2a254fbf587b6e1ac93bfa3e1/build_overrides/build.gni

Components: -Infra Infra>Client>V8 Infra>Client>Chrome Infra>Client>WebRTC
Owner: erikc...@chromium.org
Status: Started (was: Untriaged)
Status: Fixed (was: Started)
I think so.

Sign in to add a comment