Repository navigation
rutis v0.18.0
rutis 0.18.0
The theme of 0.18.0 is "errors you can understand" (#694, diagnostics design): an error says which row, what it was doing and which file and line, without rutis's internal names; a running host can be asked what it is doing; configuration is checked against its Schema and gets its defaults. This release has breaking changes: read migrating to 0.18 before upgrading.
Upgrade in this order: run rutis-host check with 0.17.2 first, since the warnings it gives are errors in 0.18; after upgrading, run rutis-host check with 0.18, which lists every row whose configuration does not pass.
Breaking changes
Each item says what to change; details and examples are in migrating to 0.18.
- Error texts change; decide by error code instead (#677, #711, #737). Error type names stay the same (
BindingError,AggregateError,SyncWaitCycleand so on); the text only uses what the developer wrote: row names, service names, method names, which argument, files and lines. rutis's ownBindingErrors carry a code:not-declared,unavailable,no-method,bad-argument,bad-value,peer-gone,bad-config, with details indata.- To change: code that matches error texts reads the code instead (
error.codein JavaScript and Python,Codeof*rutis.RemoteErrorin Go,codein Swift and Kotlin,session::Error::code()in Rust); scripts that parse the errorsrutis-hostprints follow the new format. - Node, Bun: on an error received from another language,
error.stackis the caller's own stack; rutis prints the far end's stack. - Python: an error while importing a plugin module raises the new
LoadError;str(SyncWaitCycle)is just the message. - Kotlin: a service not in
inject, a service not there and the host gone raise the newNotDeclaredException,UnavailableExceptionandHostGoneException. They are subclasses of the types raised before, so code catching those still works.
- To change: code that matches error texts reads the code instead (
- Rust hosts read plugin errors differently (#677). A plugin's error is no longer a string: read its structure with
rutis_bridge::thrown(&error)and print it withrutis_bridge::report::report(&error).rutis_bridge::session::Errorhas a new variantBinding { code, message, data }; code that matches every variant adds it.ErrorKind::PluginFailedis displayed without theplugin failed:prefix. - Rust embedding writes errors to standard error by default (#678, #741). A plugin start failure nobody waited for, or a runtime process ending, used to be only in return values nobody read; now the default error sink writes them, each line starting with the plugin, row or runtime name instead of
[rutis]. NewErrorKind::StartFailed,RuntimeDown,NotServedByName;DisposeWaitError::TimedOuthas a new fieldstuck.- To change: replace the sink if you do not want this output; scripts matching
[rutis]on standard error change; code destructuringTimedOutwith every field listed adds...
- To change: replace the sink if you do not want this output; scripts matching
- Rust embedding:
reconcileno longer waits for a runtime still starting (#743). When one runtime is stuck, the other rows start as usual and its rows wait for it. To get the full report as before, await the runtimes'ready()before callingreconcile. rutis-hostwrites status lines to standard error, and underdeveach plugin line carries its row name (#746).weather: running,runtime py: down (…),rutis-host: listening on …and the like used to go to standard output. Underdev, plugin output starts with[weather].- To change: scripts reading status lines from standard output read standard error; scripts comparing whole plugin lines add
--no-prefix-outputunderdev.runhas no prefix by default;--prefix-outputturns it on.
- To change: scripts reading status lines from standard output read standard error; scripts comparing whole plugin lines add
rutis-host check: dependency cycles and services provided twice are errors (#676, #725). In 0.17.2 they were warnings; nowcheckexits with 1.- To change: for rows that
injecteach other, drop the service one does not need, or move the shared part into a third row; for rows providing one service, keep one, or separate them withisolate.
- To change: for rows that
- Two entries accepting one token are an error at start (#702, #726, #724, #756). When any two entries on one listener, or two listening link rows on different listeners (disabled rows included), would accept the same token,
run,checkand reloading the configuration fail before starting. In 0.17 such a configuration already left one side unable to connect.- To change: as the message says, give one of them its own
RUTIS_TOKEN_<name>, and have the other end present that new token.
- To change: as the message says, give one of them its own
- An unhandled error counts only against the row that made it (#688, #729). An unhandled promise rejection in a Node or Bun plugin no longer ends the runtime process: when its source can be traced, that row fails; when not, one line says
an unhandled error from an unknown row. An exception nobody retrieved from a Python task used to be only logged; now it fails the row.- To change: in Python, handle or retrieve the exceptions of tasks you start; Node and Bun projects that recovered by letting the runtime exit and the host restart it handle the error in the plugin instead, and call
process.exitexplicitly when the process really should end.
- To change: in Python, handle or retrieve the exceptions of tasks you start; Node and Bun projects that recovered by letting the runtime exit and the host restart it handle the error in the plugin instead, and call
- Objects with methods go to every language (#687, #738, #751, #753, design). They used to go only to Rust, and the call failed for other languages; now they go by reference: the receiver gets a proxy whose methods call the original object.
- To change: code that passed data after the call failed no longer reaches its
catch; if the receiver wants data, pass data. Both ends must be on 0.18: runtimes before 0.18 take no objects, and such a call fails withbad-value, saying to upgrade. - In Go, Swift and Kotlin, a parameter of a data type that receives an object fails with
bad-argument. In Kotlin, a parameter of typeAny?may receive the newRemoteObject. Swift code implementingRutisProxyby hand addsrutisClient. undefinedinside arrays, objects and other values is alwaysnull(Nonein Python). Before,undefinedin an array passed as an argument was kept.
- To change: code that passed data after the call failed no longer reaches its
- Configuration is checked against its Schema and gets its defaults (#669, design; #727, #740, #742, #747, #748, #750). The plugin API guide always said the host checks configuration against the Schema; this release makes it true. Rust rows, Node, Bun, Python, Swift and Kotlin fill in the Schema's defaults before
apply; when the configuration does not pass, the row fails with the codebad-config, and the host printsweather: config: city should be a string, got 42, one line per problem. Extra keys are only a warning, and an error undercheck --strict.- To change: configuration that ran despite mistakes (wrong types, missing
requiredfields, extra keys underadditionalProperties: false) now fails the row, in the test tools too; fix the configuration or the Schema by whatrutis-host checkprints. Code that tests whether a key is in the configuration now sees the defaults. - Node, Bun:
definePluginthrows at once whenconfigis a Standard Schema object (such a Schema never took effect). - Swift: a
varfield with a literal initial value is no longer required; when missing, it takes the initial value. - Rust: loader rows' configuration errors read
config: …instead ofconfig validation failed: [...]. - Go fills in defaults and checks before decoding, and generated Schemas no longer have
required(#752). - Configuration docs, the Python and Go guides, the configuration section of migrating to 0.18, templates keeping defaults only in the Schema (#754).
- To change: configuration that ran despite mistakes (wrong types, missing
New features
rutis-host status(#678, #739): from another terminal, ask a runningrunordevwhat it is doing: each row's state and reason, who provides each service, the runtimes, calls not yet returned and how long they have waited. It answers while start-up is stuck too. Not available on Windows. Rust embedders get the same snapshot fromLoader::status().- Errors say where (#677): a failure printed by
runordevfirst says in which step it failed, then the row, the file and line from the plugin's language, and across languages the caller's location. Stacks sent across processes have only the plugin's own frames. rutis-host dev --debug(#679, #728): Python stops atbreakpoint()(pdb), Node and Bun open an inspector port, Go runs under Delve;devfirst prints how to attach. Each language's guide has a new "Debugging" section. Swift is not supported yet.- A hint when a call blocks (#746): when a Node, Bun or Python service method holds the runtime synchronously for 5 seconds, the runtime prints once which row and method, and suggests making it asynchronous. It only prints; the method is not interrupted.
- Rust embedding you can read (#741):
root.diagnostics()prints directly (one item per line, by name); whenshutdown_with_timeoutruns out, it names the plugins not finished and the file and line where the stuck cleanup was registered. - One runtime not ready no longer holds up other runtimes' rows (#743): for example, while one runtime sits under a debugger without greeting, rows of the other runtimes start as usual.
- Readable compile errors for mistakes in Rust plugins (#677): an argument that cannot cross languages, an error type without
Display, a service type that is notSend + Syncand the like say on the first line what is wrong and how to fix it. rutis-host checkchecks each row's configuration (#727): it gives the path and the reason and exits with 1 when a configuration does not pass; rows whose Schema is known only when they run sayconfig not checked.- Developer-experience checks in the release gate (#690, #744, #758): writing a plugin in each language, assembling plugins, and the host owner's scenario, plus acceptance tests of 14 faults in each language, run in the release gate and nightly; nothing is released unless they pass (fault acceptance table).
Fixes
- Waiting for a runtime's state no longer misses a change between looking and starting to wait (#759). Under load, a runtime that became ready in that gap was taken as failing to start;
rutis-host's restart supervision drops its workaround of looking again every 500 ms. - A runtime connection that dials in and drops while its rows are loading now ends its instance at once (#779). It used to take the full 30 seconds.
- Security updates of dependencies (#755): rustls 0.23.46, rustls-webpki 0.103.16, webpki-roots 1.0.11, tokio 1.54.1. They affect the
rutis-hostbinaries this repository builds (including the ones in npm and PyPI); projects using the crates as libraries take versions from their own lock files. - When objects with methods are forwarded between sessions, the numbers in the call chain are rebased to the receiving session's (#760). Before, a future the host created while handling one session's call and sent to another, or a session awaiting a future that then called another session's object, sent the numbers unchanged and the other side took them as its own calls.
- Kotlin's
HostGoneExceptionmoved to the publicarcships.rutis, next toNotDeclaredExceptionandUnavailableException(#761). It used to live in the internal packagearcships.rutis.internal.peer; code importing it from there imports it fromarcships.rutisinstead.
Compatibility
- The formats of
rutis.jsonandrutis.dev.jsonare unchanged. Configuration contents may no longer pass because of the Schema check; see "Configuration is checked against its Schema" above. - The protocol adds the capability
objects(objects with methods), used only when both ends declare it; error nodes gain two optional fields,siteandrethrown, which older ends ignore. The protocol version is unchanged: 0.18.0 and 0.17.2 connect as usual, but objects cannot be passed to the older end. - A 0.17.2 host does not know that 0.18 runtimes take objects: objects passed between runtimes under it still fail with 0.17.2's text; upgrade the host.
- Dylib plugins are rebuilt with the 0.18 SDK, as at every release.
- Error type names are unchanged;
rutis::Erroris still thrown asCordisErrorin other languages.
Packages
All of these are version 0.18.0: on crates.io rutis, rutis-macros, rutis-bridge, rutis-loader, rutis-host, rutis-sdk, rutis-dylib, rutis-dylib-meta, rutis-dylib-launcher, rutis-migrate; on npm @arcships/rutis, @arcships/rutis-runtime, @arcships/rutis-bun, @arcships/rutis-host and the five platform packages; on PyPI rutis, rutis-host; the Go module github.com/arcships/rutis/go/rutis (tag go/rutis/v0.18.0); the Swift package (v0.18.0); Kotlin io.github.arcships:rutis and io.github.arcships:rutis-ksp; the rutis-host binaries on the GitHub release page.