Hi,
I recently updated our downstream pdfium build config from 7191 to 7828, [1] and encountered some breakage.
In particular, the //build roll from [2] has caused this error:
```
['gn', 'gen', 'out/Default'] (cwd=PosixPath('/home/me/projects/pypdfium2/sbuild/native/pdfium'))
ERROR at //build/toolchain/gcc_toolchain.gni:357:17: Unknown substitution pattern
command = "$cxx -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} {{module_deps_no_self}} -fmodule-name={{cc_module_name}} -x c++ -Xclang -emit-module -c {{source}} -o {{output}}"
^-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Found a {{ at offset 136 and did not find a known substitution following it.
See //build/toolchain/gcc_toolchain.gni:905:3: whence it was called.
single_gcc_toolchain(target_name) {
^----------------------------------
See //build/toolchain/linux/custom/BUILD.gn:3:1: whence it was called.
gcc_toolchain("default") {
^-------------------------
See //BUILD.gn:10:1: which caused the file to be included.
group("default") {
^-----------------
```
Below is the build config used, but I suspect it also happens with some other configs. In particular, I also saw the issue with is_clang = true.
```
is_debug = false
use_glib = false
use_remoteexec = false
treat_warnings_as_errors = false
clang_use_chrome_plugins = false
is_component_build = false
pdf_is_standalone = true
pdf_enable_v8 = false
pdf_enable_xfa = false
pdf_use_skia = false
pdf_use_partition_alloc = false
use_sysroot = false
use_custom_libcxx = false
is_clang = false
custom_toolchain = "//build/toolchain/linux/custom:default"
host_toolchain = "//build/toolchain/linux/custom:default"
```
I then took a look at the commit log and tracked down the cause to [3].
Reverting that renaming with the patch below seemed to fix this issue:
```
diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni
index 6da1768..409d213 100644
--- a/toolchain/gcc_toolchain.gni
+++ b/toolchain/gcc_toolchain.gni
@@ -354,7 +354,7 @@ template("single_gcc_toolchain") {
# Module file doesn't need coverage instrumentation because module files
# represent interfaces rather than implementations.
- command = "$cxx -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} {{module_deps_no_self}} -fmodule-name={{cc_module_name}} -x c++ -Xclang -emit-module -c {{source}} -o {{output}}"
+ command = "$cxx -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} {{module_deps_no_self}} -fmodule-name={{label_name}} -x c++ -Xclang -emit-module -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CXX_MODULE {{output}}"
outputs = [ "$object_subdir/{{source_name_part}}.pcm" ]
```
I thought I'd post it here because I wondered why this only hit downstream, not in your buildbots? Or is there anything wrong with my config/setup after all?
Any feedback is appreciated.
Thanks!