New issue
Advanced search Search tips

Issue 902776 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Incorrect file paths in Mojo typemap configurations lead to confusing error messages

Project Member Reported by mmenke@chromium.org, Nov 7

Issue description

I've been moving some mojom / typemaps around, and have gotten a variety of completely inscrutable gn errors, which take quite a while to debug.  Examples:

ERROR at dynamically parsed input that //mojo/public/tools/bindings/mojom.gni:125:35 loaded :66:25: Could not read file.
  _imported = read_file(typemap_import, "scope")
                        ^-------------
I resolved this to "C:/src/chrome/src/net/interfaces/typemaps.gni".
See //chrome/test/BUILD.gn:21:1: whence it was imported.
import("//mojo/public/tools/bindings/mojom.gni")
^----------------------------------------------
See //BUILD.gn:102:7: which caused the file to be included.
      "//chrome/test:browser_tests",

This apparently means "mojo/public/tools/bindings/chromium_bindings_configuration.gni" still references a removed typemap file."  Note that the browser_tests path at the end varied randomly from run to run.



ERROR at dynamically parsed input that dynamically parsed input that //mojo/public/tools/bindings/mojom.gni:125:35 loaded :74:16 loaded :5:9: Could not read file.
mojom = "//net/interfaces/address_family.mojom"
        ^--------------------------------------
I resolved this to "C:/src/chrome/src/net/interfaces/address_family.mojom".
See //chrome/test/BUILD.gn:21:1: whence it was imported.
import("//mojo/public/tools/bindings/mojom.gni")
^----------------------------------------------
See //BUILD.gn:102:7: which caused the file to be included.
      "//chrome/test:browser_tests",
      ^----------------------------

This one apparently means that a address_family.typemap has a reference to "net/interfaces/address_family.mojom" (Which was moved).  But you also get the exact same error if any mojom files tries to import the file at the old path.


Could we at least output the current mojo/bindings file being processed in these error messages?
 
I don't think there's anything we can do to Mojo's build files to improve this situation. This is a GN issue.
Components: -Internals>Mojo Internals>Mojo>Bindings
Summary: Incorrect file paths in Mojo typemap configurations lead to confusing error messages (was: Mojo build errors are not useful.)
I suppose one way we could solve for this without touching GN source would be to get rid of typemap files altogether, in favor of having one giant typemap configuration block in chromium_bindings_configuration.gni. Adding/removing/changing any typemap would then require making changes to that singular file.

We lose locality of typemap information, but we reduce overall magic in the system and would get better errors.

Sign in to add a comment