View Issue Details

IDProjectCategoryView StatusLast Update
0004874DarkRadiantCompilation/Buildpublic10.09.2018 06:31
Reportercoldtobi Assigned Togreebo  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinuxOSDebianOS Version
Product Version2.6.0 
Target Version2.6.1Fixed in Version2.6.1 
Summary0004874: Compile error with gcc-7 (and gcc-8)
DescriptionReported in Debian as bug #897734, https://bugs.debian.org/897734 - see there for the complete thread.
I'm not sure if the patch provided at the Debian BTS is suitable for you, I did not test if that breaks earlier gcc versions but I guess that is likely; I'll attach it nevertheless.

Summary / Analysis copied from the Debian BTS:

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])

TagsNo tags attached.

Activities

coldtobi

coldtobi

26.07.2018 07:02

reporter  

03_c++17_filesystem.patch (1,262 bytes)
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 <juhaninumminen0@gmail.com>
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=''
 


greebo

greebo

28.08.2018 13:24

administrator   ~0010743

I'll try to make this compatible with GCC-8
greebo

greebo

31.08.2018 10:04

administrator   ~0010744

With commit 5e40dc70 (plus predecessors) I adjusted the ./configure script to detect a C++17-compliant compiler. This automake macro automatically provides the --std=c++17 flag to GCC if it has to.

Plus, I added the correct C++17 call to std::filesystem::permissions.

I successfully tested this revision both in Windows and Debian Testing, so I'll set this issue to resolved. Thanks for the thorough investigation and report!

Issue History

Date Modified Username Field Change
26.07.2018 07:02 coldtobi New Issue
26.07.2018 07:02 coldtobi File Added: 03_c++17_filesystem.patch
21.08.2018 17:44 greebo Status new => acknowledged
28.08.2018 13:24 greebo Note Added: 0010743
28.08.2018 13:24 greebo Status acknowledged => confirmed
31.08.2018 10:00 greebo Assigned To => greebo
31.08.2018 10:00 greebo Status confirmed => assigned
31.08.2018 10:04 greebo Note Added: 0010744
31.08.2018 10:04 greebo Status assigned => resolved
31.08.2018 10:04 greebo Fixed in Version => 2.6.1
31.08.2018 10:04 greebo Resolution open => fixed
31.08.2018 10:04 greebo Target Version => 2.6.1
10.09.2018 06:31 greebo Description Updated View Revisions