|
|
DescriptionAllow a custom toolchain to be injected into BUILDCONFIG.gn
Similar to ChromeOS, Chromecast needs to be able to set an arbitrary
toolchain as the default. This solution allows the path to that
toolchain to be set as a build arg.
BUG=
Committed: https://crrev.com/ef18b74fc138591559ce32ec4ac7822bffc390ec
Cr-Commit-Position: refs/heads/master@{#352037}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Fix comment typo. #
Total comments: 5
Patch Set 3 : Call set_default_toolchain exactly once. #Patch Set 4 : Remove cros_use_custom_toolchain #
Total comments: 2
Patch Set 5 : Remove empty-string check on _default_toolchain #Patch Set 6 : Reimplement empty-string check for nacl case #Messages
Total messages: 41 (12 generated)
slan@chromium.org changed reviewers: + dpranke@chromium.org, halliwell@chromium.org
Dirk, We need a way to point to an internal toolchain. ChromeOS builds do this by hardcoding to a generalized gcc_toolchain. We could probably do this too, or even use //build/toolchain/cros:target, but that would require putting is_chromecast in BUILDCONFIG.gn. This change is my attempt at avoiding that. PTAL
dpranke@chromium.org changed reviewers: + brettw@chromium.org
This seems reasonable to me, but I'd like brettw to review this as well. https://codereview.chromium.org/1373593003/diff/1/build/config/gcc/gcc_versio... File build/config/gcc/gcc_version.gni (right): https://codereview.chromium.org/1373593003/diff/1/build/config/gcc/gcc_versio... build/config/gcc/gcc_version.gni:6: # This allows the gcc_version to be overriden when using a custom toolchanin typo: "toolchanin"
https://codereview.chromium.org/1373593003/diff/1/build/config/gcc/gcc_versio... File build/config/gcc/gcc_version.gni (right): https://codereview.chromium.org/1373593003/diff/1/build/config/gcc/gcc_versio... build/config/gcc/gcc_version.gni:6: # This allows the gcc_version to be overriden when using a custom toolchanin On 2015/09/28 19:16:33, Dirk Pranke wrote: > typo: "toolchanin" Done.
https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... File build/config/BUILDCONFIG.gn (right): https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:140: custom_toolchain = "" We need to keep this file cleaner than this. Please restructure the cros code so that everybody uses the same custom_toolchain variable. https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:566: set_default_toolchain(custom_toolchain) let's restructure the code above to assign to a variable _default_toolchain and then call set_default_toolchain once at the bottom, either with that value, or the custom one. It seems like poor form to call a function and then call it again with a different value.
https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... File build/config/BUILDCONFIG.gn (right): https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:140: custom_toolchain = "" On 2015/09/28 19:58:28, brettw wrote: > We need to keep this file cleaner than this. Please restructure the cros code so > that everybody uses the same custom_toolchain variable. There are two paths around this redundancy: 1) All ChromeOS builds use |custom_toolchain|, and |cros_use_custom_toolchain| goes away. The reason that I did not go straight to this solution is that it will break any ChromeOS build relying on |cros_use_custom_toolchain|. Although this should have minimal impact in Chrome, it will likely have a huge impact on the CrOS internal build infrastructure. 2) Allow chromecast builds to utilize //build/toolchain/cros:target as the default toolchain. This is the path of least resistance, but it a) forces us to introduce is_chromecast here, and b) is non-intuitive. I would view this as a temporary solution, but I would prefer it to blocking this patch on the issues presented by #1 Which idea did you have in mind? I will reach out to a couple of CrOS folks to figure out what needs to happen if we go with #1. https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:566: set_default_toolchain(custom_toolchain) On 2015/09/28 19:58:28, brettw wrote: > let's restructure the code above to assign to a variable _default_toolchain and > then call set_default_toolchain once at the bottom, either with that value, or > the custom one. It seems like poor form to call a function and then call it > again with a different value. Done.
I was thinking about #1. I don't know if the chromecast flag is used currently in practice, and if it doesn't break anything on our waterfall, we should feel free to change it.
ChromeOS is not yet using this flag. Removed it to reduce redundancy. https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... File build/config/BUILDCONFIG.gn (right): https://codereview.chromium.org/1373593003/diff/20001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:140: custom_toolchain = "" On 2015/09/28 20:50:40, slan wrote: > On 2015/09/28 19:58:28, brettw wrote: > > We need to keep this file cleaner than this. Please restructure the cros code > so > > that everybody uses the same custom_toolchain variable. > > There are two paths around this redundancy: > > 1) All ChromeOS builds use |custom_toolchain|, and |cros_use_custom_toolchain| > goes away. > > The reason that I did not go straight to this solution is that it will break any > ChromeOS build relying on |cros_use_custom_toolchain|. Although this should have > minimal impact in Chrome, it will likely have a huge impact on the CrOS internal > build infrastructure. > > 2) Allow chromecast builds to utilize //build/toolchain/cros:target as the > default toolchain. > > This is the path of least resistance, but it a) forces us to introduce > is_chromecast here, and b) is non-intuitive. I would view this as a temporary > solution, but I would prefer it to blocking this patch on the issues presented > by #1 > > Which idea did you have in mind? > > I will reach out to a couple of CrOS folks to figure out what needs to happen if > we go with #1. > Removed.
lgtm https://codereview.chromium.org/1373593003/diff/60001/build/config/BUILDCONFI... File build/config/BUILDCONFIG.gn (right): https://codereview.chromium.org/1373593003/diff/60001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:549: } else if (_default_toolchain != "") { I think it's OK to remove this empty string check and also the initial assignment to the empty string. GN will give you an error if you don't call set_default_toolchain in this file. If somebody screws it up, giving the error dereferencing an unknown variable might actually be more clear in this case.
https://codereview.chromium.org/1373593003/diff/60001/build/config/BUILDCONFI... File build/config/BUILDCONFIG.gn (right): https://codereview.chromium.org/1373593003/diff/60001/build/config/BUILDCONFI... build/config/BUILDCONFIG.gn:549: } else if (_default_toolchain != "") { On 2015/09/28 21:25:29, brettw wrote: > I think it's OK to remove this empty string check and also the initial > assignment to the empty string. GN will give you an error if you don't call > set_default_toolchain in this file. If somebody screws it up, giving the error > dereferencing an unknown variable might actually be more clear in this case. Done.
The CQ bit was checked by slan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from brettw@chromium.org Link to the patchset: https://codereview.chromium.org/1373593003/#ps80001 (title: "Remove empty-string check on _default_toolchain")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373593003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373593003/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2015/09/28 21:59:33, commit-bot: I haz the power wrote: > Try jobs failed on following builders: > linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) set_default_toolchain() is not called for nacl components on Linux builds. I have reinserted the empty-string check to keep behavior consistent for these builds.
On 2015/09/28 23:47:29, slan wrote: > On 2015/09/28 21:59:33, commit-bot: I haz the power wrote: > > Try jobs failed on following builders: > > linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, > > > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > set_default_toolchain() is not called for nacl components on Linux builds. I > have reinserted the empty-string check to keep behavior consistent for these > builds. I think the correct fix for this is probably to assert that default_toolchain has already been set in the is_nacl block, and then assert that either default_toolchain != "" or _default_toolchain != "", and then call set_default_toolchain(_default_toolchain) if the latter is true.
On 2015/09/29 00:01:10, Dirk Pranke wrote: > On 2015/09/28 23:47:29, slan wrote: > > On 2015/09/28 21:59:33, commit-bot: I haz the power wrote: > > > Try jobs failed on following builders: > > > linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, > > > > > > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > > > set_default_toolchain() is not called for nacl components on Linux builds. I > > have reinserted the empty-string check to keep behavior consistent for these > > builds. > > I think the correct fix for this is probably to assert that default_toolchain > has already been set in the is_nacl block, > and then assert that either default_toolchain != "" or _default_toolchain != "", > and then call set_default_toolchain(_default_toolchain) > if the latter is true. I tried this before submitting my latest patch. Oddly, the following assertion fails inside the nacl block, independently of my patch: assert(defined(default_toolchain)) I need to better understand the nacl build. What is the mechanism that is supposed to shout at you if you have not defined the default_toolchain?
The CQ bit was checked by slan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373593003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373593003/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2015/09/29 01:12:15, slan wrote: > On 2015/09/29 00:01:10, Dirk Pranke wrote: > > On 2015/09/28 23:47:29, slan wrote: > > > On 2015/09/28 21:59:33, commit-bot: I haz the power wrote: > > > > Try jobs failed on following builders: > > > > linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, > > > > > > > > > > http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) > > > > > > set_default_toolchain() is not called for nacl components on Linux builds. I > > > have reinserted the empty-string check to keep behavior consistent for these > > > builds. > > > > I think the correct fix for this is probably to assert that default_toolchain > > has already been set in the is_nacl block, > > and then assert that either default_toolchain != "" or _default_toolchain != > "", > > and then call set_default_toolchain(_default_toolchain) > > if the latter is true. > > I tried this before submitting my latest patch. Oddly, the following assertion > fails inside the nacl block, independently of my patch: > > assert(defined(default_toolchain)) > > I need to better understand the nacl build. What is the mechanism that is > supposed to shout at you if you have not defined the default_toolchain? Ping for feedback here. The default toolchain is not set on a nacl build, which is respected by the latest patch. Are we clear to land this? Or does this warrant more investigation?
On 2015/10/01 18:26:58, slan wrote: > On 2015/09/29 01:12:15, slan wrote: > > I tried this before submitting my latest patch. Oddly, the following assertion > > fails inside the nacl block, independently of my patch: > > > > assert(defined(default_toolchain)) > > > > I need to better understand the nacl build. What is the mechanism that is > > supposed to shout at you if you have not defined the default_toolchain? > > Ping for feedback here. The default toolchain is not set on a nacl build, which > is respected by the latest patch. Are we clear to land this? Or does this > warrant more investigation? Sorry, I dropped this on the floor. Brett, should default_toolchain be set when BUILDCONFIG.gn is being re-processed for secondary toolchains, or is the value not available?
On 2015/10/01 18:26:58, slan wrote: > Ping for feedback here. The default toolchain is not set on a nacl build, which > is respected by the latest patch. Are we clear to land this? Or does this > warrant more investigation? This is built-in. The first invocation of BUILDCONFIG.gn must call set_default_toolchain or GN will error out (since it doesn't know what to do). I couldn't say whether the variable default_toolchain will be set in secondary invocations, it doesn't surprise me that it's not, and it doesn't seem necessary.
lgtm
ok, lgtm then as well.
The CQ bit was checked by slan@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373593003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373593003/100001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
On 2015/10/01 20:43:05, commit-bot: I haz the power wrote: > Try jobs failed on following builders: > win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...) Seems win trybots are flaking massively: http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_... Will circle back in a bit to retry.
The CQ bit was checked by slan@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373593003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373593003/100001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/...)
The CQ bit was checked by slan@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1373593003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1373593003/100001
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/ef18b74fc138591559ce32ec4ac7822bffc390ec Cr-Commit-Position: refs/heads/master@{#352037} |