From a84730198d8e2a3719290cbb5fba1421514d83a2 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 11 Dec 2019 15:26:27 +0000 Subject: [PATCH 1/3] readme: Add note about Cargo dependencies --- HACKING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HACKING.md b/HACKING.md index 126cd270..8309ea0e 100644 --- a/HACKING.md +++ b/HACKING.md @@ -117,6 +117,8 @@ sh /source_path/cargo.sh test ### Cargo dependencies +All Cargo dependencies must be selected in the version available in PureOS, and added to the file `debian/control`. Please check with https://software.pureos.net/search_pkg?term=librust . + Dependencies must be specified in `Cargo.toml` with 2 numbers: "major.minor". Since bugfix version number is meant to not affect the interface, this allows for safe updates. `Cargo.lock` is used for remembering the revisions of all Rust dependencies. It should be updated often, preferably with each bugfix revision, and in a commit on its own: From 7641b4da6fe3762bbb9a7c23e0c398a3afbdad1a Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 11 Dec 2019 15:33:29 +0000 Subject: [PATCH 2/3] Create a library/UI module separation --- HACKING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/HACKING.md b/HACKING.md index 8309ea0e..890bb64e 100644 --- a/HACKING.md +++ b/HACKING.md @@ -57,6 +57,24 @@ $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', Coding ------ +### Project structure + +Rust modules should be split into 2 categories: libraries, and user interface. They differ in the way they do error handling. + +Libraries should: + +- not panic due to external surprises, only due to internal inconsistencies +- pass errors and surprises they can't handle to the callers instead +- not silence errors and surprises + +User interface modules should: + +- try to provide safe values whenever they encounter an error +- do the logging +- give libraries the ability to report errors and surprises (e.g. via giving them loggers) + +### Style + Code submitted should roughly match the style of surrounding code. Things that will *not* be accepted are ones that often lead to errors: - skipping brackets `{}` after every `if()`, `else`, and similar From d5c8f320888a09d2b35d224f1612c6ad2ffee072 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 11 Dec 2019 15:50:28 +0000 Subject: [PATCH 3/3] Fix internal .md link --- HACKING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HACKING.md b/HACKING.md index 890bb64e..55d0d40d 100644 --- a/HACKING.md +++ b/HACKING.md @@ -20,7 +20,7 @@ sudo apt-get -y build-dep . ``` For an explicit list of dependencies check the `Build-Depends` entry in the -[debian/control][] file. +[`debian/control`](./debian/control) file. Testing -------