Skip to content

Commit

Permalink
Remove vendored-protoc from the default feature set.
Browse files Browse the repository at this point in the history
This implies the use of a preinstalled protobuf compiler, instead of attempting to build the
protobuf-src crate, which causes many build failures on less common platforms.
  • Loading branch information
emarsden committed Jul 28, 2024
1 parent cda144c commit 5b0a1c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.1.9] - 2024-07-28

- Change the default configuration to use a preinstalled protobuf compiler, instead of attempting to
build the `protobuf-src` crate, which causes many headaches on less common platforms. This means
that the `vendored-protoc` feature is no longer included in the default features.


## [0.1.8] - 2024-07-26

- New method `contains()` on `PsshBoxVec`.
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pssh-box"
description = "Parsing and serialization support for PSSH boxes used in DRM systems"
version = "0.1.8"
version = "0.1.9"
authors = ["Eric Marsden <eric.marsden@risk-engineering.org>"]
readme = "README.md"
repository = "https://github.com/emarsden/pssh-box-rs/"
Expand All @@ -27,7 +27,7 @@ byteorder = "1.5.0"
hex = "0.4.3"
hex-literal = "0.4.1"
hxdmp = "0.2.1"
bstr = "1.9.1"
bstr = "1.10.0"
num_enum = "0.7.2"
base64 = "0.22.1"
tracing = { version = "0.1.40", features = ["attributes"] }
Expand All @@ -36,13 +36,12 @@ anyhow = "1.0.86"
[dev-dependencies]
clap = { version = "=4.3.24", features = ["cargo", "unicode", "wrap_help"] }
reqwest = { version = "0.12.5", features = ["blocking"] }
tokio = { version = "1.39.1", features = ["rt-multi-thread", "time", "macros"] }
tokio = { version = "1.39.2", features = ["rt-multi-thread", "time", "macros"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] }
test-log = { version = "0.2.16", features = ["trace"] }
pretty_assertions = "1.4.0"

[features]
default = ["vendored-protoc"]
vendored-protoc = ["dep:protobuf-src"]

[build-dependencies]
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ if let PsshData::Widevine(ref pd) = pssh.pssh_data {
## Build

The protoc compiler is used during the build process to translate the protobuf interface definition
for Widevine PSSH data into Rust structs. This happens in the `build.rs` file.

The default configuration of this crate depends on the `protobuf-src` crate to build a vendored
version of the protoc compiler. This requires a working C++ compiler and autoconf support. To build
on Windows, the simplest solution seems to be the UCRT64 environment of
[MSYS2](https://www.msys2.org/); see our GitHub continuous integration workflow for one recipe that
works. Disable the default feature `vendored-protoc` to use a locally installed protoc compiler
instead (from Debian package `protobuf-compiler`, for example).
for Widevine PSSH data into Rust structs. This happens in the `build.rs` file. The default
configuration uses a **prebuilt protobuf compiler**, which must be locally installed (from Debian
package `protobuf-compiler`, for example).

As an alternative if the `vendored-protoc` feature is enabled, the `protobuf-src` crate is used to
build a vendored version of the protoc compiler. This requires a working C++ compiler and cmake
support, and tends to be rather unreliable (in particular, the abseil-cpp component of protobuf
often causes build failures on any mildly unusual platform). To build on Windows, the simplest
solution seems to be the UCRT64 environment of [MSYS2](https://www.msys2.org/); see our GitHub
continuous integration workflow for one recipe that works.


## License
Expand Down

0 comments on commit 5b0a1c7

Please sign in to comment.