John Wittrock
unread,Jan 6, 2021, 9:28:20 AM1/6/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pkg-dev, Geevarghese V K, John Wittrock, pkg...@fuchsia.dev, discuss, Amit Uttamchandani
Indeed, this works with real hardware. You can run a NUC with a set of base packages, but if you decide you need `
rolldice.cmx` for some reason and you want to run it, you can run `fx serve` and then `fx shell run fuchsia-pkg://rolldice#meta/rolldice.cmx` and you should see its output printed on your shell. Assuming rolldice was part of universe and not paved with the base image, that command running means:
- your NUC reached out to the package server configured on the host and asked if it knew anything about a package called 'rolldice', and if so what its most recent version was
- the package server responded with a new version and its
merkle root - your NUC downloaded and cached all the blobs that make up the package, verified that all of the blobs matched their hashes in the package manifest, and pkg-resolver returned a directory handle to the package
- your NUC ran `rolldice.cmx` from the cached package
A key aspect of fuchsia (as you can see from the front page of
fuchsia.dev is this concept of easy updatability for packages which don't have to be updated as a monolith, and may not all exist on the device at the time the device is paved.
Many utilities you'd expect to use on a shell in a core build are actually downloaded on-demand, like `ls` and `cat`. To use those, you should be running `fx serve` to serve their respective packages. If you're doing development which you expect to break the netstack or otherwise compromise a connection to the package server, you can build packages into the base image by including them using `--with-base //path/to/my/package` in your `fx set line`. That means that you will have them regardless of your networking situation, but also means they cannot be updated without running an OTA, for which you need a connection to the package server anyway. On-demand package resolution like this makes development faster and keeps our images small, but does require a connection to your host. Then again, so does ssh, so you should have one anyway!