Augustin-FL / building-pfsense-iso-from-source

How to: Building a pfSense .iso from sources
54 stars 50 forks source link

missing libpfctl.h while compiling "php-myfirewall-module" #47

Closed kontrol-br closed 2 years ago

kontrol-br commented 3 years ago

hello Augustin, Good morning/afternoon. php74-Kontrol-module-0.72.log

Did you try to compile RELENG_2_5_2 version? Have you faced the issue below? I am getting the error message below while compiling the port "php-kontrol-module" - that file is required to compile the "security/pfSense" port - In my case, "security/Kontrol" port.

Error message: ` --- Kontrol.lo --- /wrkdirs/usr/ports/devel/php-Kontrol-module/work-php74/Kontrol-0.72/Kontrol.c:96:10: fatal error: 'libpfctl.h' file not found

include

     ^~~~~~~~~~~~

`

I have searched for the libpfctl.h and here is what I found:

`find / -iname "libpfctl.h"

/usr/src/lib/libpfctl/libpfctl.h /usr/obj/usr/src/amd64.amd64/tmp/usr/include/libpfctl.h /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/usr/include/libpfctl.h /usr/include/libpfctl.h ` Knowing that, I am not sure why the port is complaining about the #include. This is the first time I see such error. I have compiled the RELENG_2_5_0 and 2_5_1 with absolutely no errors.

I have also attached the log file, just in case.

Thanks Fabricio.

Augustin-FL commented 3 years ago

Knowing that, I am not sure why the port is complaining about the #include.

Ports are being compiled inside the created jail. The jail itself is created using freebsd-src

So you should check if libpfctl.h is inside FreeBSD-src.

What branch of freebsd-src are you using?

kontrol-br commented 3 years ago

Knowing that, I am not sure why the port is complaining about the #include.

Ports are being compiled inside the created jail. The jail itself is created using freebsd-src

So you should check if libpfctl.h is inside FreeBSD-src.

What branch of freebsd-src are you using?

Hello Augustin, Yes, that I knew. What I didn't know was for some reason my "/src/tools/builder_defaults.sh" was still pointing to Releng_2_5_0 which doesn't contain the pfctl library included. That was included only in the 2_5_2 version. I have repointed to ver 2_5_2 and I got it compiled now.

Thanks! Fabricio.

kontrol-br commented 3 years ago

Sorry for resurrecting this issue, but something is not right.

See that netgate moved the RELENG_2_5_2 back to "FreeBSD_src RELENG_2_5_0" which doesn't contain the "/include/libpfctl.h" so the error message has returned.

See here that is pointing to 2.5.0 --> https://github.com/pfsense/pfsense/blob/RELENG_2_5_2/tools/builder_defaults.sh (line 111)

and see here when they moved it back to 2.5.0 --> https://github.com/pfsense/pfsense/commit/2e248c0ea6ed35229ece47bb0d2626a0cab621f1

The reason I don't know, maybe they forgot the include. I know they don't use the github code for real compiling but an internal git/svn.

Now the question is: Why did they change it back to RELENG_2_5_0 as that causes a compilation error. The solution for that is to insert the missing "include" files into FreeBSD-src source and recreate the poudriere with it.

Regards Fabricio.

Augustin-FL commented 2 years ago

Hi,

I don't know why netgetate decided to do this...On FreeBSD-src we can see that some commits were applied to 2.5.2 just few days before the switch. Maybe it was to test the behavior/difference between the two kernels? (I don't know, I'm just making assumption...)

Anyway, it should not be a big issue, since this is a default variable : just set FREEBSD_BRANCH=RELENG_2_5_2 in your build.conf and you should be good?

I'm going to close this. If this kind of issue arise again, I'd suggest to simply let a comment under the commit responsible for the change ?