Bug 269048 - textproc/libucl: build fails if devel/uthash is installed (also textproc/py-ucl)
Summary: textproc/libucl: build fails if devel/uthash is installed (also textproc/py-ucl)
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-19 09:15 UTC by John Hein
Modified: 2024-03-23 20:05 UTC (History)
3 users (show)

See Also:
jcfyecrayz: maintainer-feedback? (bofh)


Attachments
[patch] fix build if devel/uthash installed; unbreak SIGNATURES; use libfetch instead of libcurl, etc. (2.66 KB, patch)
2023-01-19 09:15 UTC, John Hein
jcfyecrayz: maintainer-approval? (bofh)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2023-01-19 09:15:41 UTC
Created attachment 239584 [details]
[patch] fix build if devel/uthash installed; unbreak SIGNATURES; use libfetch instead of libcurl, etc.

textproc/libucl has a compile error if devel/uthash is installed:

============
 .
 .
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I../uthash -I../src -I../include -I../uthash -I../klib -Wall -W -Wno-unused-parameter -Wno-pointer-sign -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT libucl_la-ucl_emitter_utils.lo -MD -MP -MF .deps/libucl_la-ucl_emitter_utils.Tpo -c ucl_emitter_utils.c  -fPIC -DPIC -o .libs/libucl_la-ucl_emitter_utils.o
ucl_emitter_utils.c:222:3: warning: implicit declaration of function 'utstring_append_c' is invalid in C99 [-Wimplicit-function-declaration]
                utstring_append_c (buf, c);
                ^
ucl_emitter_utils.c:239:2: warning: implicit declaration of function 'utstring_append_len' is invalid in C99 [-Wimplicit-function-declaration]
        utstring_append_len (buf, str, len);
        ^
ucl_emitter_utils.c:419:6: error: no member named 'pd' in 'UT_string'
                s->pd = pmem;
                ~  ^
 .
 .
============

This is because devel/uthash is 2.3.0 and the uthash that is bundled with libucl is 1.9.8. There is an API difference between and libucl source code is written for the latter version.


Also, textproc/py-ucl fails as well if devel/uthash is installed - in a different spot:

============
 .
 .
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -fPIC -DCURL_FOUND=1 -Iinclude -Isrc -Iuthash -Iklib -c src/ucl_schema.c -o build/temp.freebsd-12.4-STABLE-20221129-amd64-cpython-39/src/ucl_schema.o
src/ucl_schema.c:387:46: error: expected ')'
                                                "string is too big: %u, maximum is: %" PRId64,
                                                                                       ^
src/ucl_schema.c:398:48: error: expected ')'
                                                "string is too short: %u, minimum is: %" PRId64,
                                                                                         ^
 .
 .
============

See also the upstream bug https://github.com/vstakhov/libucl/issues/266 (now fixed).

A difference between 2.3.0 and 1.9.8 contributes to that problem as well (described in the upstream bug).

Attached is a patch that ensures that the bundled uthash header-only source code - against which the current libucl was written - is used instead of uthash that may be installed to ${LOCALBASE}.


While here:

 - textproc/py-ucl: fix "second build" failure (see upstream https://github.com/vstakhov/libucl/issues/268)

 - Remove version restriction for USES=python in py-ucl - this python module works with any version of python.

 - Replace curl dependency in py-ucl with libfetch. Not only does this reduce dependencies, but it also matches how libucl.so is built.

 - SIGNATURES option has not been broken for a long time now. Fixed upstream in 2020. Included in 0.8.2 release. Builds fine in poudriere or out.

 - Minor rearrangement of some sections based on portclippy suggested ordering.


QA:
 - poudriere testport (ok: libucl with default options and with LUA, SIGNATURES, URLS on; ok: py-ucl)
 - portlint & portclippy (ok - fewer "problems" reported)

PORTREVISION bump is not necessary since this is a build fix for environments that may not be building.  If the SIGNATURES option is changed to be on by default (maybe a good idea now that it is no longer broken, but not included in the attached patch), that would require a PORTREVISION bump.