Bug 283584 - irc/eggdrop: Fails to build due to tcl.h header location
Summary: irc/eggdrop: Fails to build due to tcl.h header location
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-25 06:36 UTC by ek
Modified: 2025-02-04 16:06 UTC (History)
5 users (show)

See Also:
cpetrik: maintainer-feedback+


Attachments
tcl.h_patch.diff (571 bytes, patch)
2024-12-25 06:36 UTC, ek
no flags Details | Diff
Build log failure (538.86 KB, text/plain)
2024-12-28 22:27 UTC, ek
no flags Details
add in gcc (335 bytes, patch)
2024-12-29 01:23 UTC, Chris Petrik
no flags Details | Diff
Remove Reinplace (424 bytes, patch)
2024-12-29 04:10 UTC, Chris Petrik
no flags Details | Diff
eggdrop tcl.h location fix (424 bytes, patch)
2025-01-29 06:00 UTC, ek
ek: maintainer-approval? (cpetrik)
Details | Diff
Build log (680.28 KB, text/plain)
2025-01-29 16:41 UTC, ek
no flags Details
patch file (487 bytes, patch)
2025-01-29 17:33 UTC, Chris Petrik
cpetrik: maintainer-approval+
Details | Diff
patch with rev (667 bytes, patch)
2025-01-29 18:00 UTC, Chris Petrik
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ek 2024-12-25 06:36:17 UTC
Created attachment 256123 [details]
tcl.h_patch.diff

During a port build, I got the error:

5 warnings generated.
cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing    -fstack-protector-strong  -shared -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -pipe -Wall -I. -I../../.. -I../../..  -I../../../src/mod -I/usr/include -DHAVE_CONFIG_H -I/usr/local/include/tcl8.6 -o ../../../pbkdf2.so ../pbkdf2.o -L/usr/lib -L/usr/local/lib -ltcl86  -lz -lpthread -lm -lssl -lcrypto  && touch ../../../pbkdf2.so
cc -fPIC -I/usr/local/include/python3.11 -I/usr/local/include/python3.11  -Wsign-compare -Wunreachable-code -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -DNDEBUG -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -pipe -Wall -I. -I../../.. -I../../..  -I../../../src/mod -I/usr/include -DHAVE_CONFIG_H -I/usr/local/include/tcl8.6  -DMAKING_MODS -c .././python.mod/python.c && mv -f python.o ../
In file included from .././python.mod/python.c:46:
.././python.mod/pycmds.c:25:10: fatal error: 'tcl8.6/tcl.h' file not found
   25 | #include <tcl8.6/tcl.h>
      |          ^~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/irc/eggdrop/work/eggdrop-1.10.0/src/mod/python.mod
*** Error code 1

