signalapp / libsignal-protocol-c

GNU General Public License v3.0
1.41k stars 295 forks source link

Included uthash 2.0.1 conflicts with pre-installed uthash 2.2.0 #148

Open holsta opened 3 years ago

holsta commented 3 years ago

I have:


Bug description

OpenBSD has uthash 2.2.0 as a package and because of the search order of libsignal-protocol-c, compiling fails with:

` FAILED: tests/CMakeFiles/test_group_cipher.dir/test_group_cipher.c.o /usr/obj/ports/libsignal-protocol-c-2.3.3/bin/cc -I/usr/local/include -I/usr/obj/ports/libsignal-protocol-c-2.3.3/libsignal-protocol-c-2.3.3/tests/. +-I/usr/obj/ports/libsignal-protocol-c-2.3.3/libsignal-protocol-c-2.3.3/tests/../src -O2 -pipe -fmessage-length=0 -Wall -Wmissing-field-initializers +-Wno-missing-braces -Wparentheses -Wswitch -Wunused-variable -Wunused-value -Wshadow -Wint-conversion -Wpointer-sign -Wprotocol -Wshorten-64-to-32 +-Wno-unused-function -Wno-invalid-source-encoding -Wno-shorten-64-to-32 -DNDEBUG -MD -MT tests/CMakeFiles/test_group_cipher.dir/test_group_cipher.c.o -MF +tests/CMakeFiles/test_group_cipher.dir/test_group_cipher.c.o.d -o tests/CMakeFiles/test_group_cipher.dir/test_group_cipher.c.o -c +/usr/obj/ports/libsignal-protocol-c-2.3.3/libsignal-protocol-c-2.3.3/tests/test_group_cipher.c In file included from /usr/obj/ports/libsignal-protocol-c-2.3.3/libsignal-protocol-c-2.3.3/tests/test_group_cipher.c:11: In file included from /usr/obj/ports/libsignal-protocol-c-2.3.3/libsignal-protocol-c-2.3.3/tests/./test_utarray.h:8: /usr/local/include/utarray.h:42:2: error: "The name of macro 'oom' has been changed to 'utarray_oom'. Please update your code."

error "The name of macro 'oom' has been changed to 'utarray_oom'. Please update your code."

^ 1 error generated. `

Steps to reproduce

For now, I have renamed the utarray.c, utlist.c and uthash.c files inside Signal to *_local.h and that should make it into the upcoming OpenBSD 6.9.

Updating the uthash version shipped with libsignal seems like a short-lived solution. I feel libsignal-protocol-c should have a hermetic build process. At minimum, the build include order should be switched or uthash should be an external requirement. Which solution would you accept in a PR?