Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1352)

Unified Diff: mojom/mojom_parser/generated/README.md

Issue 1421193003: New Mojom Parser: Serialization. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Refactors TestSingleFileSerialization. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/BUILD.gn ('k') | mojom/mojom_parser/generated/mojom_files/mojom_files.mojom.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/generated/README.md
diff --git a/mojom/mojom_parser/generated/README.md b/mojom/mojom_parser/generated/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..ec9d95de6f231b3f732f629f78d8c2c05b1c4b87
--- /dev/null
+++ b/mojom/mojom_parser/generated/README.md
@@ -0,0 +1,44 @@
+Generated Files
+==================
+
+The intermediate representation passed from the Mojom parser (the frontend
+of the Mojom compiler) to the code generators (the backend of the Mojom
+Compiler) is a `MojomFileGraph` described in mojom_types.mojom and
+mojom_files.mojom in mojo/public/interfaces/bindings. Thus the Mojom compiler
+uses Mojo serialization to serialize the intermediate representation.
+
+This situation potentially entails a circular dependency because it means that
+in order to build the Mojom compiler it is necessary to use code that has been
+generated by the Mojom compiler. In order to break this circular dependency we
+check in the generated code needed by the compiler rather than generating it
+while building the compiler.
+
+This directory contains the checked-in generated Go code used by the frontend
+of the compiler:
+mojom_files/mojom_files.mojom.go and
+mojom_types/mojom_types.mojom.go.
+
+The backend of the Mojom compiler is written in Python and the corresponding
+generated Python files may be found in
+mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_files_mojom.py
+and
+mojo/public/tools/bindings/pylib/mojom/generate/generated/mojom_types_mojom.py
+
+### Instructions for updating these files
+1) Make changes to mojom_types.mojom and mojom_files.mojom. This may be done
+either in the same patch as everything below or in its own initial patch.
+2) Compile these files to produce new generated files:
+ninja -C out/Debug mojo/public/interfaces/bindings.
+3) Copy the newly generated mojom_files.mojom.go and mojom_types.mojom.go
+into the appropriate locations in this directory.
+4) mojom_files.mojom.go needs to be manually patched in a minor way. In the
+import section at the top replace "mojo/public/interfaces/bindings/mojom_types"
+with "mojom/mojom_parser/generated/mojom_types".
+5) Update the Go code in the serialization module of the parser to compensate
+for the changes if necessary. (Not necessary if the changes in step 1 were
+backward compatible.)
+6) Perform the analog of steps 3, 4, 5 for the Python code in the backend of
+the compiler. See
+mojo/public/tools/bindings/pylib/mojom/generate/generated/README.md
+for instructions.
+7) Land a patch containing your changes from steps 3 through 6.
« no previous file with comments | « mojom/mojom_parser/BUILD.gn ('k') | mojom/mojom_parser/generated/mojom_files/mojom_files.mojom.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698