We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 218a2b3 commit 831faafCopy full SHA for 831faaf
libgit2-sys/build.rs
@@ -1,5 +1,6 @@
1
use std::env;
2
use std::fs;
3
+use std::io;
4
use std::path::{Path, PathBuf};
5
use std::process::Command;
6
@@ -199,8 +200,12 @@ fn cp_r(from: impl AsRef<Path>, to: impl AsRef<Path>) {
199
200
}
201
202
fn add_c_files(build: &mut cc::Build, path: impl AsRef<Path>) {
- for e in path.as_ref().read_dir().unwrap() {
203
- let e = e.unwrap();
+ // sort the C files to ensure a deterministic build for reproducible builds
204
+ let dir = path.as_ref().read_dir().unwrap();
205
+ let mut paths = dir.collect::<io::Result<Vec<_>>>().unwrap();
206
+ paths.sort_by_key(|e| e.path());
207
+
208
+ for e in paths {
209
let path = e.path();
210
if e.file_type().unwrap().is_dir() {
211
// skip dirs for now
0 commit comments