#39122 closed defect (fixed)
zmq @3.2.3 test error: ‘strndup’ was not declared in this scope
Reported by: | deesto (John S. De Stefano Jr.) | Owned by: | merijn (Merijn Verstraaten) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | mndavidoff (Monte Davidoff), macports.org@…, watsodw, jdgleeson, eborisch (Eric A. Borisch) | |
Port: | zmq |
Description
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
Attachments (6)
Change History (27)
Changed 12 years ago by deesto (John S. De Stefano Jr.)
Changed 12 years ago by deesto (John S. De Stefano Jr.)
Attachment: | zmq-port-upgrade.log added |
---|
comment:1 follow-up: 2 Changed 12 years ago by cooljeanius (Eric Gallager)
Hm, your system should have a strndup
function... try updating your Xcode to 3.2.6 and then try again
comment:2 follow-up: 3 Changed 12 years ago by larryv (Lawrence Velázquez)
Owner: | changed from macports-tickets@… to merijn@… |
---|
Replying to 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
comment:3 Changed 12 years ago by cooljeanius (Eric Gallager)
Replying to larryv@…:
Replying to 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...
comment:6 Changed 12 years ago by larryv (Lawrence Velázquez)
Cc: | david.w.watson@… added |
---|
Has duplicate #39137.
comment:8 Changed 12 years ago by jdgleeson
Here is a patch taken from this merge of a pull request
https://github.com/zeromq/zeromq3-x/commit/400cbc208a768c4df5039f401dd2688eede6e1ca
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 upstream code has no version test, but there may be a reason to do so in Macports?
Changed 12 years ago by jdgleeson
Attachment: | patch-tests-test_disconnect_inproc.cpp.diff added |
---|
Changed 12 years ago by jdgleeson
Attachment: | Portfile-zmq.diff added |
---|
comment:9 Changed 11 years ago by eborisch (Eric A. Borisch)
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?)
Changed 11 years ago by eborisch (Eric A. Borisch)
comment:11 Changed 11 years ago by eborisch (Eric A. Borisch)
I see above someone has already confirmed strndup for lion.
comment:12 Changed 11 years ago 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.
comment:13 Changed 11 years ago by eborisch (Eric A. Borisch)
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.
comment:14 Changed 11 years ago by merijn (Merijn Verstraaten)
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.
Changed 11 years ago by merijn (Merijn Verstraaten)
Attachment: | zmq.2.patch added |
---|
Patch for Portfile + patch
comment:15 Changed 11 years ago by neverpanic (Clemens Lang)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Commited in r106263. Thanks.
comment:16 follow-up: 17 Changed 11 years ago by samuel.bateman@…
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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
comment:17 Changed 11 years ago by merijn (Merijn Verstraaten)
Replying to 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.
comment:18 Changed 11 years ago 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 :-)
comment:19 Changed 11 years ago by neverpanic (Clemens Lang)
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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.
comment:20 Changed 11 years ago by eborisch (Eric A. Borisch)
Succeeded on the Buildbot, for the record.
stdout/err