Skip to content

Commit

Permalink
Release v0.6.0 (#2)
Browse files Browse the repository at this point in the history
* Add disclaimer to README

* Bump version to 0.6.0

* Add changelog

* Add `no_std` compatibility test (#4)

* Add `no_std` compatibility test

* fix: enable prost-derive feature for prost

---------

Co-authored-by: Farhad Shabani <[email protected]>
  • Loading branch information
romac and Farhad-Shabani authored Jul 28, 2023
1 parent a8b9f59 commit 9c18a04
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ jobs:
with:
command: nextest
args: run --all-features --no-fail-fast --no-capture
- name: Run tests (no-std)
- name: Run tests (no_std)
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --no-default-features --no-fail-fast --no-capture
- name: Check no_std compatibility
uses: actions-rs/cargo@v1
with:
command: rustc
args: --manifest-path pbjson-no-std/Cargo.toml -- -C link-arg=-nostartfiles
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/pbjson-no-std/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

## v0.6.0

## Breaking changes

- The crates have been prefixed with `informalsystems-`, but the library names have been kept the same, for drop-in compatibility with former versions.

| Former crate | New crate | Library name |
|-----------------|---------------------------------|-----------------|
| `pbjson` | `informalsystems-pbjson` | `pbjson` |
| `pbjson-types` | `informalsystems-pbjson-types` | `pbjson_types` |
| `pbjson-build` | `informalsystems-pbjson-build` | `pbjson_build` |
| `pbjson-test` | `informalsystems-pbjson-test` | `pbjson_test` |

## Features

- Add `no_std` support to the generated code ([#1](https://github.com/informalsystems/pbjson/pull/1))
The `informal-pbjson-types` crate now has an `std` feature which is enabled by default.
To enable `no_std` compatibility, disable the default features on that crate.

## Previous versions

There was no changelog for versions prior to 0.6.0.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ members = [
"pbjson-test",
"pbjson-types",
]

exclude = [
"pbjson-no-std"
]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Pbjson

> This is a fork of [`influxdata/pbjson`](https://github.com/influxdata/pbjson) maintained by Informal Systems.
Pbjson is a set of crates to automatically generate [serde](https://serde.rs/) [Serialize](https://docs.rs/serde/1.0.130/serde/trait.Serialize.html) and [Deserialize](https://docs.rs/serde/1.0.130/serde/trait.Deserialize.html) implementations for auto-generated prost types.

See [pbjson-build](https://docs.rs/pbjson-build) for usage instructions
2 changes: 1 addition & 1 deletion pbjson-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "informalsystems-pbjson-build"
version = "0.5.1"
version = "0.6.0"
authors = ["Raphael Taylor-Davies <[email protected]>"]
edition = "2021"
description = "Generates Serialize and Deserialize implementations for prost message types"
Expand Down
17 changes: 17 additions & 0 deletions pbjson-no-std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "pbjson-no-std"
version = "0.1.0"
edition = "2021"
publish = false
description = "A library for testing no_std compatibility of pbjson"

[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"

[dependencies]
informalsystems-pbjson = { path = "../pbjson", default-features = false }
informalsystems-pbjson-types = { path = "../pbjson-types", default-features = false }

19 changes: 19 additions & 0 deletions pbjson-no-std/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#![no_std]

use core::panic::PanicInfo;

/// This function is called on panic.
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}

#[no_mangle]
pub extern "C" fn _start() -> ! {
loop {}
}

#[allow(unused_imports)]
use pbjson;
#[allow(unused_imports)]
use pbjson_types;
4 changes: 2 additions & 2 deletions pbjson-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "informalsystems-pbjson-test"
version = "0.5.1"
version = "0.6.0"
authors = ["Raphael Taylor-Davies <[email protected]>"]
edition = "2021"
description = "Test resources for pbjson converion"
Expand All @@ -11,7 +11,7 @@ publish = false
name = "pbjson_test"

[dependencies]
prost = { version = "0.11", default-features = false}
prost = { version = "0.11", default-features = false, features = ["prost-derive"] }
informalsystems-pbjson = { path = "../pbjson" , default-features = false}
informalsystems-pbjson-types = { path = "../pbjson-types" , default-features = false}
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
Expand Down
17 changes: 9 additions & 8 deletions pbjson-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "informalsystems-pbjson-types"
version = "0.5.1"
version = "0.6.0"
authors = ["Raphael Taylor-Davies <[email protected]>"]
description = "Protobuf well known types with serde serialization support"
edition = "2021"
Expand All @@ -15,18 +15,19 @@ name = "pbjson_types"

[features]
default = ["std"]
std = ["chrono/std", "informalsystems-pbjson/std", "prost/std", "serde/std"]
std = ["bytes/std", "chrono/std", "informalsystems-pbjson/std", "prost/std", "serde/std", "serde_json/std"]

[dependencies] # In alphabetical order
bytes = "1.0"
informalsystems-pbjson = { path = "../pbjson", version = "0.6.0" , default-features = false }

bytes = { version = "1.0", default-features = false }
chrono = { version = "0.4", default-features = false, features = ["alloc"] }
informalsystems-pbjson = { path = "../pbjson", version = "0.5" , default-features = false }
prost = { version = "0.11", default-features = false }
prost = { version = "0.11", default-features = false, features = ["prost-derive"] }
serde = { version = "1.0", features = ["derive"], default-features = false }

[dev-dependencies]
serde_json = "1.0"
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }

[build-dependencies] # In alphabetical order
[build-dependencies]
informalsystems-pbjson-build = { path = "../pbjson-build", version = "0.6.0" }
prost-build = "0.11"
informalsystems-pbjson-build = { path = "../pbjson-build", version = "0.5" }
2 changes: 1 addition & 1 deletion pbjson/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "informalsystems-pbjson"
version = "0.5.1"
version = "0.6.0"
authors = ["Raphael Taylor-Davies <[email protected]>"]
edition = "2021"
description = "Utilities for pbjson conversion"
Expand Down

0 comments on commit 9c18a04

Please sign in to comment.