Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build against Boost 1.68 #2211

Closed
jbeich opened this issue Jul 11, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@jbeich
Copy link
Contributor

commented Jul 11, 2018

After boostorg/optional@71d797b build fails. See error log.

In file included from parse/ConditionParser5.cpp:1:
In file included from parse/ConditionParser5.h:4:
In file included from parse/ConditionParserImpl.h:4:
In file included from parse/ConditionParser.h:4:
In file included from parse/Lexer.h:6:
In file included from /usr/local/include/boost/spirit/include/lex_lexertl.hpp:16:
In file included from /usr/local/include/boost/spirit/home/lex/lexer_lexertl.hpp:15:
In file included from /usr/local/include/boost/spirit/home/lex.hpp:13:
In file included from /usr/local/include/boost/spirit/home/lex/lexer.hpp:14:
In file included from /usr/local/include/boost/spirit/home/lex/lexer/token_def.hpp:17:
In file included from /usr/local/include/boost/spirit/home/qi/parser.hpp:15:
In file included from /usr/local/include/boost/spirit/home/qi/domain.hpp:18:
In file included from /usr/local/include/boost/spirit/home/support/context.hpp:18:
In file included from /usr/local/include/boost/spirit/home/support/nonterminal/expand_arg.hpp:20:
In file included from /usr/local/include/boost/spirit/home/support/string_traits.hpp:16:
In file included from /usr/local/include/boost/spirit/home/support/container.hpp:21:
In file included from /usr/local/include/boost/optional.hpp:15:
In file included from /usr/local/include/boost/optional/optional.hpp:1462:
/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:40: error: no type named 'optional_value_type' in namespace 'boost::optional_detail'
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:94: error: member 'type' declared as a template
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
                                                                                             ^
/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:98: error: expected ';' at end of declaration list
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
                                                                                                 ^
3 errors generated.

CC @AMDmi3

@Dilvish-fo

This comment has been minimized.

Copy link
Member

commented Jul 11, 2018

/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:40: error: no type named 'optional_value_type' in namespace 'boost::optional_detail'
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:94: error: member 'type' declared as a template
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
                                                                                             ^
/usr/local/include/boost/optional/detail/optional_reference_spec.hpp:174:98: error: expected ';' at end of declaration list
    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(T&)>::type>::type> flat_map(F f) const
                                                                                                 ^
3 errors generated.

Those look to me to be purely self-contained Boost errors, in a version of Boost that is still under development, so should be reported to them, not to us.

@jbeich

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2018

look to me to be purely self-contained Boost errors

I can't figure out how to reproduce outside of FreeOrion. Simply including the affected headers is not enough.

@Dilvish-fo

This comment has been minimized.

Copy link
Member

commented Jul 11, 2018

I can't figure out how to reproduce outside of FreeOrion. Simply including the affected headers is not enough.

and how about using some simple dummy code that relies upon the same templated boost functions?

This error is occurring in code that was just added 13 days ago to an unfinished, in-development version of Boost. I see zero indication in the error logs you provide that these errors have anything to do with FreeOrion in particular. If you bring this error to the attention of the Boost devs, I would be pretty surprised if they would tell you that you should instead be having us look into it.

jbeich referenced this issue in boostorg/optional Jul 11, 2018

@Vezzra

This comment has been minimized.

Copy link
Member

commented Jul 12, 2018

Closing this. @jbeich, if the issue persists once boost 1.68 has been released, just drop a comment here. In that case we might have to look into this, and reopen the issue.

@Vezzra Vezzra closed this Jul 12, 2018

@jbeich

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2018

After boostorg/gil@4b4f3e8 and boostorg/gil@ed67f9a build also fails. No clue about the former but the latter can be fixed similar to mapnik/mapnik#3937.

In file included from GG/src/GUI.cpp:44:
GG/src/gilext/io/png_io.hpp:39:10: fatal error: 'boost/gil/extension/io/io_error.hpp' file not found
#include <boost/gil/extension/io/io_error.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GG/src/gilext/io/png_io_private.hpp:46:37: error: use of undeclared identifier 'bits8'
template <> struct png_is_supported<bits8,gray_t>        {BOOST_STATIC_CONSTANT(bool,value=true);};
                                    ^
In file included from GG/src/Texture.cpp:39:
GG/src/gilext/io/png_dynamic_io.hpp:37:10: fatal error: 'boost/gil/extension/io/dynamic_io.hpp' file not found
#include <boost/gil/extension/io/dynamic_io.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from GG/src/gilext/io/png_dynamic_io.hpp:43:
In file included from GG/src/gilext/io/png_io.hpp:38:
In file included from GG/src/gilext/io/png_io_private.hpp:30:
GG/src/gilext/io/../typedefs.hpp:30:40: error: too few arguments provided to function-like macro invocation
GIL_DEFINE_BASE_TYPEDEFS(8,  gray_alpha)
                                       ^
