Created attachment 233917 [details] diferent place of includet files Make asterisk16 result: gmake[2]: Entering directory '/usr/ports/net/asterisk16/work/asterisk-16.26.0' CC="cc" CXX="c++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" gmake -C menuselect CONFIGURE_SILENT="--silent" menuselect gmake[3]: Entering directory '/usr/ports/net/asterisk16/work/asterisk-16.26.0/menuselect' cc -g -D_GNU_SOURCE -Wall -Wno-deprecated-declarations -isystem /usr/local/include -DHAVE_NCURSES -c -o menuselect.o menuselect.c menuselect.c:35:10: fatal error: 'libxml/parser.h' file not found #include <libxml/parser.h> ^~~~~~~~~~~~~~~~~ 1 error generated. gmake[3]: *** [<builtin>: menuselect.o] Error 1 gmake[3]: Leaving directory '/usr/ports/net/asterisk16/work/asterisk-16.26.0/menuselect' gmake[2]: *** [Makefile:1051: menuselect/menuselect] Error 2 gmake[2]: Leaving directory '/usr/ports/net/asterisk16/work/asterisk-16.26.0' *** Error code 2 Stop. make[1]: stopped in /usr/ports/net/asterisk16 *** Error code 1 Stop. make: stopped in /usr/ports/net/asterisk16
Hi, This is a strange error. Not sure why it's happening on your system. The patch you provide is not generally correct, since that difference in include path should be taken care of by the pkgconf output. On my system: > pkgconf --cflags libxml-2.0 -I/usr/local/include/libxml2 (not correct as in, while it may fix the issue on your system, it is working around some deeper issue that I'd like to identify before creating any patches, if at all needed) Could you provide the output of `pkgconf --cflags libxml-2.0` on the affected machine? While here it would be useful if you could attach the whole failed build output and maybe even the config.log file from the workdir. It could give insight on why the -I/usr/local/include/libxml2 output of pkgconf is different or not applied on your system. Also maybe a simple `pkg upgrade -f libxml2` (or rebuild of the libxml2 port) could fix the issue you're seeing (or maybe not, just guessing here)
Before and after reinstall libxml2 result from 'pkgconf --cflags libxml-2.0' is: -I/usr/local/include/libxml2 There are full make output and config.log
Created attachment 233919 [details] full make output
Created attachment 233920 [details] config log
Hi, I made a few tests here and everything is working fine. I'll try to make more, but I cannot find any issue right away. The asterisk Makefile you modified already contains: menuselect.o: CFLAGS+=$(LIBXML2_INCLUDE) which adds the required flags; flags the configure script found correctly. Are you compiling on the live system? In that case have you ran make clean before the build? Just to make sure nothing is left over from a previous run? Also do you have any non default options set? Maybe some options combination could explain what you are seeing. Could you send the output of "make showconfig" in the asterisk port directory? I really have no clue at this point what is going wrong in your system. From my vintage point everything looks fine actually, but I could be missing something. I need your help to figure it out.
Looking at the build system, maybe looking at the content of the files: makeopts menuselect/makeopts (if present) could help. Although I expect to find there the correct include path. Why it is not included in the compiler command line in your case is a mystery to me.
(In reply to Guido Falsi from comment #5) Yes compilation in on live system. I made clean every time before make. I'm using not default options (attached options-diff).
Created attachment 233948 [details] showconfig
Created attachment 233949 [details] makeopts
Created attachment 233950 [details] menuselect makeopts
Created attachment 233951 [details] diff default options and modified
I make test with default options - compilation failed again. What I saw is that variable LIBXML2_INCLUDE in menuselect/makeopts is empty.
(In reply to vess from comment #12) Well I need to check how that could happen, but that's the problem. It should not be empty. even more strange it is correctly populated i the root makeopt. Could you look in menuselect/makeopts.in ? Does the line about LIBXML2_INCLUDE look like this? LIBXML2_INCLUDE=@LIBXML2_INCLUDE@ Are you sure you have no local modifications to your ports tree? Have you tried building in a clean jail or another system? I've tested in a few VMs and machines (and in poudriere obviously) and never seen a beahviour like this.
The line in makeopts.in: LIBXML2_INCLUDE=@LIBXML2_INCLUDE@ In new cloned ports tree on live system - make failed. In jail on the same pc - success. Obviously on 'failed' live system something goes wrong - environment or something else. How will find it ... I have not idea... Whatever, many thanks for support. Sorry for your lost time. If you decide, close bug report as solved. When (if) I will find problem, will write comment or inform you, if you interested of it.
(In reply to vess from comment #14) We can leave this one open so you can post why it happens if you discover it. I'm not sure what could be causing this. You could also try removing the ports tree and extracting it from scratch. Also check anything in make.conf.
Eureka, devel/pkgconf (1.8.0,1) breaks menuselect/configure pkgconf is installed as dependency of other packages When I remove pkgconf compilation is successful for both versions of asterisk (16,18) I wonder if You can reproduce the same bug
(In reply to vess from comment #16) I'll try to reproduce this. I guess it's easy to reproduce. I'll also need to check how to make it not happen in the future. I'll need to modify the configure script somehow. It's unfortunate that such things happen, but this is why everyone is moving away from building software on live systems and using isolation tools, like poudriere, jails or CI solutions. It's impossible to prevent some random installed package from interfering with the build. In fact the system could have a modified version of some random binary installed for whatever reason and there is no way to avoid that.
(In reply to vess from comment #16) Actually the defaault asterisk configuration has the PJSIP option turned on and that one pulls a dependency on devel/pkgconf. So it's strange that it broke for you. But you have PJSIP off, so maybe a stale pkgconf happening to be there could cause this. Anyway I actually think that the dependency on pkgconf should always be active, not only for the pjsip option. I'll send a simple patch for you to test shortly, although the test is not completely conclusive if it works for you I guess it's not wrong.
Created attachment 233996 [details] patch v1 Please test with this patch. It's relative to the ports tree root, and includes changes to both asterisk ports, since both require this. Thanks.
Comment on attachment 233996 [details] patch v1 Ok, my bad, this makes things worse and uncovers some issue. I need time to investigate.
I identified the root of the problem, and filed a bug report upstream: https://issues.asterisk.org/jira/browse/ASTERISK-30068 For now I'll commit a workaround to the ports tree, and then will try to find time to post a proper fix upstream (unless someone else beats me to it) Short description: The menuselect/configure script has a bug, it tries to use a $SED variable before filling it in with the path to sed, causing a wrong command line and empty output filling the LIBXML2_INCLUDE variable. This happens only with certain options combinations.
Adding another upstream bug, mine was marked as duplicate of it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9dd2f21478d0f8379f010677c74d917361e1ecea commit 9dd2f21478d0f8379f010677c74d917361e1ecea Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2022-05-17 15:12:31 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2022-05-17 15:14:20 +0000 net/asterisk18: Fix configure issue when PJSIP option is disabled pkgconfig is now used by asterisk to detect most required dependencies, so add it to the global USES. At the same time there is a bug in the menuselect configure script that shows up when the PJSIP option is disabled. It tries to run sed through a $SED variable before populating it. As a workaround for now I just replace the $SED variable with the bare sed command. PR: 263980 Fixes: 8d2283b7663ce9 net/asterisk18/Makefile | 3 +-- net/asterisk18/files/patch-menuselect_configure (new) | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f7aef8540293ec1a4e47857ccec9592023c953c5 commit f7aef8540293ec1a4e47857ccec9592023c953c5 Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2022-05-17 15:10:31 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2022-05-17 15:14:20 +0000 net/asterisk16: Fix configure issue when PJSIP option is disabled pkgconfig is now used by asterisk to detect most required dependencies, so add it to the global USES. At the same time there is a bug in the menuselect configure script that shows up when the PJSIP option is disabled. It tries to run sed through a $SED variable before populating it. As a workaround for now I just replace the $SED variable with the bare sed command. PR: 263980 Fixes: e8e6fba878cf12 net/asterisk16/Makefile | 3 +-- net/asterisk16/files/patch-menuselect_configure (new) | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-)
Should be fixed by the commits reported in this bug history.