Your message dated Tue, 28 Jun 2016 18:48:53 +0000
with message-id <[email protected]>
and subject line Bug#824263: fixed in cmake 3.5.2-2
has caused the Debian Bug report #824263,
regarding cmake: please sort file lists from file(GLOB ...)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
824263: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824263
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: cmake
Version: 3.5.2-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: toolchain fileordering
X-Debbugs-Cc: [email protected]
Forwarded: 
http://public.kitware.com/pipermail/cmake-developers/2016-May/028392.html

Hi!

Packages using CMake often use file(GLOB ...) to retrieve a list of
source files [1]. As this is based on readdir(), the resulting file list
is unsorted. A common use case is to pass this list directly to
add_executable or add_library. But as the order is unpredictable, the
binaries are not reproducible (because the order in which the objects
are linked will vary).

The attached patch (already sent upstream) will sort the resulting lists
from file(GLOB ...) and help with building reproducible packages.

Regards,
 Reiner

[1]: 
https://codesearch.debian.net/perpackage-results/path%3ACMakeLists.txt%20(file%7CFILE).*(glob%7CGLOB).*(SRC%7CSOURCE%7COBJ)/2/page_0
diff --git a/debian/patches/series b/debian/patches/series
index e9e2070..af9c632 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 FindBoost_add_-lpthread_#563479.diff
 qt_import_dir_variable.diff
 fix-ftbfs-on-kfreebsd.patch
+sort_file_globs.patch
diff --git a/debian/patches/sort_file_globs.patch b/debian/patches/sort_file_globs.patch
new file mode 100644
index 0000000..1bf5155
--- /dev/null
+++ b/debian/patches/sort_file_globs.patch
@@ -0,0 +1,29 @@
+Author: Reiner Herrmann <[email protected]>
+Description: sort the result of file(GLOB ...) command
+ Many packages pass the file list directly to add_executable / add_library,
+ which will produce an unreproducible binary, as the sources/objects are
+ linked in unpredictable readdir() order.
+Forwarded: http://public.kitware.com/pipermail/cmake-developers/2016-May/028392.html
+
+--- a/Source/cmFileCommand.cxx
++++ b/Source/cmFileCommand.cxx
+@@ -1028,6 +1028,7 @@
+ 
+     std::vector<std::string>::size_type cc;
+     std::vector<std::string>& files = g.GetFiles();
++    std::sort(files.begin(), files.end());
+     for ( cc = 0; cc < files.size(); cc ++ )
+       {
+       if ( !first )
+--- a/Help/command/file.rst
++++ b/Help/command/file.rst
+@@ -103,8 +103,7 @@
+ store it into the ``<variable>``.  Globbing expressions are similar to
+ regular expressions, but much simpler.  If ``RELATIVE`` flag is
+ specified, the results will be returned as relative paths to the given
+-path.  No specific order of results is defined.  If order is important then
+-sort the list explicitly (e.g. using the :command:`list(SORT)` command).
++path.  The file list will be sorted.
+ 
+ By default ``GLOB`` lists directories - directories are omited in result if
+ ``LIST_DIRECTORIES`` is set to false.

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: cmake
Source-Version: 3.5.2-2

We believe that the bug you reported is fixed in the latest version of
cmake, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Felix Geyer <[email protected]> (supplier of updated cmake package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 28 Jun 2016 19:39:56 +0200
Source: cmake
Binary: cmake cmake-data cmake-curses-gui cmake-qt-gui cmake-doc
Architecture: source
Version: 3.5.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian CMake Team <[email protected]>
Changed-By: Felix Geyer <[email protected]>
Description:
 cmake      - cross-platform, open-source make system
 cmake-curses-gui - curses based user interface for CMake (ccmake)
 cmake-data - CMake data files (modules, templates and documentation)
 cmake-doc  - extended documentation in various formats for CMake
 cmake-qt-gui - Qt4 based user interface for CMake (cmake-gui)
Closes: 824263 828092
Changes:
 cmake (3.5.2-2) unstable; urgency=medium
 .
   * Make FindLibArchive compatible with libarchive 3.2. (Closes: #828092)
     - Add FindLibArchive_Support_libarchive_3.2.patch
   * Backport patch to make file(GLOB) order deterministic. (Closes: #824263)
     - Add file_Sort_GLOB_results_to_make_it_deterministic.patch
Checksums-Sha1:
 596eaeb921c31a9e6a9efaccb430f18f2e63c926 2431 cmake_3.5.2-2.dsc
 f33eae751f333c611b46c5e438644c1c8314df67 28872 cmake_3.5.2-2.debian.tar.xz
Checksums-Sha256:
 b3f70750e352d8e1d8e4617e3c401f2ade379d70ba54572a97b71d1a90b6ceb7 2431 
cmake_3.5.2-2.dsc
 4394f6b3c5f1d4403c277f231dbf6f12419671e683f2dbce2fcaad93abf9aa0e 28872 
cmake_3.5.2-2.debian.tar.xz
Files:
 671552878e776bb3334ca37794d0fb9f 2431 devel optional cmake_3.5.2-2.dsc
 d727ebb23ae7cd6784dabe41ce7a868a 28872 devel optional 
cmake_3.5.2-2.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXcsKZAAoJEP4ixv2DE11FRT0P/3Fw/AqBp0NDFnIsKDT/24my
5+ovfAYWfojM7Wmu5W3Iqwt5i3r01fmAAF4lzGFdnoG0RvedAoOKDTi1c0oEjJ55
7x8JyA2i6jXb//pAvn7URutevKdkg0IOn99PWnz2C0Y7orihdc1D8Zd3LWg5aNU8
+7QEewFmiobSAUMZd0LQL9f1SaAzuqUiiZwrU5MVnW3jI+wnP74evBJsGd+JwmP0
e07vS5MYsGwbxVOReZTevAKiQnVRbd5FFcrfjgqlrjsEIS/D/i3A7EJ5E8b5qOBv
alMyuB3iMxs0wgVc7nfkBRDRN21tDabhj3kzhNh6WHGsY+79OmfJ8e4cVHL9+1wz
0ujU4mwBSQjEeHGqta0CAJLzlA1D4ncT3wpjDgqssW+xeh/hqLv5y5FYMZXmd56A
LZVmFV+K7dIrrUZAjlvmvwgWb9tiMnzc3DF8qFgjvsmB+9w3T0mF+eytNC3cbcsL
bmd9iVT9BgRcyXHI+6KVi/IxsRzZTLQXv2ntRtHjwHe+JNDFMDlLMRF9C2EK8+Yy
xyv2eQ1UcOWaLEsJH2YZGdefDgN+4doQLIiH0fEm9YDqrhvC613pyuw/5qeuuP/i
Et5I3/YBMC+YoFspSDC/j+wq4K0FDNfcsRR0dfHYkgFMZQT5pWCbOXwHqDNJAqk2
hJfarwAXoUEVEUFYqiNF
=M86C
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to