|
@@ -2228,12 +2228,18 @@ bool CommandLineInterface::WriteDescriptorSet(
|
|
}
|
|
}
|
|
|
|
|
|
io::FileOutputStream out(fd);
|
|
io::FileOutputStream out(fd);
|
|
- if (!file_set.SerializeToZeroCopyStream(&out)) {
|
|
|
|
|
|
+
|
|
|
|
+ io::CodedOutputStream coded_out(&out);
|
|
|
|
+ // Determinism is useful here because build outputs are sometimes checked
|
|
|
|
+ // into version control.
|
|
|
|
+ coded_out.SetSerializationDeterministic(true);
|
|
|
|
+ if (!file_set.SerializeToCodedStream(&coded_out)) {
|
|
std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno())
|
|
std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno())
|
|
<< std::endl;
|
|
<< std::endl;
|
|
out.Close();
|
|
out.Close();
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ coded_out.Trim();
|
|
if (!out.Close()) {
|
|
if (!out.Close()) {
|
|
std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno())
|
|
std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno())
|
|
<< std::endl;
|
|
<< std::endl;
|