Commit 38a4180e authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Support GOMACC_PATH env injection

Currently, compilation of simple chrome build is done like below.
gomacc -> chromeos's compiler wrapper -> actual compiler binary

But chromeos's compiler wrapper modifies some flags inside it before invoking actual compiler binary.
This prevents goma from knowing some information for build cache sharing.

To know all the flags passed to compiler binary, this change supports the way not using gomacc prefix.
If we set has_gomacc_path = true, we don't prepend gomacc and lets compiler wrapper find gomacc from GOMACC_PATH env and invoke gomacc inside wrapper.
By doing this, gomacc can know all the flags passed to compiler binary.

This is a part of effort to share build cache between goma users for simple chrome build.

chromite side change is
https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1140099

BUG=chromium:846610

Change-Id: I84174b12a7f286d1b911f4d0a4e167883a4891c7
Reviewed-on: https://chromium-review.googlesource.com/1151040Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579680}
parent 1a7945d0
...@@ -151,7 +151,9 @@ template("gcc_toolchain") { ...@@ -151,7 +151,9 @@ template("gcc_toolchain") {
# toolchain args, use those values, otherwise default to the global one. # toolchain args, use those values, otherwise default to the global one.
# This works because the only reasonable override that toolchains might # This works because the only reasonable override that toolchains might
# supply for these values are to force-disable them. # supply for these values are to force-disable them.
if (toolchain_uses_goma) { # But if has_gomacc_path is set, we assumes that compiler wrapper find
# gomacc from GOMACC_PATH envvar.
if (toolchain_uses_goma && !has_gomacc_path) {
goma_path = "$goma_dir/gomacc" goma_path = "$goma_dir/gomacc"
# Use the static analysis script if static analysis is turned on # Use the static analysis script if static analysis is turned on
......
...@@ -8,6 +8,11 @@ declare_args() { ...@@ -8,6 +8,11 @@ declare_args() {
# Set to true to enable distributed compilation using Goma. # Set to true to enable distributed compilation using Goma.
use_goma = false use_goma = false
# This flag is for ChromeOS compiler wrapper.
# By passing gomacc path via GOMACC_PATH environment variable, ChromeOS'
# compiler wrapper invokes gomacc inside it.
has_gomacc_path = false
# Set the default value based on the platform. # Set the default value based on the platform.
if (host_os == "win") { if (host_os == "win") {
# Absolute directory containing the gomacc.exe binary. # Absolute directory containing the gomacc.exe binary.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment