Bug 263980 - net/asterisk16
Summary: net/asterisk16
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: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-15 08:12 UTC by vess
Modified: 2022-06-06 08:09 UTC (History)
0 users

See Also:
madpilot: maintainer-feedback+


Attachments
diferent place of includet files (356 bytes, patch)
2022-05-15 08:12 UTC, vess
no flags Details | Diff
full make output (26.87 KB, text/plain)
2022-05-15 10:16 UTC, vess
no flags Details
config log (987.23 KB, text/plain)
2022-05-15 10:16 UTC, vess
no flags Details
showconfig (1.70 KB, text/plain)
2022-05-16 05:24 UTC, vess
no flags Details
makeopts (6.43 KB, text/plain)
2022-05-16 05:25 UTC, vess
no flags Details
menuselect makeopts (517 bytes, text/plain)
2022-05-16 05:25 UTC, vess
no flags Details
diff default options and modified (1.26 KB, patch)
2022-05-16 05:26 UTC, vess
no flags Details | Diff
patch v1 (1.42 KB, patch)
2022-05-17 11:26 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vess 2022-05-15 08:12:36 UTC
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
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2022-05-15 09:45:34 UTC
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)
Comment 2 vess 2022-05-15 10:15:39 UTC
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
Comment 3 vess 2022-05-15 10:16:14 UTC
Created attachment 233919 [details]
full make output
Comment 4 vess 2022-05-15 10:16:35 UTC
Created attachment 233920 [details]
config log
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2022-05-15 17:18:00 UTC
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.
Comment 6 Guido Falsi freebsd_committer freebsd_triage 2022-05-15 17:24:44 UTC
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.
Comment 7 vess 2022-05-16 05:24:14 UTC
(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).
Comment 8 vess 2022-05-16 05:24:50 UTC
Created attachment 233948 [details]
showconfig
Comment 9 vess 2022-05-16 05:25:12 UTC
Created attachment 233949 [details]
makeopts
Comment 10 vess 2022-05-16 05:25:31 UTC
Created attachment 233950 [details]
menuselect makeopts
Comment 11 vess 2022-05-16 05:26:11 UTC
Created attachment 233951 [details]
diff default options and modified
Comment 12 vess 2022-05-16 06:22:04 UTC
I make test with default options - compilation failed again.
What I saw is that variable LIBXML2_INCLUDE in menuselect/makeopts is empty.
Comment 13 Guido Falsi freebsd_committer freebsd_triage 2022-05-16 07:33:39 UTC
(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.
Comment 14 vess 2022-05-16 08:59:41 UTC
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.
Comment 15 Guido Falsi freebsd_committer freebsd_triage 2022-05-16 10:16:08 UTC
(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.
Comment 16 vess 2022-05-17 10:15:52 UTC
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
Comment 17 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 11:04:11 UTC
(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.
Comment 18 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 11:15:09 UTC
(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.
Comment 19 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 11:26:03 UTC
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 20 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 11:34:27 UTC
Comment on attachment 233996 [details]
patch v1

Ok, my bad, this makes things worse and uncovers some issue. I need time to investigate.
Comment 21 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 14:46:43 UTC
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.
Comment 22 Guido Falsi freebsd_committer freebsd_triage 2022-05-17 15:06:54 UTC
Adding another upstream bug, mine was marked as duplicate of it.
Comment 23 commit-hook freebsd_committer freebsd_triage 2022-05-17 15:14:55 UTC
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(-)
Comment 24 commit-hook freebsd_committer freebsd_triage 2022-05-17 15:14:56 UTC
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(-)
Comment 25 Guido Falsi freebsd_committer freebsd_triage 2022-06-06 08:09:27 UTC
Should be fixed by the commits reported in this bug history.