)]}'
{
  "commit": "6aad69a6d3d7b913230c6e57f2e18eeb09b8ba08",
  "tree": "96ccbd21715edbf75e5b5aa8d83497428e65022c",
  "parents": [
    "b555ffa9b461f2e4b513e0d6d538c2f6475b9911"
  ],
  "author": {
    "name": "Jes B. Klinke",
    "email": "jbk@chromium.org",
    "time": "Tue Feb 15 10:36:40 2022 -0800"
  },
  "committer": {
    "name": "Timothy Trippel",
    "email": "5633066+timothytrippel@users.noreply.github.com",
    "time": "Fri Feb 18 10:21:42 2022 -0800"
  },
  "message": "[opentitantool] Introduce serializable TransportError\n\nIntroducing a serializable TransportError, and convenience\ntransport::{bail, ensure, Result}, to be used instead of anyhow::Result\non all methods of the Transport trait and its delegate traits.\n\nThis change allows propagation of error messages from implementation\nof the Transport trait across the proposed proxy protocol to a client\ncalling a stub implementation of the same Transport trait on another\nmachine.\n\nMany underlying libraries used by the various structs implementing the\nTransport trait use other error enums and anyhow.  A convenience\nmethod is provided to assist in converting such errors into\nTransportError.\n\nIf a transport implementation previously made a call such as this:\nserialport::available_ports()?;\n\nIt will now have to be replaced with:\nuse crate::transport::WrapInTransportError;\nserialport::available_ports().wrap(UartError::EnumarationError)?;\n\nThis will cause e.g. an Err(io::Error(kind: PermissionDenied)) result\nto be converted into Err(TransportError::UartError(EnumerationError,\n\"Permission denied\"), in such a way that it collects the additional\ncontext.  To the end user, the error message will look like this:\n\nUART error: Enumerating: Permission denied\n\nMy hope is that in addition to allowing Transport errors to be sent\nacross RPC calls, the messages will also become more useful to end\nusers.\n\nIt can be debated how deep into the libraries and helper classes used\nby Transport implementations methods should be converted to\nexclusively use TransportError.\n\nA consequence of this change is that errors must own the data they\ncarry, that is, any fields of the type `\u0026\u0027static str` will have to be\nreplaced with `String`, as the remote receiver may not have all the\nsame strings in its executable.\n\nThis marks the first step on issue: #10889\n\nSmaller tangentially related changes also in this CL:\n*) Merge hyperdebug/uart.rs and cw310/uart.rs into common/uart.rs,\n   as both implementations used the same serialport library.\n*) Clarified convention of Uart::read_timeout() such that timeout\n   is always indicated by Ok(0), and serious errors with Err(_).\n\nSigned-off-by: Jes B. Klinke \u003cjbk@chromium.org\u003e\nChange-Id: I027189d44ee01e2bc83b8baac3f6d968e5586c34\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "23254d0904f997d897a9fbc35da036e0090ca996",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/BUILD",
      "new_id": "a8f9b08aa31d819c95a24b6c62a2c6c280dcf3ae",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/BUILD"
    },
    {
      "type": "modify",
      "old_id": "b2b1a6c21fca1206fb18bbe186a7d7afe14741f0",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/app/mod.rs",
      "new_id": "b82bcf6c841ee3116e7fd33d94718714b7c64a37",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/app/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "a45bee1b237863dda5ab790021b04712dca8babc",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/io/gpio.rs",
      "new_id": "a3ab4eb6e61321bbb8d56f4fab1e2640945d2ff1",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/io/gpio.rs"
    },
    {
      "type": "modify",
      "old_id": "26cd00eecea34fcf12ff340abbc198d8bf7c064a",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/io/i2c.rs",
      "new_id": "909923005309fa6c43fd4c2b9692863beaacc98a",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/io/i2c.rs"
    },
    {
      "type": "modify",
      "old_id": "80ea329d54356e7184e5940c7297bb37150b4ecc",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/io/spi.rs",
      "new_id": "c8f0881f4030cac01136144a15db2529330dbaca",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/io/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "7728be087e06cd5f5d79f3279c61da8999007712",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/io/uart.rs",
      "new_id": "566cea3af2aaa441707e8134831fef8caa990034",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/io/uart.rs"
    },
    {
      "type": "modify",
      "old_id": "500880b21e0ca971a2772141c1cc6a0a8f09c119",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/spiflash/flash.rs",
      "new_id": "3ad18963d232c8c31194b1b2ef6db3bd6c32cfd4",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/spiflash/flash.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "af23e89a5288bd173fb5d27da0b49f8e6765a43c",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/common/mod.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "11e8b381005760001bbb4a1b55cca6e3359c7851",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/common/uart.rs"
    },
    {
      "type": "modify",
      "old_id": "86083a57d54163c71911d1e02acb5be1d68c3e69",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/gpio.rs",
      "new_id": "e3c1e146a0acbf8bc948de5f4cf5214f12a3583b",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/cw310/gpio.rs"
    },
    {
      "type": "modify",
      "old_id": "9e44d4b92cf6a6b0e0b8648c723fb745cbf7fa56",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/mod.rs",
      "new_id": "94683d2a8e756a31b16df71a40b91721d12f5909",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/cw310/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "c0913c75bf0919a683aba1050fac00d9c280f668",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/spi.rs",
      "new_id": "a48c4aaddeb9dfa610966e9f64236e4c9c3cfd5b",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/cw310/spi.rs"
    },
    {
      "type": "delete",
      "old_id": "1038e4ecffa298e06c1ead368c8a90833743c15a",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/uart.rs",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "88f1ab56a0c695a383dbdc2986c14c79baa10aac",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/cw310/usb.rs",
      "new_id": "3491ce5eed36cae236c27b5905f09f457a903437",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/cw310/usb.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "327389db050870a44896bf192549201e73b249f2",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/errors.rs"
    },
    {
      "type": "modify",
      "old_id": "cde8d1af04beedc0bddff866f23caf4554133da8",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/c2d2.rs",
      "new_id": "135d41ad146aa1ba6db84bc6e03d54d3e106f4bf",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/c2d2.rs"
    },
    {
      "type": "modify",
      "old_id": "30ef4c5aa9b35ce98a52e235cca7d80a89b24cb6",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/gpio.rs",
      "new_id": "3a67ab8d454cd714aae1c2d1dde2af4b6a2d852e",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/gpio.rs"
    },
    {
      "type": "modify",
      "old_id": "46104ed935fcc8d866cc69b0f391ae2b4a1950d3",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/i2c.rs",
      "new_id": "92eb4a1536442eb61bd740fccae467cd587b55d4",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/i2c.rs"
    },
    {
      "type": "modify",
      "old_id": "204c72e37761e773f4d85213d27498a9c6395434",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/mod.rs",
      "new_id": "8d1ffad1ec2b3f3279c16f39ad4f8701e0ddf38b",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "96d2df0002d85ef1a0b05c8ee673678cf95fd53c",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/spi.rs",
      "new_id": "5b962531073a0ba4872bbac1b507c83ed4685516",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/hyperdebug/spi.rs"
    },
    {
      "type": "delete",
      "old_id": "af4ebcd63911f9b953c37cfcaf5fd980bd4565e9",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/hyperdebug/uart.rs",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "4b3744e53222c7049951e1a81d0c5824f931c863",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/mod.rs",
      "new_id": "2afd2ec35a47de4b1b87605b426b316f0de49c84",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "1eefe83296307a98d43c534da1eaa37732efc56f",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/gpio.rs",
      "new_id": "167c5d38eaf49856aad0f69001c6f37709b391a2",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/gpio.rs"
    },
    {
      "type": "modify",
      "old_id": "181a6ac6f1815ca529c14be4ccdb9a94984bc719",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/mod.rs",
      "new_id": "95f139dca0ad809eed88d80e60c999d5fead5926",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/mod.rs"
    },
    {
      "type": "modify",
      "old_id": "324ded751f4687ca3ebd28007d7bd06bf5e722ac",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/mpsse.rs",
      "new_id": "4bfbd4749e51408a59b9857783cd643473f87877",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/mpsse.rs"
    },
    {
      "type": "modify",
      "old_id": "80b02c756772915f10f2235e1eefab34b5e3f0ea",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/spi.rs",
      "new_id": "28d564dce4447186d91a087fc9c19b0ab23c5e79",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/spi.rs"
    },
    {
      "type": "modify",
      "old_id": "7af655b2c438d10f4b02bb62ca1f5aa3b4df2ef3",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/ultradebug/uart.rs",
      "new_id": "0c5ff1fc789a5e5b2f02f3c85acd81a6eaadc2aa",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/ultradebug/uart.rs"
    },
    {
      "type": "modify",
      "old_id": "046501cefc50a6261f2e4b36d39a0b230df637fb",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/verilator/transport.rs",
      "new_id": "941707297e53ba25917e29f81cb2aa2b537b8544",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/verilator/transport.rs"
    },
    {
      "type": "modify",
      "old_id": "3759ca7bbd776f3886b4c5dcc95172e5beecf89c",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/transport/verilator/uart.rs",
      "new_id": "91c7d5052a8e18eb6a9ee9a3283fb1c5872ea160",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/transport/verilator/uart.rs"
    },
    {
      "type": "modify",
      "old_id": "f2cac8878c55de07f6b37b93ade7974bb4622b4a",
      "old_mode": 33188,
      "old_path": "sw/host/opentitanlib/src/util/usb.rs",
      "new_id": "5f6d06d3c452a6682601eb6aa5b7bfacbcb4fbc5",
      "new_mode": 33188,
      "new_path": "sw/host/opentitanlib/src/util/usb.rs"
    },
    {
      "type": "modify",
      "old_id": "aa552d5b2d0bb371dba2d7d495f8fe3f08c535b5",
      "old_mode": 33188,
      "old_path": "sw/host/opentitantool/src/command/bootstrap.rs",
      "new_id": "93872e6598bc7cbe9609efaad1797a93596f94b3",
      "new_mode": 33188,
      "new_path": "sw/host/opentitantool/src/command/bootstrap.rs"
    },
    {
      "type": "modify",
      "old_id": "51febe776209f2fb082ea4532c0a1e93c6d0a1ab",
      "old_mode": 33188,
      "old_path": "sw/host/opentitantool/src/command/console.rs",
      "new_id": "f978fdacd2a05da509414cf6053725fe11d2a223",
      "new_mode": 33188,
      "new_path": "sw/host/opentitantool/src/command/console.rs"
    },
    {
      "type": "modify",
      "old_id": "261545b531ee7398e9e5e6c8a50109b59ec8d353",
      "old_mode": 33188,
      "old_path": "sw/host/opentitantool/src/command/load_bitstream.rs",
      "new_id": "bbc917472d9b92d3da4b62b3db7f3644872ca37a",
      "new_mode": 33188,
      "new_path": "sw/host/opentitantool/src/command/load_bitstream.rs"
    }
  ]
}
