[virtualization] Avoid rebuilding guest images when nothing changed.

Currently, a "fx build" involving the "prebuilt_image" target will
always execute the target (and all of its downstream actions), even
if nothing has changed.

The reason is as follows:

The "guest_prebuilt" action needs to perform some trickery to allow a
build to succeed even if no prebuilt image is available. It does this
by dynamically generating a depfile linking the prebuilt image to a
copy of the image in the output directory. (See added comments in this
CL for details).

The current depfile is in an incorrect format, however: GN (or, more
precisely, Ninja) expects the LHS of the depfile to have a path relative
to the output directory, while the current depfile has an absolute path.
Ninja becomes confused, and makes the conservative decision to just
execute the action again.

This CL updates the depfile to be relative to the out directory, as is
expected by Ninja. We also add some additional comments explaining some
of the tricks being carried out by the "prebuilt_image" action.

After this CL, a "fx build" on an unmodified tree performs no actions,
as expected.

Change-Id: I789a7ba7154ee40350278bcea8ad048a587ca857
2 files changed
tree: feb9c166ef63a962ebf9f773df33f4282c33ddaf
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. infra/
  9. peridot/
  10. products/
  11. scripts/
  12. sdk/
  13. src/
  14. third_party/
  15. tools/
  16. zircon/
  17. .clang-format
  18. .clang-tidy
  19. .dir-locals.el
  20. .gitattributes
  21. .gitignore
  22. .gn
  23. AUTHORS
  24. BUILD.gn
  25. CODE_OF_CONDUCT.md
  26. CONTRIBUTING.md
  27. LICENSE
  28. OWNERS
  29. PATENTS
  30. README.md
  31. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See the documentation.