Bug 254570 - security/fwknop Fix compilation error on 13 and 14
Summary: security/fwknop Fix compilation error on 13 and 14
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: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-26 09:14 UTC by Jens Grassel
Modified: 2021-04-08 18:58 UTC (History)
2 users (show)

See Also:
sean.greven: maintainer-feedback+
sean.greven: maintainer-feedback+


Attachments
Fix compilation error on FreeBSD 13 and 14. (1.42 KB, patch)
2021-03-26 09:14 UTC, Jens Grassel
no flags Details | Diff
Fix compilation error on 13 and 14. (1.30 KB, patch)
2021-03-30 14:07 UTC, Jens Grassel
no flags Details | Diff
patch for fwknop to fix compilation error (1.72 KB, patch)
2021-04-03 12:16 UTC, sean.greven
sean.greven: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Grassel 2021-03-26 09:14:12 UTC
Created attachment 223598 [details]
Fix compilation error on FreeBSD 13 and 14.

Hi,

I've attached a patch that fixes the compilation error (ld: error: duplicate symbol: log_level_t) on FreeBSD 13 and 14.

Kind regards,

Jens
Comment 1 sean.greven 2021-03-27 06:01:06 UTC
Comment on attachment 223598 [details]
Fix compilation error on FreeBSD 13 and 14.

Hey Jens, thank you for creating this diff.
I am unable to apply this patch and I suspect I am doing something drastically wrong.  
I manually created the file patch-client_log__msg.h
and updated the Makefile with the changes however when I try run make I get:
root@BBD13RC3:/usr/ports/security/fwknop # make
===>  Patching for fwknop-2.6.10_2
===>  Applying FreeBSD patches for fwknop-2.6.10_2 from /usr/ports/security/fwknop/files
File to patch:
and when I point that to the log_msg.h file manually it patches the file but ends up with an error anyway.

./log_msg.h:1:1: error: expected identifier or '('
--- client/log_msg.h.orig      2021-03-26 08:55:00 UTC
^
./log_msg.h:7:2: error: extraneous closing brace ('}')
-} log_level_t;
 ^
./log_msg.h:7:4: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
-} log_level_t;
   ^
./log_msg.h:8:1: error: expected external declaration
+};
^
./log_msg.h:8:2: error: extraneous closing brace ('}')
+};
 ^
./log_msg.h:52:3: error: redefinition of 'log_level_t' with a different type: 'enum (anonymous enum at ./log_msg.h:43:1)' vs 'int'
} log_level_t;
  ^
./log_msg.h:7:4: note: previous definition is here
-} log_level_t;
   ^
1 warning and 5 errors generated.
*** [fwknop-fwknop.o] Error code 1

Any ideas
Comment 2 Jens Grassel 2021-03-29 07:36:10 UTC
(In reply to sean.greven from comment #1)

Hi,

likely I've messed up the patch. I'll re-create a proper one. Stay tuned.

Sorry for the inconvenience,

Jens
Comment 3 Jens Grassel 2021-03-30 14:07:18 UTC
Created attachment 223710 [details]
Fix compilation error on 13 and 14.

Hi,

here is another patch. For me it works.

Kind regards,

Jens
Comment 4 sean.greven 2021-03-31 10:13:38 UTC
Comment on attachment 223710 [details]
Fix compilation error on 13 and 14.

Hey jens

Still running into patching issues.  I am now using git to replicate the same procedure you have used to create the patch.  I init the repository in /usr/ports and I create the patch file there.
I apply the patch:
And the results are as below.

root@BBD13RC3:/usr/ports/security/fwknop # uname -a
FreeBSD BBD13RC3 13.0-RC3 FreeBSD 13.0-RC3 #0 releng/13.0-n244696-8f731a397ad: Fri Mar 19 04:00:20 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
root@BBD13RC3:/usr/ports/security/fwknop #

root@BBD13RC3:/usr/ports # pwd
/usr/ports
root@BBD13RC3:/usr/ports # git apply patch.pat
root@BBD13RC3:/usr/ports # cd security/fwknop


####Just checking here that the files have been modified with todays date.

root@BBD13RC3:/usr/ports/security/fwknop # ls -la Makefile files/patch-client_log__msg.h
-rw-r--r--  1 root  wheel  1277 Mar 31 20:01 Makefile
-rw-r--r--  1 root  wheel   414 Mar 31 20:01 files/patch-client_log__msg.h

### The are indeed modified and the patch file has been placed into the files dir

root@BBD13RC3:/usr/ports/security/fwknop # make
===>  License GPLv2 accepted by the user
===>   fwknop-2.6.10_2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by fwknop-2.6.10_2 for building
===>  Extracting for fwknop-2.6.10_2
=> SHA256 Checksum OK for fwknop-2.6.10.tar.gz.
===>  Patching for fwknop-2.6.10_2
===>  Applying FreeBSD patches for fwknop-2.6.10_2 from /usr/ports/security/fwknop/files
File to patch:

### And of course it breaks here
Comment 5 sean.greven 2021-04-03 12:16:48 UTC
Created attachment 223785 [details]
patch for fwknop to fix compilation error

Thanks to jens for pointing me in the right direction.
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-04-08 18:58:25 UTC
A commit in branch main references this bug:

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

commit 29a38528ec03a278dbad9e165195570ad575be0d
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2021-04-08 18:56:17 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-04-08 18:58:07 +0000

    security/fwknop: Fix compilation on FreeBSD 13+

    PR:             254570
    Reported by:    Jens Grassel <freebsd-ports@jan0sch.de>
    Approved by:    Sean Greven <sean.greven@gmail.com> (maintainer)

 security/fwknop/Makefile                            |  5 +----
 security/fwknop/files/patch-client_log__msg.h (new) | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)
Comment 7 Kevin Bowling freebsd_committer freebsd_triage 2021-04-08 18:58:55 UTC
Committed, thanks!