It appears the location of tcl.h doesn't need to have the REINPLACE_CMD and it builds fine if commented out (or removed. Patch attached.)
Comment 1 Zsolt Udvari freebsd_committer freebsd_triage 2024-12-28 07:13:25 UTC
I can build now with poudriere, latest ports tree. How did you try it build?
Comment 2 ek 2024-12-28 22:27:44 UTC
Created attachment 256240 [details]
Build log failure
Comment 3 ek 2024-12-28 22:28:12 UTC
(In reply to Zsolt Udvari from comment #1)

Hello,

I just built straight from ports with the latest tree (just pulled again to be sure.) I've attached the build log in case you're curious. The "tcl8.6/tcl.h" header file does exist in /usr/local/include:

# ls -al /usr/local/include/tcl8.6/tcl.h
-rw-r--r--  1 root wheel 94238 Dec 24 22:38 /usr/local/include/tcl8.6/tcl.h

It looks like what is happening is that the ${TCL_INCLUDEDIR} variable is already set with the ${TCL_VER} (verified by running "make -V TCL_INCLUDEDIR" in irc/eggdrop directory.)

So, it's looking for the "tcl.h" header file in /usr/local/include/tcl8.6/tcl8.6/ when the @${REINPLACE_CMD} is run for the ${WRKSRC}/src/mod/python.mod/pycmds.c file.

Have you tried testing in Poudriere to see if it builds fine without this reinplace command? I'd be curious to know why the ${TCL_INCLUDEDIR} would be different inside and outside of Poudriere.
Comment 4 Chris Petrik 2024-12-29 01:17:50 UTC
Port fails to compile as well as fails to find tcl.h
Comment 5 Chris Petrik 2024-12-29 01:21:20 UTC
.././filesys.mod/filedb3.h:97:5: note: expanded from macro 'malloc_strcpy'
   97 |     my_free(target);                                                    \
      |     ^
.././filesys.mod/filedb3.h:83:5: note: expanded from macro 'my_free'
   83 |     nfree(ptr);                                                         \
      |     ^
../../../src/mod/module.h:92:28: note: expanded from macro 'nfree'
   92 | #define nfree(x) (global[1]((x),MODULE_NAME,__FILE__,__LINE__))
      |                            ^
In file included from .././filesys.mod/filesys.c:126:
.././filesys.mod/files.c:748:7: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
  748 |       malloc_strcpy(newfn, par);
      |       ^
.././filesys.mod/filedb3.h:94:16: note: expanded from macro 'malloc_strcpy'
   94 |     (target) = nrealloc((target), strlen(entry) + 1);                   \
      |                ^
../../../src/mod/module.h:392:50: note: expanded from macro 'nrealloc'
  392 | #define nrealloc(x,y) (((void *(*)())global[230])((x),(y),MODULE_NAME,__FILE__,__LINE__))
      |                                                  ^
In file included from .././filesys.mod/filesys.c:126:
.././filesys.mod/files.c:748:7: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
.././filesys.mod/filedb3.h:97:5: note: expanded from macro 'malloc_strcpy'
   97 |     my_free(target);                                                    \
      |     ^
.././filesys.mod/filedb3.h:83:5: note: expanded from macro 'my_free'
   83 |     nfree(ptr);                                                         \
      |     ^
../../../src/mod/module.h:92:28: note: expanded from macro 'nfree'
   92 | #define nfree(x) (global[1]((x),MODULE_NAME,__FILE__,__LINE__))
      |                            ^
In file included from .././filesys.mod/filesys.c:126:
.././filesys.mod/files.c:752:7: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
  752 |       my_free(newfn);
      |       ^
.././filesys.mod/filedb3.h:83:5: note: expanded from macro 'my_free'
   83 |     nfree(ptr);                                                         \
      |     ^
../../../src/mod/module.h:92:28: note: expanded from macro 'nfree'
   92 | #define nfree(x) (global[1]((x),MODULE_NAME,__FILE__,__LINE__))
      |                            ^
In file included from .././filesys.mod/filesys.c:126:
.././filesys.mod/files.c:753:7: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
  753 |       my_free(newpath);
      |       ^
.././filesys.mod/filedb3.h:83:5: note: expanded from macro 'my_free'
Comment 6 Chris Petrik 2024-12-29 01:21:42 UTC
Adding in USE_GCC fixes all these which is the real reason why I added it in the first place.
Comment 7 Chris Petrik 2024-12-29 01:23:11 UTC
Created attachment 256248 [details]
add in gcc
Comment 8 Chris Petrik 2024-12-29 01:25:33 UTC
Test run of ./eggdrop -v:
Eggdrop v1.10.0 (C) 1997 Robey Pointer (C) 1999-2024 Eggheads Development Team
Configure flags: '--with-sslinc=/usr/include' '--with-ssllib=/usr/lib' '--with-tclinc=/usr/local/include/tcl8.6/tcl.h' '--with-tcllib=/usr/local/lib/tcl8.6/libtcl86.so' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/share/man' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd14.2' 'build_alias=amd64-portbld-freebsd14.2' 'CC=gcc13' 'CFLAGS=-O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13 -fno-strict-aliasing ' 'LDFLAGS= -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13 -L/usr/local/lib/gcc13 ' 'LIBS=' 'CPPFLAGS=' 'CPP=cpp13'
Compiled with: IPv6, TLS, Threaded DNS core, handlen=32


Eggdrop successfully compiled:
-rwxr-xr-x  1 root wheel 523216 Dec 29 02:25 eggdrop


Modules successfully compiled:
-rwxr-xr-x  1 root wheel  15000 Dec 29 02:25 assoc.so
-rwxr-xr-x  1 root wheel  23384 Dec 29 02:25 blowfish.so
-rwxr-xr-x  1 root wheel 149520 Dec 29 02:25 channels.so
-rwxr-xr-x  1 root wheel  17840 Dec 29 02:25 compress.so
-rwxr-xr-x  1 root wheel  16512 Dec 29 02:25 console.so
-rwxr-xr-x  1 root wheel  15016 Dec 29 02:25 ctcp.so
-rwxr-xr-x  1 root wheel   6488 Dec 29 02:25 dns.so
-rwxr-xr-x  1 root wheel 112272 Dec 29 02:25 filesys.so
-rwxr-xr-x  1 root wheel  15368 Dec 29 02:25 ident.so
-rwxr-xr-x  1 root wheel 192744 Dec 29 02:25 irc.so
-rwxr-xr-x  1 root wheel  39096 Dec 29 02:25 notes.so
-rwxr-xr-x  1 root wheel  16208 Dec 29 02:25 pbkdf2.so
-rwxr-xr-x  1 root wheel  33600 Dec 29 02:25 python.so
-rwxr-xr-x  1 root wheel  19080 Dec 29 02:25 seen.so
-rwxr-xr-x  1 root wheel 142328 Dec 29 02:25 server.so
-rwxr-xr-x  1 root wheel  64584 Dec 29 02:25 share.so
-rwxr-xr-x  1 root wheel  47104 Dec 29 02:25 transfer.so
-rwxr-xr-x  1 root wheel  33784 Dec 29 02:25 twitch.so
-rwxr-xr-x  1 root wheel  12720 Dec 29 02:25 uptime.so


Now run "make install" to install your bot.
Comment 9 Chris Petrik 2024-12-29 01:25:49 UTC
build and install fine think we can call this fixed.
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2024-12-29 02:26:40 UTC
Current version in tree builds fine both using ports tree (tested on 14.1-RELEASE amd64) and using Poudriere (13.4-RELEASE i386) so I guess we can close this without committing anything?
Comment 11 ek 2024-12-29 03:20:18 UTC
I should have specified that I'm using 14.2-RELEASE, but it doesn't appear to make a difference. Per Chris Petrik's patch, applying the "USE_GCC=    yes" patch does fix the issue with building from the ports tree without Poudriere.

I'm completely in the dark as to how it builds within Poudriere without GCC and I'm not sure why outside of Poudriere would require GCC which is another quite large build dependency that appears to be unneeded to run irc/eggdrop without just removing the additional @${REINPLACE_CMD} for the ${WRKSRC}/src/mod/python.mod/pycmds.c file?

It's pretty confusing for me at the moment. But, I can confirm that the the USE_GCC patch does work. Just not sure why it's needed for the build outside of Poudriere. As far as I can tell, simply removing the placement of the TCL_VER for the tcl.h file works just fine.

Thanks for the quick responses, everyone!
Comment 12 Chris Petrik 2024-12-29 03:26:35 UTC
Because in the Linux world most if not all Distros use gcc and most develoeprs will use what ever is available. and it's easier for me to just use GCC than to hack the port to make it work with clang having to do it again after every release.

I call this the "Linux Syndrome"

Now saying that it would make sense to me to just add in USE_GCC since most people can pkg install gcc and not compile it.

now knowing after committing for 900+ PR in my 30 years of using FreeBSD a lot of times none of this makes any sense to what the end result does.

now if you want to waste time to get it to work like tijl did with Hiawatha and mbedtls 2.x which is a hack of the original software then go ahead.
Comment 13 Chris Petrik 2024-12-29 03:29:23 UTC
(In reply to Daniel Engberg from comment #10)
it fails to build for me as well as this other user so there is a problem with the current port.
Comment 14 Chris Petrik 2024-12-29 03:30:38 UTC
Also you aren't using the current version which is 14.2 and I am using 14.2 please upgrade your system then decide that there isnat any issues.
Comment 15 ek 2024-12-29 03:42:33 UTC
(In reply to Chris Petrik from comment #12)

Well, dang. I completely understand the frustration of the "Linux Syndrome" and I can also relate. 'Tis a shame!

I suppose my main concern or question is, why does it build from the ports tree perfectly fine when simply removing the @${REINPLACE_CMD} for the tcl.h file (no USE_GCC=yes needed) but it fails to build in Poudriere without that replacement and vice-versa?

I took a quick look through my /etc/make.conf file and see nothing that should change anything regarding a simple build of irc/eggdrop, but that certainly doesn't mean anything when it comes to this, apparently.

I mix ports and packages all the time for large builds that aren't actually needed downstream from this build server (like GCC, LLVM, RUST, etc...) so I'm fine with keeping GCC updated via pkg only. I'm really just trying to understand why I can build and run eggdrop just fine without GCC if the port finds the tcl.h header file successfully (I hope I'm making sense? Maybe I'm missing something?)

Again, I really appreciate everyone's very responsive effort on this. Cheers!
Comment 16 Chris Petrik 2024-12-29 03:55:15 UTC
Well you mix and match ports which is a problem and the commiter doesn't use the recent version of FreeBSD so not sure how to fix this as if no one here is using recent versions of the OS and not even current like ports commiters should be using any ways.
Comment 17 Chris Petrik 2024-12-29 04:01:40 UTC
i got poudriere setup and ill test and remove that reinplace
Comment 18 Chris Petrik 2024-12-29 04:06:32 UTC
As of now it build fine in poudriere but fails manually make
Comment 19 ek 2024-12-29 04:07:19 UTC
I don't see how mixing and matching ports and packages is a problem for only a few large packages that aren't actually runtime dependencies. Otherwise, it's all ports. I just can't justify building for 6+ hours for a simple update when I "pkg upgrade" a few things and build for 20-30 minutes.

I've been trying to figure out the best way to do this with Poudriere, but thus far no luck (when a new port version is available for said large build but not a package.) I'll keep poking at it, though.

My next step was thinking the same thing and just spinning up a 14.2-R Poudriere jail to test it. It seems you beat me to it. Thanks!
Comment 20 Chris Petrik 2024-12-29 04:10:56 UTC
Created attachment 256250 [details]
Remove Reinplace

works in poudriere and fails manually.
Comment 21 Chris Petrik 2024-12-29 04:13:41 UTC
(In reply to ek from comment #19)
Pkg's compile with the default options set if you install a port and change those options pkg will reinstall those causing what we call dep hell
Comment 22 ek 2024-12-29 04:19:19 UTC
(In reply to Chris Petrik from comment #20)

Hrm. Are you saying that testing with Poudriere, with and without the @${REINPLACE_CMD} for tcl.h, both build successfully? And a manually build with and without the same tcl.h file adjustment fail?

I haven't tested with Poudriere (yet), but with the @${REINPLACEMENT_CMD} for tcl.h, it failed manually. Without it, it seems to build fine.
Comment 23 ek 2024-12-29 04:21:18 UTC
(In reply to Chris Petrik from comment #21)

Yes. 100% agree. If I only need default values, I use packages (which I upgrade first.) If I need non-default values, I use ports (which I upgrade after packages.) I've never run into any problems with this method. Again, I only use packages for the big stuff to avoid massive compilation times. I don't mix all that much.
Comment 24 Chris Petrik 2024-12-29 04:22:35 UTC
Well removing REINPLACE fixed the issue to just remove the reinplace. with second patch.
Comment 25 Chris Petrik 2024-12-29 04:24:53 UTC
Don't think I have ever needed to manually compile a port ever since pkg was created. ANd FreeBSD includes port flavors as well. as cool as it is to see your computer converting code into binary it gets old after 20+ years.
Comment 26 ek 2024-12-29 04:30:24 UTC
(In reply to Chris Petrik from comment #25)

Well, on most of my servers, I need non-default options. I'm waiting for a lot of ports to provide SQL flavors and such (that would help immensely!) But, for now, it appears there is no way to avoid building my own ports as many non-default options are needed for certain things (especially mail servers.) They are coming along, though!
Comment 27 Chris Petrik 2024-12-29 04:45:51 UTC
(In reply to ek from comment #26)
I run my own mail servers but I do the nostalgic way of logging in and typing in mail this saves a lot of extra packages. spf, DMARC and DNSBL is pretty much email setup and it works fine for me I don't like to use SQL never did basically I don't like to install crap I don't need. Now in the modern world this doesn't work but when you have your own server and your own /29 and have control over everything well you can do things how you see fit.
Comment 28 ek 2024-12-29 04:52:30 UTC
(In reply to Chris Petrik from comment #27)

If they were my own personal mail servers, sure. I'd absolutely do the same. But, these are massive virtual domain/user setups that require more than simple local accounts and whatnot.

Obviously, these last few conversations have been more than off-topic, so let's jump back and keep this irc/eggdrop related if we can. :)

However, I'd be more than happy to converse about these off-topic things in more detail outside of this PR if you'd like. I'm always happy to convey and learn more info at any time!
Comment 29 Chris Petrik 2024-12-29 04:54:27 UTC
Never cared much for the topic thing oh lets join a channel for each word I want to say and then lets sub categorize those even more.

but you can pick my brain on effnet in #FeeBSDHelp channel is 99.8% dead
Comment 30 Michael Ortmann 2025-01-28 22:51:19 UTC
Upstream PR https://github.com/eggheads/eggdrop/pull/1749 should fix the bug.

Can you please give it a try and confirm?

(Until it is fixed upstream, deleting line
#include <tcl.h>
from src/mod/python.mod/pycmds.c
should be enough)
Comment 31 ek 2025-01-29 06:00:27 UTC
Created attachment 257081 [details]
eggdrop tcl.h location fix

Has no one tested this patch? I'm not sure if this is an upstream issue. It seems to just be a tcl.h location Makefile issues? If this is wrong, I apologize, but it certainly seems to work just fine for me.
Comment 32 ek 2025-01-29 16:41:52 UTC
Created attachment 257091 [details]
Build log

Build log after patch attached.
Comment 33 Chris Petrik 2025-01-29 16:47:36 UTC
Comment on attachment 257081 [details]
eggdrop tcl.h location fix

Approved
Comment 34 Chris Petrik 2025-01-29 17:33:53 UTC
Created attachment 257093 [details]
patch file

this patch removes line 25 from pycmds.c and fixes the issue as per Micheals link to github.
Comment 35 Chris Petrik 2025-01-29 18:00:54 UTC
Created attachment 257096 [details]
patch with rev

patch file with rev bump
Comment 36 Ryan Steinmetz freebsd_committer freebsd_triage 2025-01-29 18:14:22 UTC
Thanks
Comment 37 commit-hook freebsd_committer freebsd_triage 2025-01-29 18:15:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4ca613c4414b2dfaa9de5336b6da5a74aa73f5d4

commit 4ca613c4414b2dfaa9de5336b6da5a74aa73f5d4
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2025-01-29 18:12:14 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2025-01-29 18:12:14 +0000

    irc/eggdrop: Fix build, bump PORTREVISION

    PR:             283584
    Reported by:    ek@purplehat.org
    Approved by:    maintainer (cpetrik@proton.me)

 irc/eggdrop/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 38 commit-hook freebsd_committer freebsd_triage 2025-02-04 16:06:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ad07ec0635d74621800d9e69ca4e9b388906a9d0

commit ad07ec0635d74621800d9e69ca4e9b388906a9d0
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2025-02-04 16:04:41 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2025-02-04 16:05:31 +0000

    irc/eggdrop: Replace SED use with REINPLACE_CMD+patch

    PR:             283584
    Reported by:    danfe@

 irc/eggdrop/Makefile                                      |  3 +--
 irc/eggdrop/files/patch-src_mod_python.mod_pycmds.c (new) | 10 ++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)