This adds the following commands to sky_tools:
sky_tools cache clear: Nukes all local artifacts in the cache
sky_tools cache populate: Populates the cache with all known artifacts
This is useful both to fix busted caches and to make sure that the cache is
fully populated so that subsequent operations can proceed without needing
network access.
This teaches commands that need binary artifacts to explicitly instantiate an
instance of the ArtifactStore with the appropriate packageRoot string. The
ArtifactStore can then remember the package root and compute the engine
revision when created and remember those for subsequence calls.
This teaches sky_tools mojo_run --android to invoke mojo's devtool's mojo_run
script with the right flags for invoking sky_viewer on android. This tells the
devtools script to load sky_viewer.mojo from https://storage.googleapis.com/...
and to load app.flx (or whatever the developer specifies as --app) from the
filesystem using the devtools http server.
This initial version assumes the developer has mojo_shell and all other services
sitting on disk somewhere and that they're on linux and only want to run on
linux. This can be generalized down the line to support more use cases. This
downloads the sky_viewer.mojo corresponding to the packages/sky_engine/REVISION
in the developer's directory, so they can specify whatever revision they want.
sky_tools run_mojo downloads sky_viewer.mojo into its cache directory if it is
not present and constructs a command line to pass to mojo_shell that maps the
shebang stamped into the flx to the downloaded sky_viewer.mojo.
Since sky_viewer.mojo lives in the cloud and mojo_shell can load from the cloud
this could also map to an https URL. This should likely be an option.
This adds logic to download and use the sky_snapshot binary from
Google cloud storage when running the 'sky_tools build' command.
The downloaded binary is put into lib/cache/... The binary is
chosen to match the REVISION in the sky_engine package in the
packages directory of whichever package the user wishes to
build a flx from.
Known issues:
*) Assumes linux-x64 host
*) Assumes download will always produce valid executable
*) No clearing of stale cache entries
skyx files are zips, so they can have anything at the start. Having
a shebang line at the start makes it easier to run skyx files in a mojo
environment.
This command will produce an flx package. Currently, this command doesn't work
because we don't have the Flutter compiler downloaded from Google storage yet.
A future patch will make that happen.
This command uses package:test to run Dart tests with sky_shell. For this to
work, we need https://github.com/dart-lang/test/tree/hacky-loader-hook to land.
We're also not smart enough to find sky_shell ourselves yet. Instead, we take
the path as input using an environment variable. Eventually, we'll be able to
get the sky_shell executable from package:sky_engine, but we don't yet ship
that executable.