Skip to content

Commit

Permalink
prost-build: fix compilation error when using --no-default-features
Browse files Browse the repository at this point in the history
  • Loading branch information
danburkert committed May 11, 2020
1 parent 2e04c72 commit 8025627
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/continuous-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ jobs:
with:
command: no-std-check
args: --manifest-path prost-types/Cargo.toml --no-default-features
# prost-build depends on prost with --no-default-features, but when
# prost-build is built through the workspace, prost typically has default
# features enabled due to vagaries in Cargo workspace feature resolution.
# This additional check ensures that prost-build does not rely on any of
# prost's default features to compile.
- name: prost-build check
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path prost-build/Cargo.toml
7 changes: 6 additions & 1 deletion prost-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,12 @@ impl Config {
}

let buf = fs::read(descriptor_set)?;
let descriptor_set = FileDescriptorSet::decode(&*buf)?;
let descriptor_set = FileDescriptorSet::decode(&*buf).map_err(|error| {
Error::new(
ErrorKind::InvalidInput,
format!("invalid FileDescriptorSet: {}", error.to_string()),
)
})?;

let modules = self.generate(descriptor_set.file)?;
for (module, content) in modules {
Expand Down

0 comments on commit 8025627

Please sign in to comment.