Qpid
  1. Qpid
  2. QPID-4095

Boost 1.50.0 has removed filesystem version 2 from the library

    Details

      Description

      The build fails when building against boost 1.50.0 because version 0.16 and earlier require boost filesystem version 2 which has been removed from boost version 1.50.0.

      1. qpid_boost_fs.patch
        2 kB
        Matt Griswold
      2. qpid-cpp-0.16.patch
        2 kB
        Davin Shearer

        Activity

        Hide
        Chuck Rolke added a comment -

        Commit r1435326 gets rid of Boost filesystem entirely for windows. So now it's gone for all platforms. That will fix those pesky version differences.

        I've created a Boost kit version 1.52 for windows. Please see http://people.apache.org/~chug/boost-win-1.52/

        This works just like kit version 1.47 including the annoying issue with Symantec Norton Internet Security declaring the boost filesystem DLLs as Suspicious.Cloud.7.F threats.

        Show
        Chuck Rolke added a comment - Commit r1435326 gets rid of Boost filesystem entirely for windows. So now it's gone for all platforms. That will fix those pesky version differences. I've created a Boost kit version 1.52 for windows. Please see http://people.apache.org/~chug/boost-win-1.52/ This works just like kit version 1.47 including the annoying issue with Symantec Norton Internet Security declaring the boost filesystem DLLs as Suspicious.Cloud.7.F threats.
        Hide
        Andrew Stitcher added a comment -

        Fix applied to 0.20 release branch

        Show
        Andrew Stitcher added a comment - Fix applied to 0.20 release branch
        Hide
        Justin Ross added a comment -

        Reviewed by Chuck. I was initially skeptical for 0.20, but this change fixes a blocker-level build problem on various platforms, and it's been clear on trunk for some time. Approved for 0.20.

        Show
        Justin Ross added a comment - Reviewed by Chuck. I was initially skeptical for 0.20, but this change fixes a blocker-level build problem on various platforms, and it's been clear on trunk for some time. Approved for 0.20.
        Hide
        Chuck Rolke added a comment -

        These changes look good for inclusion into 0.20.

        Show
        Chuck Rolke added a comment - These changes look good for inclusion into 0.20.
        Hide
        Mary hinton added a comment -

        Haven't tried it yet, but the Windows changed looked good.
        Thanks,
        Mary

        Show
        Mary hinton added a comment - Haven't tried it yet, but the Windows changed looked good. Thanks, Mary
        Hide
        Andrew Stitcher added a comment - - edited

        I've fixed this on Posix platforms by moving away from boost::filesystem completely. On windows I've used boost::filesystem code that is good for both v2 and v3 implementations (as long as it's not older than around 1.40)

        Fixed on trunk in r1424247

        Show
        Andrew Stitcher added a comment - - edited I've fixed this on Posix platforms by moving away from boost::filesystem completely. On windows I've used boost::filesystem code that is good for both v2 and v3 implementations (as long as it's not older than around 1.40) Fixed on trunk in r1424247
        Hide
        Mary hinton added a comment -

        I used a slightly different method to solve the filesystem version problem in Windows port.
        The method proposed in the Jira gives errors in Visual Studio.
        fs::path dirPath (dirname);
        etc...
        if (!fs::is_directory(*itr) && isShlibName(itr->path().native()))
        tryShlib (itr->path().native().data(), true);

        1> Modules.cpp
        1>qpid\Modules.cpp(98): error C2664: '`anonymous-namespace'::isShlibName' : cannot convert parameter 1 from 'const boost::filesystem::path::string_type' to 'const std::string &'
        1> Reason: cannot convert from 'const boost::filesystem::path::string_type' to 'const std::string'
        1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
        1>qpid\Modules.cpp(99): error C2664: 'qpid::tryShlib' : cannot convert parameter 1 from 'const wchar_t *' to 'const char *'
        1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

        For version 3 of the file system I used:

        void loadModuleDir (std::string dirname, bool isDefault)
        {
        fs::path dirPath (dirname, fs::native);
        etc...

        if (!fs::is_directory(*itr) && isShlibName(itr->path().filename().string()))
        tryShlib (itr->path().filename().string().data(), true);

        I didn't get any errors in Visual Studio when I compiled. Haven't tried it on Linux.
        Mary

        Show
        Mary hinton added a comment - I used a slightly different method to solve the filesystem version problem in Windows port. The method proposed in the Jira gives errors in Visual Studio. fs::path dirPath (dirname); etc... if (!fs::is_directory(*itr) && isShlibName(itr->path().native())) tryShlib (itr->path().native().data(), true); 1> Modules.cpp 1>qpid\Modules.cpp(98): error C2664: '`anonymous-namespace'::isShlibName' : cannot convert parameter 1 from 'const boost::filesystem::path::string_type' to 'const std::string &' 1> Reason: cannot convert from 'const boost::filesystem::path::string_type' to 'const std::string' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1>qpid\Modules.cpp(99): error C2664: 'qpid::tryShlib' : cannot convert parameter 1 from 'const wchar_t *' to 'const char *' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast For version 3 of the file system I used: void loadModuleDir (std::string dirname, bool isDefault) { fs::path dirPath (dirname, fs::native); etc... if (!fs::is_directory(*itr) && isShlibName(itr->path().filename().string())) tryShlib (itr->path().filename().string().data(), true); I didn't get any errors in Visual Studio when I compiled. Haven't tried it on Linux. Mary
        Hide
        Darryl L. Pierce added a comment -

        I've incorporated this patch in the F18 and Rawhide builds on Fedora (where Boost 1.50 is now used) and it builds as expected.

        Show
        Darryl L. Pierce added a comment - I've incorporated this patch in the F18 and Rawhide builds on Fedora (where Boost 1.50 is now used) and it builds as expected.
        Hide
        Matt Griswold added a comment - - edited

        This (qpid_boost_fs.patch) worked for me on 1.49 and 1.50 against 0.14 and HEAD - don't have anything else handy to test on.

        Show
        Matt Griswold added a comment - - edited This (qpid_boost_fs.patch) worked for me on 1.49 and 1.50 against 0.14 and HEAD - don't have anything else handy to test on.
        Hide
        Steve Huston added a comment -

        And boost_system was introduced at Boost 1.35 so specifying it needs to be conditional. cpp/src/CMakeLists.txt has an example.

        Show
        Steve Huston added a comment - And boost_system was introduced at Boost 1.35 so specifying it needs to be conditional. cpp/src/CMakeLists.txt has an example.
        Hide
        Alan Conway added a comment -

        This doesn't build on boost 1.4.1:

        ../../qpid/cpp/src/qpid/Modules.cpp:92: error: ‘const struct boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>’ has no member na\
        med ‘native’
        ../../qpid/cpp/src/qpid/Modules.cpp:93: error: ‘const struct boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>’ has no member na\
        med ‘native’

        Ideally we want code that uses only functions available on both versions, or if that's impossible, to #ifdef the code to be conditional on the boost version.

        Show
        Alan Conway added a comment - This doesn't build on boost 1.4.1: ../../qpid/cpp/src/qpid/Modules.cpp:92: error: ‘const struct boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>’ has no member na\ med ‘native’ ../../qpid/cpp/src/qpid/Modules.cpp:93: error: ‘const struct boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>’ has no member na\ med ‘native’ Ideally we want code that uses only functions available on both versions, or if that's impossible, to #ifdef the code to be conditional on the boost version.
        Hide
        Davin Shearer added a comment -

        This patch is applied after bootstrapping because I'm using the qpid-cpp package, not a checkout with the bootstrap script (and if I bootstrapped it on my system and sent you the diff patch, it would be lengthy and probably not what want). You'll want to update src/Makefile.am and rebootstrap it to fix it properly. Hope it helps.

        Show
        Davin Shearer added a comment - This patch is applied after bootstrapping because I'm using the qpid-cpp package, not a checkout with the bootstrap script (and if I bootstrapped it on my system and sent you the diff patch, it would be lengthy and probably not what want). You'll want to update src/Makefile.am and rebootstrap it to fix it properly. Hope it helps.
        Hide
        Steve Huston added a comment -

        Thank you very much, Davin, for the report and the way to resolve it.

        Could you please attach your patches to the jira and be sure to check the box granting use to Apache Software Foundation. To protect the integrity of IPR we can't use the patches without that permission recorded.

        Thank you.

        Show
        Steve Huston added a comment - Thank you very much, Davin, for the report and the way to resolve it. Could you please attach your patches to the jira and be sure to check the box granting use to Apache Software Foundation. To protect the integrity of IPR we can't use the patches without that permission recorded. Thank you.
        Hide
        Davin Shearer added a comment - - edited

        Here's a pair of diffs to bring it up to date:

        --- qpid-cpp-0.16/src/Makefile.am       2012-02-24 15:05:47.000000000 -0500
        +++ ../qpid-cpp/src/Makefile.am 2012-06-28 15:08:13.577256348 -0400
        @@ -137,8 +137,6 @@
         tmoduleexecdir = $(libdir)/qpid/tests
         tmoduleexec_LTLIBRARIES=
         
        -AM_CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=2
        -
         ## Automake macros to build libraries and executables.
         qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\"
         libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\"
        @@ -336,6 +334,7 @@
           libqpidtypes.la \
           -lboost_program_options \
           -lboost_filesystem \
        +  -lboost_system \
           -luuid \
           $(LIB_DLOPEN) \
           $(LIB_CLOCK_GETTIME)
        
        --- qpid-cpp-0.16/src/qpid/Modules.cpp  2011-03-14 16:29:02.000000000 -0400
        +++ ../qpid-cpp/src/qpid/Modules.cpp    2012-06-28 15:06:04.344364807 -0400
        @@ -73,7 +73,7 @@
         
         void loadModuleDir (std::string dirname, bool isDefault)
         {
        -    fs::path dirPath (dirname, fs::native);
        +    fs::path dirPath (dirname);
         
             if (!fs::exists (dirPath))
             {
        @@ -89,8 +89,8 @@
             fs::directory_iterator endItr;
             for (fs::directory_iterator itr (dirPath); itr != endItr; ++itr)
             {
        -        if (!fs::is_directory(*itr) && isShlibName(itr->string()))
        -            tryShlib (itr->string().data(), true);
        +      if (!fs::is_directory(*itr) && isShlibName(itr->path().native()))
        +        tryShlib (itr->path().native().data(), true);
             }
         }
        

        Then bootstrap and build.

        Hope it helps.

        Show
        Davin Shearer added a comment - - edited Here's a pair of diffs to bring it up to date: --- qpid-cpp-0.16/src/Makefile.am 2012-02-24 15:05:47.000000000 -0500 +++ ../qpid-cpp/src/Makefile.am 2012-06-28 15:08:13.577256348 -0400 @@ -137,8 +137,6 @@ tmoduleexecdir = $(libdir)/qpid/tests tmoduleexec_LTLIBRARIES= -AM_CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=2 - ## Automake macros to build libraries and executables. qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" @@ -336,6 +334,7 @@ libqpidtypes.la \ -lboost_program_options \ -lboost_filesystem \ + -lboost_system \ -luuid \ $(LIB_DLOPEN) \ $(LIB_CLOCK_GETTIME) --- qpid-cpp-0.16/src/qpid/Modules.cpp 2011-03-14 16:29:02.000000000 -0400 +++ ../qpid-cpp/src/qpid/Modules.cpp 2012-06-28 15:06:04.344364807 -0400 @@ -73,7 +73,7 @@ void loadModuleDir (std::string dirname, bool isDefault) { - fs::path dirPath (dirname, fs::native); + fs::path dirPath (dirname); if (!fs::exists (dirPath)) { @@ -89,8 +89,8 @@ fs::directory_iterator endItr; for (fs::directory_iterator itr (dirPath); itr != endItr; ++itr) { - if (!fs::is_directory(*itr) && isShlibName(itr->string())) - tryShlib (itr->string().data(), true); + if (!fs::is_directory(*itr) && isShlibName(itr->path().native())) + tryShlib (itr->path().native().data(), true); } } Then bootstrap and build. Hope it helps.

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Davin Shearer
          • Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development