Bug 276891 - databases/redis failed to build
Summary: databases/redis failed to build
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Yasuhiro Kimura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-08 11:40 UTC by Jekyll Chen
Modified: 2024-04-23 08:56 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (yasu)


Attachments
databases/redis build log (56.58 KB, text/plain)
2024-02-08 11:40 UTC, Jekyll Chen
no flags Details
Patch to Makefile (480 bytes, patch)
2024-04-23 08:56 UTC, Andrew
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jekyll Chen 2024-02-08 11:40:47 UTC
Created attachment 248254 [details]
databases/redis build log

The environment is FreeBSD 13.2-RELEASE-p9 with security/openssl installed.


cc  -lpthread -lm -lexecinfo -Wl,-rpath,/usr/local/lib -fstack-protector-strong  -pthread  -o redis-server adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o acl.o tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a -lm ../deps/hiredis/libhiredis_ssl.a -L/usr/local/lib -lssl -L/usr/local/lib -lcrypto
ld: error: undefined symbol: SSL_get_peer_certificate
>>> referenced by tls.c
>>>               tls.o:(connTLSGetPeerCert)
>>> did you mean: SSL_get0_peer_certificate
>>> defined in: /usr/local/lib/libssl.so
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [Makefile:408: redis-server] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[3]: Leaving directory '/usr/ports/databases/redis/work/redis-7.2.4/src'
gmake[2]: *** [Makefile:6: all] Error 2
gmake[2]: Leaving directory '/usr/ports/databases/redis/work/redis-7.2.4'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/redis
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/redis
root@FreeBSD[/usr/ports/databases/redis]#
Comment 1 Jekyll Chen 2024-02-08 11:42:14 UTC
For me it looks like the same issue as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274512 , the hotfix provided there also works here.
Comment 2 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-02-08 14:29:19 UTC
(In reply to Jekyll Chen from comment #0)

Do you add 'DEFAULT_VERSIONS+=ssl=openssl' in /etc/make.conf?
Comment 3 Jekyll Chen 2024-02-09 04:43:54 UTC
(In reply to Yasuhiro Kimura from comment #2)
Yes, I added it since long ago.
I tried commenting it out, and it warns "You have security/openssl installed but do not have DEFAULT_VERSIONS+=ssl=openssl set in your make.conf" and build still failed.
Comment 4 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-02-09 07:00:06 UTC
(In reply to Jekyll Chen from comment #3)

I tried following steps.

1. Make clean install of 13.2-RELEASE amd64
2. Checkout latest main branch of ports tree
3. Add 'DEFAULT_VERSIONS+=ssl=openssl' to /etc/make.conf
4. cd /usr/ports/databases/redis
5. make

And build succeeds without any problem.
Comment 5 Jekyll Chen 2024-02-09 07:03:33 UTC
(In reply to Yasuhiro Kimura from comment #4)
Is there anything I can do for trouble shooting?
Comment 6 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-02-09 07:16:59 UTC
(In reply to Jekyll Chen from comment #5)

Q1. Did you make clean install of 13.2-RELEASE or upgrade from pervious version?
Q2. Are all installed packages built after 'DEFAULT_VERSIONS+=ssl=openssl' is added to /etc/make.conf
Q3. Are there any non-default option settings about all installed packages?
Q4. Do you have any other settings in /etc/make.conf?
Comment 7 Jekyll Chen 2024-02-09 07:25:43 UTC
(In reply to Yasuhiro Kimura from comment #6)

A1. It's been upgraded from previous versions several times with building from source.
A2. I believe so, since it was added long time ago.
A3. I bet yes... but I can't detail what were changed.
A4. The other setting there is OPTIONS_UNSET=X11 .
Comment 8 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-02-09 08:28:51 UTC
(In reply to Jekyll Chen from comment #7)

Are all installed packages up-to-date? If not update all outdated packages and try again.
Comment 9 Jekyll Chen 2024-02-09 09:33:57 UTC
(In reply to Yasuhiro Kimura from comment #8)

They are. Only redis is behind head.
Comment 10 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-02-09 12:50:30 UTC
(In reply to Jekyll Chen from comment #9)

Umm...then my suggestion is to deinstall all packages and reinstall them again. IMHO such weirdness sometimes happnes if you have used FreeBSD ports collecton under non-cleanroom environment. That's why I switched to use poudriere except one system that is used for ports development. And for the system I periodically do the cleanup of installed packages by deinstalling all of them and installing
necessary ones again.
Comment 11 Jekyll Chen 2024-02-10 15:33:28 UTC
(In reply to Yasuhiro Kimura from comment #10)

I'm trying portmaster -af and will update the result. Thank you.
Comment 12 Jekyll Chen 2024-02-10 17:49:40 UTC
(In reply to Yasuhiro Kimura from comment #10)

Unfortunately, portmaster -af failed again.
However, I compared the failed log with succeeded log from my other machine, I found that there are two additional "-L/usr/local/lib" near the end of the failing command below. I tried manually running the command with them deleted and the command executed successfully. Do you have any idea what might cause this issue?

cc  -lpthread -lm -lexecinfo -Wl,-rpath,/usr/local/lib -fstack-protector-strong  -pthread  -o redis-server adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o acl.o tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a -lm ../deps/hiredis/libhiredis_ssl.a -L/usr/local/lib -lssl -L/usr/local/lib -lcrypto
Comment 13 Andrew 2024-04-23 08:56:50 UTC
Created attachment 250169 [details]
Patch to Makefile

Just hit the problem, compiling 2024Q2 on releng/13.3.

Solved by patching as suggested in the 1st comment of bug 274512