Control: tags -1 + patch

On Fri, 04 May 2018 12:21:18 +0000 Matthias Klose <[email protected]> wrote:
> Package: src:darkradiant
> Version: 2.5.0-2
[...]
> The package fails to build in a test rebuild on at least amd64 with
> gcc-8/g++-8, but succeeds to build with gcc-7/g++-7. The
> severity of this report will be raised before the buster release.
> 
> The full build log can be found at:
> http://aws-logs.debian.net/2018/05/01/gcc8/darkradiant_2.5.0-2_unstable_gcc8.log.gz

The error is:
> In file included from ../../libs/os/file.h:4,
>                  from FileChooser.cpp:9:
> ../../libs/os/fs.h:20:21: error: 'filesystem' is not a namespace-name
>  namespace fs = std::filesystem;

In the new libstdc++-8-dev, the standard header <filesystem> from C++17 is 
available,
whereas earlier libstdc++'s only had <experimental/filesystem>.
DarkRadiant's build system thinks it can use either the <filesystem> or 
<experimental/filesystem>
header, but only the experimental version will work because of two reasons:

 1) to use <filesystem>, g++ requires -std=c++17 or gnu++17, which the build 
system doesn't set

 2) the headers actually have different APIs
    (e.g. there is add_perms in [1], but not in [2])

I've attached a patch that makes the Debian package compile with GCC 8 (and 7).


Cheers,
Juhani

[1] http://en.cppreference.com/w/cpp/experimental/fs/perms
[2] http://en.cppreference.com/w/cpp/filesystem/perms

Description: Resolve FTBFS with GCC 8
 We can't use the regular C++17 <filesystem> header, because the code is written
 against the pre-C++17 header <experimental/filesystem>.
Author: Juhani Numminen <[email protected]>
Bug-Debian: https://bugs.debian.org/897734
Last-Update: 2018-05-24
--- a/configure.ac
+++ b/configure.ac
@@ -159,15 +159,6 @@
 # By default, we rely on boost.filesystem, unless we have the C++17 libs 
 use_boost_filesystem=yes
 
-# Check for the regular C++17 <filesystem> header
-AC_CHECK_HEADER([filesystem], [found_std_filesystem=yes], [found_std_filesystem=no])
-
-# if no <filesystem> is present, check for the pre-C++17 header <experimental/filesystem>
-if test "$found_std_filesystem" = "yes"
-then
-    AC_DEFINE([HAVE_STD_FILESYSTEM], [1], [Define this to indicate that the <filesystem> header is available for inclusion.])
-    use_boost_filesystem=no
-else
     AC_CHECK_HEADER([experimental/filesystem], [found_experimental_filesystem=yes], [found_experimental_filesystem=no])
     
     if test "$found_experimental_filesystem" = "yes"
@@ -176,7 +167,6 @@
                                                         header is available for inclusion.])
         use_boost_filesystem=no
     fi
-fi
 
 FILESYSTEM_LIBS=''
 


Reply via email to