/usr/local/include/boost/gil/typedefs.hpp:86:9: note: macro 'GIL_DEFINE_BASE_TYPEDEFS' defined here
#define GIL_DEFINE_BASE_TYPEDEFS(B, CM, CS)                                                  \
        ^
In file included from GG/src/GUI.cpp:44:
In file included from GG/src/gilext/io/png_io.hpp:40:
GG/src/gilext/io/png_io_private.hpp:167:27: error: expected class name
class png_reader : public file_mgr {
                          ^
GG/src/gilext/io/png_io_private.hpp:175:55: error: no matching function for call to 'get'
        io_error_if(fread(buf, 1, PNG_BYTES_TO_CHECK, get()) != detail::PNG_BYTES_TO_CHECK,
                                                      ^~~
/usr/local/include/boost/tuple/detail/tuple_basic.hpp:216:1: note: candidate function template not viable:
      requires single argument 'c', but no arguments were provided
get(cons<HT, TT>& c) {
^
/usr/local/include/boost/tuple/detail/tuple_basic.hpp:230:1: note: candidate function template not viable:
      requires single argument 'c', but no arguments were provided
get(const cons<HT, TT>& c) {
^
/usr/local/include/boost/property_map/property_map.hpp:128:19: note: candidate function template not viable:
      requires 2 arguments, but 0 were provided
  inline const T& get(const T* pa, std::ptrdiff_t k) { return pa[k]; }
                  ^
/usr/local/include/boost/property_map/property_map.hpp:164:3: note: candidate function template not viable:
      requires 2 arguments, but 0 were provided
  get(const readable_property_map_archetype<K,V>&,
  ^
/usr/local/include/boost/property_map/property_map.hpp:301:3: note: candidate function template not viable:
      requires 2 arguments, but 0 were provided
  get(const put_get_helper<Reference, PropertyMap>& pa, const K& k)
  ^
/usr/local/include/boost/optional/optional.hpp:1513:1: note: candidate function template not viable: requires
      single argument 'opt', but no arguments were provided
get ( optional<T> const& opt )
^
/usr/local/include/boost/optional/optional.hpp:1521:1: note: candidate function template not viable: requires
      single argument 'opt', but no arguments were provided
get ( optional<T>& opt )
^
/usr/local/include/boost/optional/optional.hpp:1531:1: note: candidate function template not viable: requires
      single argument 'opt', but no arguments were provided
get ( optional<T> const* opt )
^
/usr/local/include/boost/optional/optional.hpp:1539:1: note: candidate function template not viable: requires
      single argument 'opt', but no arguments were provided
get ( optional<T>* opt )
^
/usr/local/include/boost/array.hpp:423:7: note: candidate function template not viable: requires single argument
      'arr', but no arguments were provided
   T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
      ^
/usr/local/include/boost/array.hpp:429:13: note: candidate function template not viable: requires single argument
      'arr', but no arguments were provided
   const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT {
            ^
@adrianbroher

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2018

@jbeich The issue with GIL is unrelated, please open a separate issue for this.

@jbeich

This comment has been minimized.

Copy link
Contributor Author

commented Jul 14, 2018

With the same subject? Those GIL commits are part of Boost 1.68 update.

@Dilvish-fo

This comment has been minimized.

Copy link
Member

commented Jul 14, 2018

With the same subject? Those GIL commits are part of Boost 1.68 update.

please make the subject more specific to the particular problem being reported

@Dilvish-fo

This comment has been minimized.

Copy link
Member

commented Jul 14, 2018

No clue about the former but the latter can be fixed similar to mapnik/mapnik#3937.

@jbeich also, please clarify, is the general fix you linked sufficient to allow FO to compile & run under the current state of boost 1.68? If so, please submit a PR for it right away so that we could at least consider whether we wanted to try squeezing it into 0.4.8 (even though there is still the potential that additional future changes to boost 1.68 could create further problems). You could just respond to this question in the new Issue and/or PR that you open up to focus on this new problem in particular.

@adrianbroher

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2018

@Dilvish-fo

The suggested fix is meh. However the boost devs have finally merged the alpha-gray png loading written by zlaine. Using the upstream png io code is the way to fix this.

jbeich referenced this issue in boostorg/gil Jul 15, 2018

jbeich referenced this issue in boostorg/gil Jul 15, 2018

Replace bitsN[s] aliases with C++11 fixed width integer types
Import the selection of integer types into boost::gil namespace,
  and move from channel.hpp to typedefs.hpp for easier access.
Replace bits32f with float32_t and bits64f with float64_t
  - kept as alias of scoped_channel_value.
Move float64_t (bits64f) to typedefs.hpp.
Replace the four {float|double}_{zero|one} min/max channel values
  with float_point_zero and float_point_one templates.
Replace <boost/cstdint,hpp> with C++11 <cstdint>.

Introduce preference of using declaration instead of typedef.
Reformat typedefs.hpp to take advantage of the using declaration
  - works much better for left-to-right reading, alias name as
    most important detail comes first.
Add some of missing #include typedefs.hpp, sort some headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.