Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from tokio-rs:master #9

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2e64d6f
prost-build: prost_path helper (#1018)
mzabaluev Apr 8, 2024
963e942
Handle keyword `Self` after stripping enum type prefix (#998)
MixusMinimax Apr 9, 2024
04be604
Fix clippy warnings and enable clippy in CI (#1008)
gibbz00 Apr 9, 2024
95e2658
chore: Add Casper Meijn as author (#1025)
caspermeijn Apr 12, 2024
e3deaa2
build: Use git submodule to download protobuf sources (#1014)
caspermeijn Apr 12, 2024
eee2de0
chore: Fix clippy checks in CI (#1032)
caspermeijn Apr 19, 2024
30b22d3
prost-build: Split `Config` and `Module` into a separate module and f…
gibbz00 Apr 19, 2024
0381b93
chore - codegen: extract c string escaping to a separate file (#1028)
gibbz00 Apr 19, 2024
215ae16
chore: separate prost `Cargo.toml` workspace and crate declaration (#…
gibbz00 Apr 22, 2024
1fc736e
Remove GoogleMessage3 and GoogleMessage4 benchmarks (#1037)
caspermeijn Apr 23, 2024
a53ad51
prost_build: `BytesType and MapType` into a `collections` module. (#1…
gibbz00 Apr 26, 2024
6914543
ci: Add TOML validation with `taplo` (#1034)
gibbz00 Apr 26, 2024
95dcb0e
chore: Update crate descriptions (#1038)
caspermeijn Apr 28, 2024
a21d90c
chore: Update internal crates to Rust edition 2021 (#1039)
caspermeijn Apr 28, 2024
b607e9b
tests: Create a separate tempdir for each test (#1044)
caspermeijn Apr 28, 2024
ee96a04
fix: #1021 (#1022)
gibbz00 Apr 28, 2024
3f2536b
chore - codegen: `Syntax` to a separate file (#1029)
gibbz00 Apr 28, 2024
43753be
style: Fix toml indent (#1048)
caspermeijn Apr 29, 2024
680a2e1
style(prost-build): Consolidate field data into struct (#1017)
mzabaluev Apr 29, 2024
71b8e8e
tests: Remove unused dependencies (#1043)
caspermeijn May 3, 2024
2308ba4
fix the link and badge for CI (#1049)
mumbleskates May 5, 2024
1f38ea6
prost-build: `CodeGenerator::boxed` method (#1019)
mzabaluev May 5, 2024
baddf98
fix: include_file should handle proto without package (#1002)
MixusMinimax May 5, 2024
548739a
chore: Release version 0.12.5 (#1050)
caspermeijn May 8, 2024
26405ab
fix: Duplicate README to fix release (#1052)
caspermeijn May 8, 2024
4b11315
fix(prost-build): re-export `error_message_protoc_not_found`, `protoc…
eopb May 17, 2024
d43f7e0
chore: Release version 0.12.6 (#1065)
caspermeijn May 17, 2024
d42c85e
chore: fix prost release script (#1066)
LucioFranco May 17, 2024
85c698a
feat: derive Copy trait for messages where possible (#950)
caspermeijn May 20, 2024
bb5a1fa
Change generated functions signatures to remove type parameters (#1045)
shizzard May 20, 2024
b2ce9ed
fix: Build error due to merge conflict (#1068)
caspermeijn May 21, 2024
b925a4f
chore: Add ci to check MSRV (#1057)
caspermeijn May 22, 2024
993a6d1
ci: Add all tests pass job (#1069)
caspermeijn May 22, 2024
1ff42bf
ci: Add Dependabot (#957)
sjackman May 23, 2024
f8a0e01
build(deps): update env_logger requirement from 0.10 to 0.11 (#1074)
dependabot[bot] May 23, 2024
b9c4d3d
build(deps): update criterion requirement from 0.4 to 0.5 (#1071)
dependabot[bot] May 23, 2024
eec717b
better checking of tag duplicates, avoid discarding invalid variant e…
mumbleskates May 24, 2024
683091a
build: Fix release scripts (#1055)
caspermeijn May 24, 2024
4a7bba0
Lightweight error value in TryFrom<i32> for enums (#1010)
mzabaluev May 27, 2024
4cbf941
build(deps): Remove unused libz-sys (#1077)
caspermeijn May 27, 2024
52ff081
ci: Ensure both README are the same and prost version is correct (#1…
caspermeijn May 27, 2024
ef4930c
docs: Fix broken link warnings (#1056)
caspermeijn May 31, 2024
e7049d3
workspace package metadata (#1036)
gibbz00 May 31, 2024
ba77654
fix: Only touch include file if contents is changed (#1058)
caspermeijn Jun 10, 2024
ae33a5e
ci: Set rust version of clippy job to a fixed version (#1090)
caspermeijn Jun 25, 2024
4a0cc17
Add missing LICENSE symlink (#1086)
LecrisUT Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "build(deps)"
127 changes: 122 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,28 @@ on:

env:
PROTOC_VERSION: 3.20.3
clippy_rust_version: 1.78

jobs:
# Depends on all actions that are required for a "successful" CI run.
tests-pass:
name: all systems go
runs-on: ubuntu-latest
needs:
- rustfmt
- toml_validation
- clippy
- docs
- machete
- unused_dependencies
- test
- msrv
- minimal-versions
- kani
- no-std
- check-readme
steps:
- run: exit 0

rustfmt:
runs-on: ubuntu-latest
Expand All @@ -22,6 +42,55 @@ jobs:
components: rustfmt
- run: cargo fmt --all --check

toml_validation:
runs-on: ubuntu-latest
container:
image: tamasfe/taplo:0.8.1
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: taplo lint
run: taplo lint
- name: taplo fmt
run: taplo fmt --check --diff

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: ./.github/actions/setup-ninja
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.clippy_rust_version }}
components: clippy
- run: cargo clippy --workspace --exclude protobuf --all-features --tests -- -D warnings

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: ./.github/actions/setup-ninja
- uses: dtolnay/rust-toolchain@stable
- name: "doc --lib --all-features"
run: |
cargo doc --lib --no-deps --all-features --document-private-items
env:
RUSTDOCFLAGS: -Dwarnings

machete:
runs-on: ubuntu-latest
steps:
Expand All @@ -31,19 +100,40 @@ jobs:
- name: Check unused dependencies
run: cargo machete

unused_dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@nightly
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: ./.github/actions/setup-ninja
- name: install cargo-udeps
uses: taiki-e/install-action@cargo-udeps
- name: cargo udeps
run: cargo +nightly udeps
- name: cargo udeps all-targets
run: cargo +nightly udeps --all-targets

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain:
- stable
- "1.70"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install toolchain (${{ matrix.toolchain }})
uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -56,15 +146,30 @@ jobs:
uses: ./.github/actions/setup-ninja
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test --workspace --all-targets
run: cargo test --all-targets
- name: test no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --all-targets --no-default-features
# Run doc tests separately: https://github.com/rust-lang/cargo/issues/6669
- name: test doc
run: cargo test --workspace --doc
run: cargo test --doc
- name: test doc no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --doc --no-default-features

msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: check with no-default-features
run: cargo hack --rust-version --no-private --no-dev-deps check --no-default-features
- name: check with all-features
run: cargo hack --rust-version --no-private --no-dev-deps check --all-features

minimal-versions:
runs-on: ubuntu-latest
steps:
Expand All @@ -73,7 +178,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- run: cargo minimal-versions --no-private check --workspace --all-features
- run: cargo minimal-versions --no-private check --all-features

kani:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -110,7 +215,7 @@ jobs:
with:
crate: cargo-no-std-check
- name: prost cargo-no-std-check
run: cargo no-std-check --manifest-path Cargo.toml --no-default-features
run: cargo no-std-check --manifest-path prost/Cargo.toml --no-default-features
- name: prost-types cargo-no-std-check
run: cargo no-std-check --manifest-path prost-types/Cargo.toml --no-default-features
# prost-build depends on prost with --no-default-features, but when
Expand All @@ -120,3 +225,15 @@ jobs:
# prost's default features to compile.
- name: prost-build check
run: cargo check --manifest-path prost-build/Cargo.toml

check-readme:
name: Check README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify that both READMEs are identical
run: diff README.md prost/README.md

- name: Verify that Prost version is up to date in README
working-directory: prost
run: grep -q "$(sed '/^version = /!d' Cargo.toml | head -n1)" README.md
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf.git
56 changes: 14 additions & 42 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
[package]
name = "prost"
version = "0.12.4"
authors = [
"Dan Burkert <dan@danburkert.com>",
"Lucio Franco <luciofranco14@gmail.com",
"Tokio Contributors <team@tokio.rs>",
]
license = "Apache-2.0"
repository = "https://github.com/tokio-rs/prost"
documentation = "https://docs.rs/prost"
readme = "README.md"
description = "A Protocol Buffers implementation for the Rust Language."
keywords = ["protobuf", "serialization"]
categories = ["encoding"]
edition = "2021"
rust-version = "1.70"

[workspace]
members = [
"conformance",
"prost",
"prost-build",
"prost-derive",
"prost-types",
Expand All @@ -37,31 +20,20 @@ exclude = [
"afl",
]

[lib]
# https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
bench = false

[features]
default = ["derive", "std"]
derive = ["dep:prost-derive"]
prost-derive = ["derive"] # deprecated, please use derive feature instead
no-recursion-limit = []
std = []
resolver = "2"

[dependencies]
bytes = { version = "1", default-features = false }
prost-derive = { version = "0.12.4", path = "prost-derive", optional = true }

[dev-dependencies]
criterion = { version = "0.4", default-features = false }
env_logger = { version = "0.10", default-features = false }
log = "0.4"
proptest = "1"
rand = "0.8"
[workspace.package]
version = "0.12.6"
authors = [
"Dan Burkert <dan@danburkert.com>",
"Lucio Franco <luciofranco14@gmail.com>",
"Casper Meijn <casper@meijn.net>",
"Tokio Contributors <team@tokio.rs>",
]
license = "Apache-2.0"
repository = "https://github.com/tokio-rs/prost"
rust-version = "1.70"
edition = "2021"

[profile.bench]
debug = true

[[bench]]
name = "varint"
harness = false
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![continuous integration](https://github.com/tokio-rs/prost/workflows/continuous%20integration/badge.svg)
[![continuous integration](https://github.com/tokio-rs/prost/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/tokio-rs/prost/actions/workflows/ci.yml?query=branch%3Amaster)
[![Documentation](https://docs.rs/prost/badge.svg)](https://docs.rs/prost/)
[![Crate](https://img.shields.io/crates/v/prost.svg)](https://crates.io/crates/prost)
[![Dependency Status](https://deps.rs/repo/github/tokio-rs/prost/status.svg)](https://deps.rs/repo/github/tokio-rs/prost)
Expand Down Expand Up @@ -380,9 +380,9 @@ the `std` features in `prost` and `prost-types`:

```ignore
[dependencies]
prost = { version = "0.6", default-features = false, features = ["prost-derive"] }
prost = { version = "0.12.6", default-features = false, features = ["prost-derive"] }
# Only necessary if using Protobuf well-known types:
prost-types = { version = "0.6", default-features = false }
prost-types = { version = "0.12.6", default-features = false }
```

Additionally, configure `prost-build` to output `BTreeMap`s instead of `HashMap`s
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
too-many-arguments-threshold=8
too-many-arguments-threshold = 8
11 changes: 4 additions & 7 deletions conformance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
[package]
name = "conformance"
version = "0.0.0"
authors = [
"Dan Burkert <dan@danburkert.com>",
"Tokio Contributors <team@tokio.rs>",
]
publish = false
edition = "2018"
edition.workspace = true
authors.workspace = true

[dependencies]
bytes = "1"
env_logger = { version = "0.10", default-features = false }
prost = { path = ".." }
env_logger = { version = "0.11", default-features = false }
prost = { path = "../prost" }
protobuf = { path = "../protobuf" }
tests = { path = "../tests" }
2 changes: 1 addition & 1 deletion conformance/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tests::{roundtrip, RoundtripResult};

fn main() -> io::Result<()> {
env_logger::init();
let mut bytes = Vec::new();
let mut bytes = vec![0; 4];

loop {
bytes.resize(4, 0);
Expand Down
8 changes: 2 additions & 6 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
[package]
name = "fuzz"
version = "0.0.0"
authors = [
"Dan Burkert <dan@danburkert.com>",
"Tokio Contributors <team@tokio.rs>",
]
publish = false
edition = "2018"
edition.workspace = true
authors.workspace = true

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
protobuf = { path = "../protobuf" }
tests = { path = "../tests" }

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion fuzz/afl/proto3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "fuzz-target-proto3"
version = "0.1.0"
authors = ["Prost developers"]
edition = "2018"
edition = "2021"

[[bin]]
name = "fuzz-target"
Expand Down
10 changes: 5 additions & 5 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
VERSION="$1"
MINOR="$( echo ${VERSION} | cut -d\. -f1-2 )"

VERSION_MATCHER="([a-z0-9\\.-]+)"
PROST_CRATE_MATCHER="(prost|prost-[a-z]+)"

# Update the README.md.
sed -i -E "s/${PROST_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/README.md"
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/README.md"
sed -i -E "s/version = \"${VERSION_MATCHER}\"/version = \"${VERSION}\"/" "$DIR/prost/README.md"

# Update html_root_url attributes.
sed -i -E "s~html_root_url = \"https://docs\.rs/${PROST_CRATE_MATCHER}/$VERSION_MATCHER\"~html_root_url = \"https://docs.rs/\1/${VERSION}\"~" \
"$DIR/src/lib.rs" \
"$DIR/prost/src/lib.rs" \
"$DIR/prost-derive/src/lib.rs" \
"$DIR/prost-build/src/lib.rs" \
"$DIR/prost-types/src/lib.rs"

# Update Cargo.toml version fields.
sed -i -E "s/^version = \"${VERSION_MATCHER}\"$/version = \"${VERSION}\"/" \
"$DIR/Cargo.toml" \
"$DIR/prost/Cargo.toml" \
"$DIR/prost-derive/Cargo.toml" \
"$DIR/prost-build/Cargo.toml" \
"$DIR/prost-types/Cargo.toml"

# Update Cargo.toml dependency versions.
sed -i -E "s/^${PROST_CRATE_MATCHER} = \{ version = \"${VERSION_MATCHER}\"/\1 = { version = \"${VERSION}\"/" \
"$DIR/Cargo.toml" \
"$DIR/prost/Cargo.toml" \
"$DIR/prost-derive/Cargo.toml" \
"$DIR/prost-build/Cargo.toml" \
"$DIR/prost-types/Cargo.toml"
Expand Down
Loading