Skip to content

remove goma configs from GN build #93941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions llvm/utils/gn/build/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,6 @@ config("compiler_defaults") {
]
}
}
if (is_clang && use_goma) {
# goma converts all paths to lowercase on the server, breaking this
# warning.
cflags += [ "-Wno-nonportable-include-path" ]
}
}

# On Windows, the linker is not invoked through the compiler driver.
Expand Down Expand Up @@ -373,9 +368,6 @@ config("compiler_defaults") {
if (sysroot != "" && current_os != "win" && is_clang) {
cflags += [ "-Wpoison-system-directories" ]
}
assert(
!use_goma || sysroot != "",
"goma needs a sysroot: run `llvm/utils/sysroot.py make-fake --out-dir=sysroot` and add `sysroot = \"//sysroot\"` to your args.gn")

if (use_ubsan) {
assert(is_clang && (current_os == "ios" || current_os == "linux" ||
Expand Down
19 changes: 3 additions & 16 deletions llvm/utils/gn/build/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import("//llvm/utils/gn/build/toolchain/compiler.gni")

assert(!use_goma || goma_dir != "",
"set `goma_dir` to the output of `goma_ctl goma_dir` in your args.gn")
assert(!use_goma || compiler_wrapper == "",
"`use_goma` and `compiler_wrapper` are mutually exclusive")

unix_copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"

template("unix_toolchain") {
Expand All @@ -23,11 +18,8 @@ template("unix_toolchain") {
cxx = rebase_path(clang_base_path, root_build_dir) + "/bin/clang++"
}

ld = cxx # Don't use goma wrapper for linking.
if (use_goma) {
cc = "$goma_dir/gomacc $cc"
cxx = "$goma_dir/gomacc $cxx"
} else if (compiler_wrapper != "") {
ld = cxx # Don't use compiler wrapper for linking.
if (compiler_wrapper != "") {
cc = "$compiler_wrapper $cc"
cxx = "$compiler_wrapper $cxx"
}
Expand Down Expand Up @@ -195,7 +187,6 @@ template("stage2_unix_toolchain") {
forward_variables_from(invoker.toolchain_args, "*")

clang_base_path = root_build_dir
use_goma = false
}

deps = [
Expand Down Expand Up @@ -301,9 +292,7 @@ template("win_toolchain") {
}
}

if (use_goma) {
cl = "$goma_dir/gomacc $cl"
} else if (compiler_wrapper != "") {
if (compiler_wrapper != "") {
cl = "$compiler_wrapper $cl"
}

Expand Down Expand Up @@ -425,7 +414,6 @@ win_toolchain("stage2_win_x64") {
sysroot = win_sysroot
}
clang_base_path = root_build_dir
use_goma = false
}
deps = [
"//:clang($host_toolchain)",
Expand All @@ -442,7 +430,6 @@ win_toolchain("stage2_win_x86") {
sysroot = win_sysroot
}
clang_base_path = root_build_dir
use_goma = false
}
deps = [
"//:clang($host_toolchain)",
Expand Down
11 changes: 0 additions & 11 deletions llvm/utils/gn/build/toolchain/compiler.gni
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
declare_args() {
# Whether to use goma (https://chromium.googlesource.com/infra/goma/client/)
use_goma = false

# If is_goma is true, the location of the goma client install.
# Set this to the output of `goma_ctl goma_dir`.
goma_dir = ""

# If set, this is prepended to compile action command lines (e.g. `"ccache"`).
# Cannot be used with use_goma/goma_dir.
compiler_wrapper = ""

# Set this to a clang build directory. If set, that clang is used as compiler.
# goma only works with compiler binaries it knows about, so useful both for
# using a goma-approved compiler and for compiling clang with a locally-built
# clang in a different build directory.
# On Windows, setting this also causes lld-link to be used as linker.
# Example value: getenv("HOME") + "/src/llvm-build/Release+Asserts"
clang_base_path = ""
Expand Down
Loading