[MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
------------------------+--------------------------
 Reporter:  ryandesign  |      Owner:  RootFunction
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:
 Keywords:              |       Port:  bazel
------------------------+--------------------------
 [https://build.macports.org/builders/ports-10.8_x86_64_legacy-
 builder/builds/77934/steps/install-port/logs/stdio bazel fails to build on
 10.8] and earlier:

 {{{
 In file included from src/main/cpp/util/strings.cc:14:
 ./src/main/cpp/util/strings.h:117:6: error: no type named 'unique_ptr' in
 namespace 'std'
 std::unique_ptr<char[]> WstringToCstring(const wchar_t *input);
 ~~~~~^
 }}}

 Sounds like it may need the cxx11 1.1 portgroup at least.

--
Ticket URL: <https://trac.macports.org/ticket/57513>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by cjones051073):

 It already uses the cxx11 portgroup. Please check the portfile. Getting
 bazel to use Macports own compiler was enough of a headache ;)

 The issue is the use of the flag -std=c++0x

 ```
 external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector
 -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-
 pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-
 sections '-std=c++0x' -MD -MF bazel-out/darwin-
 opt/bin/src/main/cpp/util/_objs/strings/strings.d '-frandom-seed=bazel-out
 /darwin-opt/bin/src/main/cpp/util/_objs/strings/strings.o'
 -DBLAZE_OPENSOURCE -iquote . -iquote bazel-out/darwin-opt/genfiles -iquote
 bazel-out/darwin-opt/bin -iquote external/bazel_tools -iquote bazel-out
 /darwin-opt/genfiles/external/bazel_tools -iquote bazel-out/darwin-
 opt/bin/external/bazel_tools -no-canonical-prefixes -Wno-builtin-macro-
 redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"'
 '-D__TIME__="redacted"' -c src/main/cpp/util/strings.cc -o bazel-out
 /darwin-opt/bin/src/main/cpp/util/_objs/strings/strings.o)

 that needs to be at least `c++11` for `unique_ptr`.

 I have no idea why this only happens on  10.8, whereas 10.9 which is also
 using Macports clang 5.0 seems OK.
 ```

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by ryandesign):

 Sorry, you're right, I didn't look at the portfile, only at the error
 message.

 The cxx11 1.1 portgroup can only work if the portfile uses the compiler
 and cxxflags that MacPorts tells it to. Looks like bazel might not be
 passing `configure.cxxflags` on to the build—that's where the `-stdlib`
 flag that tells it what C++ library to use would be found. The default C++
 library on 10.9 and later supports C++11 while the one on 10.8 and earlier
 doesn't.

 I haven't found there to be any particular difference between specifying
 c++0x or c++11, but maybe in some cases there is.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by cjones051073):

 bazel probably does everything differently to any other build system you
 might have looked at.

 It *really* wants to control everything itself, including the compiler
 selection, build options and dependencies. Its very very tough to get it
 to change its mind on these things.

 One thing I did try is I pushed an update to to forcibly (via a reinplace)
 change all c++0x in the source to c++11. That got things a little further
 on 10.8 bit it still fails.

 To be frank, it was enough of an effort to get things build down to 10.9.
 I'm happy with that, and if someone else comes along who has an interest
 in fixing bazel in older systems, they are more than welcome to try.  My
 interest in bazel only stems from the fact I needed it to provide a py-
 tensorflow port that builds from source itself.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by ryandesign):

 If bazel gives you no other place to specify the cxxflags, you could
 easily put them after the -std=c++11 flag in that reinplace.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by cjones051073):

 Just to illustrate how hard it is to deal with bazel, just read the
 discussion at

 https://github.com/bazelbuild/bazel/issues/5198

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by cjones051073):

 I suspect the reinplace does not change things for every build target.
 Just those that happen to use some default values in a few places. I can
 try it, but I am betting it will not work.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by kencu):

 The last bazel I built easily on 10.6.8 was 0.9.0, so I did this in my
 SnowLeopardPorts repo of pegged ports:
 {{{
 # peg bazel at 0.9.0 for older systems
 if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
     github.setup              bazelbuild bazel 0.9.0
     checksums                 rmd160
 5cb89e5598a2c27c8ce6c30bad9107f67d7547ee \
                               sha256
 efb28fed4ffcfaee653e0657f6500fc4cbac61e32104f4208da385676e76312a
 }
 }}}
 I haven't looked at it recently to see if I can get some newer system to
 build it. You're right, bazel is a total bear to sort out.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by cjones051073):

 Comparing bazel to a bear is frankly impolite to the bear ;)

 Just out of curiosity, what lead you to need to use bazel on 10.6 in the
 first place ? Until I updated py-tensorflow to use it, nothing else in
 MacPorts did (thankfully).

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by kencu):

 tensorflow, indeed.

 I have this broken bone about keeping old systems working smoothly. Did I
 mention I have both a Mac SE/30 and MacII si on my desk, working
 perfectly?

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'

MacPorts
In reply to this post by MacPorts
#57513: bazel @0.18.0: error: no type named 'unique_ptr' in namespace 'std'
-------------------------+--------------------------
  Reporter:  ryandesign  |      Owner:  RootFunction
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:
Resolution:              |   Keywords:
      Port:  bazel       |
-------------------------+--------------------------

Comment (by ryandesign):

 Replying to [comment:8 cjones051073]:
 > Just out of curiosity, what lead you to need to use bazel on 10.6 in the
 first place ? Until I updated py-tensorflow to use it, nothing else in
 MacPorts did (thankfully).

 I was monitoring build failures on the Buildbot. I saw this one and wanted
 to report it to you.

--
Ticket URL: <https://trac.macports.org/ticket/57513#comment:10>
MacPorts <https://www.macports.org/>
Ports system for macOS