Bug 224094 - devel/msp430-debug-stack: fails to build with boost 1.66
Summary: devel/msp430-debug-stack: fails to build with boost 1.66
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lev A. Serebryakov
URL:
Keywords: needs-patch
Depends on:
Blocks: 223922
  Show dependency treegraph
 
Reported: 2017-12-04 18:28 UTC by Jan Beich
Modified: 2017-12-05 17:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (lev)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2017-12-04 18:28:32 UTC
As part of exp-run in bug 223922 this port was found to break on Boost update. If the issue won't disappear on its own by Boost release I plan to mark the port as BROKEN. Can you check with upstream maintainer or help with a fix?

$ fetch -qo- 'https://reviews.freebsd.org/D13279?download=true' | patch -Efsp0 -d /usr/ports
$ make all deinstall install clean -C/usr/ports/devel/boost-libs
$ make -C/usr/ports/devel/msp430-debug-stack
[...]
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp:192:26: error: reference to 'chrono' is ambiguous
                this_thread::sleep_for(chrono::milliseconds(500));
                                       ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^

http://package23.nyi.freebsd.org/data/103i386-default-PR223922/2017-12-02_11h06m37s/logs/errors/msp430-debug-stack-3.10.001.000_3.log
http://package22.nyi.freebsd.org/data/103amd64-default-PR223922/2017-12-02_11h06m39s/logs/errors/msp430-debug-stack-3.10.001.000_3.log
http://package22.nyi.freebsd.org/data/111amd64-default-PR223922/2017-12-03_09h31m05s/logs/errors/msp430-debug-stack-3.10.001.000_3.log
http://package23.nyi.freebsd.org/data/111i386-default-PR223922/2017-12-03_09h31m14s/logs/errors/msp430-debug-stack-3.10.001.000_3.log
Comment 1 Lev A. Serebryakov freebsd_committer 2017-12-04 18:42:38 UTC
It looks like some conflict between new boost and new C++ std:: library, not a problem of msp430-debug-stack.
I don't think I know about modern C++ and boost well enough to fix this.
Comment 2 Jan Beich freebsd_committer 2017-12-04 19:23:27 UTC
(In reply to Lev A. Serebryakov from comment #1)
> It looks like some conflict between new boost and new C++ std:: library

ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp has

using namespace std;
using namespace::boost::asio;

which is not safe after https://github.com/boostorg/asio/commit/b60e92b13ef6#diff-75d3b30d4f814d756ef0bfdbb142c37f
Comment 3 Jan Beich freebsd_committer 2017-12-04 19:33:12 UTC
(In reply to Lev A. Serebryakov from comment #1)
> I don't think I know about modern C++ and boost well enough to fix this.

A quick fix (for same behavior as Boost 1.65) is to prepend std:: for chrono conflicts. Otherwise, report upstream. Maybe they'd want to drop either/both "using namespace" lines.
Comment 4 Lev A. Serebryakov freebsd_committer 2017-12-05 11:48:39 UTC
Thank you for explanation.
I'm afraid, upstream is very unresponsive (it is Texas Instruments and their attitude to open source is strange, to say less), but I'll commit patch ASAP.
Comment 5 commit-hook freebsd_committer 2017-12-05 12:12:46 UTC
A commit references this bug:

Author: lev
Date: Tue Dec  5 12:12:28 UTC 2017
New revision: 455578
URL: https://svnweb.freebsd.org/changeset/ports/455578

Log:
    Fix namespace conflict for new Boost.

  PR:		224094
  Reported by:	jbeich@FreeBSD.org

Changes:
  head/devel/msp430-debug-stack/Makefile
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceUSB.cpp
Comment 6 Lev A. Serebryakov freebsd_committer 2017-12-05 12:17:26 UTC
Thank you for help!
Comment 7 Jan Beich freebsd_committer 2017-12-05 15:13:58 UTC
Unfortunately, that's not the end of namespace ambiguity:

BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:196:25: error: reference to 'chrono' is ambiguous
        this_thread::sleep_for(chrono::milliseconds(10));
                               ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:198:25: error: reference to 'chrono' is ambiguous
        this_thread::sleep_for(chrono::milliseconds(10));
                               ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:200:25: error: reference to 'chrono' is ambiguous
        this_thread::sleep_for(chrono::milliseconds(10));
                               ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:202:25: error: reference to 'chrono' is ambiguous
        this_thread::sleep_for(chrono::milliseconds(10));
                               ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:206:27: error: reference to 'chrono' is ambiguous
          this_thread::sleep_for(chrono::milliseconds(10));
                                 ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:212:27: error: reference to 'chrono' is ambiguous
          this_thread::sleep_for(chrono::milliseconds(10));
                                 ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp:216:25: error: reference to 'chrono' is ambiguous
        this_thread::sleep_for(chrono::milliseconds(250));
                               ^
/usr/include/c++/v1/chrono:881:11: note: candidate found by name lookup is 'std::__1::chrono'
namespace chrono {
          ^
/usr/local/include/boost/asio/detail/chrono.hpp:28:11: note: candidate found by name lookup is 'boost::asio::chrono'
namespace chrono {
          ^
7 errors generated.

build log: http://sprunge.us/JAie
Comment 8 commit-hook freebsd_committer 2017-12-05 15:57:55 UTC
A commit references this bug:

Author: lev
Date: Tue Dec  5 15:57:27 UTC 2017
New revision: 455587
URL: https://svnweb.freebsd.org/changeset/ports/455587

Log:
   Second try to fix compatibility with new boost

  PR:		224094
  Reported by:	jbeich@FreeBSD.org

Changes:
  head/devel/msp430-debug-stack/Makefile
  head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_FetControl.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430_v3_src_DLL430_OldApiV3.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430_v3_src_TI_DLL430_ConfigManager.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430_v3_src_TI_DLL430_UpdateManagerFet.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430_v3_src_TI_DLL430_UpdateManagerMSP_FET430.cpp
  head/devel/msp430-debug-stack/files/patch-Makefile
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430_DLL_BSL430_DLL_Connections_MSPBSL_Connection5xxUSB.cpp
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430_DLL_BSL430_DLL_MSPBSL_Factory.cpp
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430_DLL_BSL430_DLL_Physical_Interfaces_MSPBSL_PhysicalInterfaceSerialUART.cpp
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceUSB.cpp
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_Makefile
Comment 9 Jan Beich freebsd_committer 2017-12-05 16:17:46 UTC
After ports r455587 the port still fails to build with Boost 1.66. I wonder if something like https://github.com/arvidn/libtorrent/commit/f42b63c7ea82 would help.

In file included from DLL430_v3/src/TI/DLL430/IoChannelFactory.cpp:40:
./DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h:76:17: error: no type named 'io_service' in namespace 'boost::asio'
                        boost::asio::io_service* ioService;
                        ~~~~~~~~~~~~~^
DLL430_v3/src/TI/DLL430/IoChannelFactory.cpp:65:32: error: assigning to 'TI::DLL430::IoChannel *' from incompatible type 'TI::DLL430::UsbCdcIoChannel *'
        case PortInfo::CDC: channel = new UsbCdcIoChannel(portInfo); break;
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

build log: http://sprunge.us/gWfB
Comment 10 Jan Beich freebsd_committer 2017-12-05 16:27:02 UTC
And one more:

DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp:378:31: error: no type named 'io_service' in namespace
      'boost::asio'
        ioService = new boost::asio::io_service;
                        ~~~~~~~~~~~~~^
1 error generated.

Replacing io_service with io_context was enough for the build to succeed.
Comment 11 commit-hook freebsd_committer 2017-12-05 17:06:56 UTC
A commit references this bug:

Author: lev
Date: Tue Dec  5 17:06:49 UTC 2017
New revision: 455593
URL: https://svnweb.freebsd.org/changeset/ports/455593

Log:
   Third round of adapting port to new boost 1.66

  PR:		224094
  Reported by:	jbeich@FreeBSD.org

Changes:
  head/devel/msp430-debug-stack/Makefile
  head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp
  head/devel/msp430-debug-stack/files/patch-DLL430_v3_src_TI_DLL430_UsbCdcIoChannel.h
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430_DLL_BSL430_DLL_Physical_Interfaces_MSPBSL_PhysicalInterfaceSerialUART.cpp
  head/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430_DLL_BSL430_DLL_Physical_Interfaces_MSPBSL_PhysicalInterfaceSerialUART.h
Comment 12 Lev A. Serebryakov freebsd_committer 2017-12-05 17:08:06 UTC
At least!
I'm sorry for all this mess.
Comment 13 Jan Beich freebsd_committer 2017-12-05 17:44:15 UTC
I confirm, msp430-debug-stack (this port) now builds fine with Boost 1.66 on 10.3 i386/amd64, 11.1 i386/amd64, 12.0 i386/amd64.