[MacPorts] #39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope ----------------------+-------------------------------- Reporter: deesto@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: zmq ----------------------+-------------------------------- On 10.6.8 w/Xcode 3.2.5 {{{ $ sudo port clean zmq && sudo port -d upgrade zmq ... test_disconnect_inproc.cpp: In function ‘int main(int, char**)’: test_disconnect_inproc.cpp:48: error: ‘strndup’ was not declared in this scope test_disconnect_inproc.cpp:52: error: ‘strndup’ was not declared in this scope test_disconnect_inproc.cpp:72: error: ‘strndup’ was not declared in this scope make[1]: *** [test_disconnect_inproc.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_zmq/zmq/work/zeromq-3.2.3/tests' make: *** [all-recursive] Error 1 make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_zmq/zmq/work/zeromq-3.2.3' Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_zmq/zmq/work/zeromq-3.2.3" && /usr/bin/make -j4 -w all LIBTOOL=/opt/local/bin/glibtool Exit code: 2 Error: org.macports.build for port zmq returned: command execution failed DEBUG: Error code: CHILDSTATUS 33732 2 DEBUG: Backtrace: command execution failed while executing "system -nice 0 $fullcmdstring" ("eval" body line 1) invoked from within "eval system $notty $nice \$fullcmdstring" invoked from within "command_exec build" (procedure "portbuild::build_main" line 8) invoked from within "$procedure $targetname" Warning: targets not executed for zmq: org.macports.install org.macports.build org.macports.destroot Please see the log file for port zmq for details: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_zmq/zmq/main.log DEBUG: couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory while executing "open [file join $dir tclIndex]" Error: Unable to upgrade port: 1 To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets }}} -- Ticket URL: <https://trac.macports.org/ticket/39122> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+-------------------------------- Reporter: deesto@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+-------------------------------- Comment (by egall@…): Hm, your system ''should'' have a `strndup` function... try updating your Xcode to 3.2.6 and then try again -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Changes (by larryv@…): * owner: macports-tickets@… => merijn@… Comment: Replying to [comment:1 egall@…]:
Hm, your system ''should'' have a `strndup` function...
OS X didn’t have `strndup` until 10.7. 10.6.8: http://www.opensource.apple.com/source/Libc/Libc-594.9.5/include/string.h\\ 10.7.0: http://www.opensource.apple.com/source/Libc/Libc-763.11/include/string.h -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by egall@…): Replying to [comment:2 larryv@…]:
Replying to [comment:1 egall@…]:
Hm, your system ''should'' have a `strndup` function...
OS X didn’t have `strndup` until 10.7.
10.6.8: http://www.opensource.apple.com/source/Libc/Libc-594.9.5/include/string.h\\ 10.7.0: http://www.opensource.apple.com/source/Libc/Libc-763.11/include/string.h
Really? I could have sworn I'd seen {{{ checking for strndup... yes }}} scroll by in some configure script before on my Snow Leopard machine... then again my Snow Leopard had a bunch of headers on it that it probably shouldn't have had, so idk... -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Changes (by larryv@…): * cc: david.w.watson@… (added) Comment: Has duplicate #39137. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by jdgleeson@…): Here is a patch taken for this merge of a pull request https://github.com/zeromq/zeromq3-x/commit/400cbc208a768c4df5039f401dd2688ee... which was applied after zmq 3.2.3 was released. I did not enclose the patch in a version test like {{{ if {${os.platform} == "darwin" && ${os.major} <= 10} { patchfiles patch-tests-test_disconnect_inproc.cpp.diff } }}} because the patched mainline code has no version test, but there may be a reason to do so in Macports? -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by eborisch@…): Here is a patch that provides the function (rather than just commenting it out) and only does it on pre-Lion (can anyone confirm Lion has strndup?) -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by eborisch@…): I see above someone has already confirmed strndup for lion. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by jdgleeson@…): Adding strndup is certainly a logically correct fix. However, the fprintf calls and strndup calls have already been removed upstream (see the link to the zeromq git repository in comment:6). The zmq maintainers do not explain why they simply deleted strndup, so I will speculate: test_disconnect_inproc.cpp is a test function (i.e., not a part of the zmq library). The calls to strndup occur only in fprintf calls. The fprintf calls were probably used just to debug the test function itself. There is no need for the extra output they would generate. Final decision: simplify the code. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by eborisch@…): Aha; should've read farther up the comment stream. Thanks for pointing that out! I've reached out to Merijn; he hopes to test (commit?) this tonight. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:13> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by merijn@…): I went with the upstream patch of removing the debugging prints as this was only a test file, I tested the patch on both Snow Leopard and Lion where it works fine, so should be ready for committing. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:14> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: zmq | -----------------------+---------------------- Changes (by cal@…): * status: new => closed * resolution: => fixed Comment: Commited in r106263. Thanks. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:15> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Changes (by samuel.bateman@…): * status: closed => reopened * resolution: fixed => Comment: The patch file doesn't work for me on Snow Leopard. {{{ ---> Applying patches to zmq ---> Applying patch-tests-test_disconnect_inproc.cpp.diff patching file tests/test_disconnect_inproc.cpp /usr/bin/patch: **** malformed patch at line 20: @@ -66,11 +64,6 @@ Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_zmq/zmq/work/zeromq-3.2.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/zmq/files /patch-tests-test_disconnect_inproc.cpp.diff' Exit code: 2 }}} -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:16> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by merijn@…): Replying to [comment:16 samuel.bateman@…]:
The patch file doesn't work for me on Snow Leopard. {{{ ---> Applying patches to zmq ---> Applying patch-tests-test_disconnect_inproc.cpp.diff patching file tests/test_disconnect_inproc.cpp /usr/bin/patch: **** malformed patch at line 20: @@ -66,11 +64,6 @@ }}}
That is a particularly odd line for patch to fail on... What happens if you run the same patch command manually? Any other output from it? Relatedly, if you run "patch -v" which version does it output for you?
{{{ Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_zmq/zmq/work/zeromq-3.2.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/zmq/files /patch-tests-test_disconnect_inproc.cpp.diff' Exit code: 2 }}}
Will look in to this tomorrow to see if I can reproduce. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:17> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: zmq | -----------------------+---------------------- Comment (by jdgleeson@…): I've seen `patch` get confused like this when I have tried to edit a diff file by hand and incorrectly alterered the line numbers on the @@ lines. I suspect that is what happened here, because the line numbers on the @@ lines are the same as in the patch file I submitted above, but the lines {{{ - } else { + } + else { }} have been replaced by {{{ } else { }}} so they are just as mutually inconsistent as if I had tried to do this myself :-) -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:18> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: zmq | -----------------------+---------------------- Changes (by cal@…): * status: reopened => closed * resolution: => fixed Comment: I regenerated the patch file. Should be fixed in r106278. The patch now applies fine for me, but I'm on ML; please re-open if the problem persists. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:19> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: zmq | -----------------------+---------------------- Comment (by eborisch@…): Succeeded on the Buildbot, for the record. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:20> MacPorts <http://www.macports.org/> Ports system for OS X
#39122: zmq @3.2.3 test error: ‘strndup’ was not declared in this scope -----------------------+---------------------- Reporter: deesto@… | Owner: merijn@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: zmq | -----------------------+---------------------- Comment (by samuel.bateman@…): Works for me now too, thanks. -- Ticket URL: <https://trac.macports.org/ticket/39122#comment:21> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts