#53401 closed defect (fixed)
nodejs4 @4.7.2: error: no member named 'tr1' in namespace 'std'
| Reported by: | papachoco (Carlos Sanchez) | Owned by: | ci42 |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.3.5 |
| Keywords: | Cc: | breiter (Brian Reiter), tehcog (tehcog), lesinigo (Luca Lesinigo), gerritgriebel (Gerrit Griebel), detlevd (Detlev Droege), aldaris (Peter Major), rubendibattista (Ruben Di Battista), ajdalshov (Anders Johan Dalshov), dbl001 (dbl), craftey, dgaffuri, davidchambers (David Chambers), Superlokkus (Markus Klemm), mojca (Mojca Miklavec), Smoobly (Smoobly Renfrew), kpreid (Kevin Reid), ryandesign (Ryan Carsten Schmidt) | |
| Port: | nodejs4 |
Description (last modified by jmroot (Joshua Root))
I am getting the exception below while trying to upgrade to node4j .7.2
-I../deps/gtest/include -I../deps/v8/include -I../src -I/opt/local/include -I/opt/local/include/openssl -Os -gdwarf-2 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nodejs4/nodejs4/work/node-v4.7.2/out/Release/.deps//opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nodejs4/nodejs4/work/node-v4.7.2/out/Release/obj.target/cctest/test/cctest/util.o.d.raw -Os -c -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nodejs4/nodejs4/work/node-v4.7.2/out/Release/obj.target/cctest/test/cctest/util.o ../test/cctest/util.cc :info:build In file included from ../test/cctest/util.cc:1: :info:build ../src/util.h:27:53: error: no member named 'tr1' in namespace 'std' :info:build template <typename T> using remove_reference = std::tr1::remove_reference<T>; :info:build ~~~~~^ :info:build ../src/util.h:27:74: error: expected ';' after alias declaration :info:build template <typename T> using remove_reference = std::tr1::remove_reference<T>; :info:build ^ :info:build
Attachments (1)
Change History (27)
Changed 10 years ago by papachoco (Carlos Sanchez)
comment:1 Changed 10 years ago by jmroot (Joshua Root)
| Cc: | ci42 removed |
|---|---|
| Description: | modified (diff) |
| Keywords: | compile error removed |
| Owner: | set to ci42 |
| Status: | new → assigned |
comment:2 Changed 10 years ago by breiter (Brian Reiter)
| Cc: | breiter added |
|---|
comment:3 Changed 10 years ago by breiter (Brian Reiter)
comment:4 Changed 10 years ago by tehcog (tehcog)
| Cc: | tehcog added |
|---|
comment:6 Changed 10 years ago by lesinigo (Luca Lesinigo)
| Cc: | lesinigo added |
|---|
comment:7 Changed 10 years ago by gerritgriebel (Gerrit Griebel)
| Cc: | gerritgriebel added |
|---|
comment:8 Changed 10 years ago by detlevd (Detlev Droege)
| Cc: | detlevd added |
|---|
comment:9 Changed 10 years ago by aldaris (Peter Major)
| Cc: | aldaris added |
|---|
comment:10 Changed 10 years ago by maximumspatium (Maxim Poliakovski)
I'd like to confirm that the above mentioned fix (commenting out
#ifdef __APPLE__
and
std::tr1:: remove_reference<T>
does work for me too. Thank you very much!
comment:11 Changed 10 years ago by rubendibattista (Ruben Di Battista)
| Cc: | rubendibattista added |
|---|
comment:12 follow-up: 15 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | ajdalshov dbl001 added |
|---|
comment:13 Changed 10 years ago by craftey
| Cc: | craftey added |
|---|
comment:14 Changed 10 years ago by dgaffuri
| Cc: | dgaffuri added |
|---|
comment:15 follow-ups: 17 21 Changed 10 years ago by juliangilbey (Julian Gilbey)
Replying to ryandesign:
Has duplicates #53418, #53454.
Commenting out the tr1 references would presumably cause the port fail to build with libstdc++ (i.e. OS X 10.8 and earlier) so that's not a suitable general-purpose fix.
There is currently a partial patch for this issue already in the Portfile; it is only used on macOS Sierra and beyond:
if {${os.major} > 12} {
patchfiles-append patch-src-util.h.diff
}
So all that needs doing is for patch-src-util.h.diff to be extended to cover this additional part of the header file, and it will work on macOS Sierra, and not touch earlier OS X versions.
comment:16 Changed 10 years ago by davidchambers (David Chambers)
| Cc: | davidchambers added |
|---|
comment:17 Changed 10 years ago by cypherpunk1
Replying to juliangilbey:
So all that needs doing is for patch-src-util.h.diff to be extended to cover this additional part of the header file, and it will work on macOS Sierra, and not touch earlier OS X versions.
Previous discussion of that patch here https://lists.macports.org/pipermail/macports-dev/2016-October/033949.html
I encountered this issue while compiling on OS X El Capitan (Darwin 15.6) and on macos Sierra (Darwin 16.4), so I hope the final correct patch will cover both versions.
As mentioned in comment 3 and 10, editing /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macps.org_release_tarballs_ports_devel_nodejs4/nodejs4/work/node-v4.7.2/src/util.h is a working hack on both OS versions.
comment:18 Changed 10 years ago by Superlokkus (Markus Klemm)
| Cc: | Superlokkus added |
|---|
comment:19 Changed 10 years ago by mojca (Mojca Miklavec)
| Cc: | mojca added |
|---|
comment:20 Changed 10 years ago by mojca (Mojca Miklavec)
Version 6 uses an "equally inappropriate" syntax:
// OSX 10.9 defaults to libc++ which provides a C++11 <type_traits> header. #if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090 #define USE_TR1_TYPE_TRAITS #endif #ifdef USE_TR1_TYPE_TRAITS #include <tr1/type_traits> // NOLINT(build/c++tr1) #else #include <type_traits> // std::remove_reference #endif
comment:21 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | Smoobly kpreid added |
|---|
Has duplicates #53448 and #53540.
Replying to juliangilbey:
There is currently a partial patch for this issue already in the Portfile; it is only used on macOS Sierra and beyond:
if {${os.major} > 12} { patchfiles-append patch-src-util.h.diff }So all that needs doing is for patch-src-util.h.diff to be extended to cover this additional part of the header file, and it will work on macOS Sierra, and not touch earlier OS X versions.
Darwin 12 is Mountain Lion, so this patch currently applies on OS versions later than Mountain Lion -- which is to say, OS versions that default to libc++ (which doesn't have tr1 anymore) instead of libstdc++ (which still does). So in addition to whatever change is needed to resolve this ticket, this condition should presumably be changed to not rely on the OS version but on the value of the configure.cxx_stdlib variable.
comment:22 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
| Summary: | Error building nodejs4 4.7.2 → nodejs4 @4.7.2: error: no member named 'tr1' in namespace 'std' |
|---|
comment:23 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | ryandesign added |
|---|---|
| Summary: | nodejs4 @4.7.2: error: no member named 'tr1' in namespace 'std' → nodejs4 @4.7.2: error: no member named 'tr1' in namespace 'std' |
I'm testing a fix now.
comment:24 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:25 Changed 10 years ago by mojca (Mojca Miklavec)
Ryan, we should submit something upstream, also for nodejs6. But I suspect this patch would cause problems if compiling with the latest gcc (or am I wrong?).
I tried to remember where I saw that code, I think it was wxWidgets, I'll check how they solved it.
comment:26 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
I do think it would be a good idea to make equivalent changes to nodejs6, to support LibcxxOnOlderSystems. I don't have such a system set up to test on so I can't definitely verify that there is a problem or that my proposal fixes it, but I think there is and that it does.
I'm not sure that upstream cares about nodejs4 anymore. We could submit our patch for nodejs6 to upstream, but it won't be relevant for nodejs7 anymore since that requires libc++.
I don't care what happens when using FSF GCC to compile this, because that's not something we do in MacPorts.

node compiles and appears to work with the
#ifdef __APPLE__that referencesstd::tr1::removed.