Loading pkgs/development/libraries/libphonenumber/build-reproducibility.patch 0 → 100644 +24 −0 Original line number Diff line number Diff line diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc index 205947e831..1e628e2cd2 100644 --- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc +++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc @@ -97,7 +97,8 @@ class DirEntry { DirEntryKinds kind_; }; -// Lists directory entries in path. "." and ".." are excluded. Returns true on +// Lists directory entries in path. "." and ".." are excluded. Entries are +// returned in a consistent order to ensure reproducibility. Returns true on // success. bool ListDirectory(const string& path, vector<DirEntry>* entries) { entries->clear(); @@ -135,6 +136,9 @@ bool ListDirectory(const string& path, vector<DirEntry>* entries) { } entries->push_back(DirEntry(entry->d_name, kind)); } + std::sort( + entries->begin(), entries->end(), + [](const DirEntry& a, const DirEntry& b) { return a.name() < b.name(); }); } // Returns true if s ends with suffix. pkgs/development/libraries/libphonenumber/default.nix +5 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0="; }; patches = [ # Submitted upstream: https://github.com/google/libphonenumber/pull/2921 ./build-reproducibility.patch ]; nativeBuildInputs = [ cmake pkg-config Loading Loading
pkgs/development/libraries/libphonenumber/build-reproducibility.patch 0 → 100644 +24 −0 Original line number Diff line number Diff line diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc index 205947e831..1e628e2cd2 100644 --- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc +++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc @@ -97,7 +97,8 @@ class DirEntry { DirEntryKinds kind_; }; -// Lists directory entries in path. "." and ".." are excluded. Returns true on +// Lists directory entries in path. "." and ".." are excluded. Entries are +// returned in a consistent order to ensure reproducibility. Returns true on // success. bool ListDirectory(const string& path, vector<DirEntry>* entries) { entries->clear(); @@ -135,6 +136,9 @@ bool ListDirectory(const string& path, vector<DirEntry>* entries) { } entries->push_back(DirEntry(entry->d_name, kind)); } + std::sort( + entries->begin(), entries->end(), + [](const DirEntry& a, const DirEntry& b) { return a.name() < b.name(); }); } // Returns true if s ends with suffix.
pkgs/development/libraries/libphonenumber/default.nix +5 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0="; }; patches = [ # Submitted upstream: https://github.com/google/libphonenumber/pull/2921 ./build-reproducibility.patch ]; nativeBuildInputs = [ cmake pkg-config Loading