Bug 252907 - [patch] misc/dahdi-kmod and misc/dahdi-kmod26 need -Wmisleading-indentation removed.
Summary: [patch] misc/dahdi-kmod and misc/dahdi-kmod26 need -Wmisleading-indentation r...
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: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-22 05:09 UTC by dgilbert
Modified: 2022-01-12 21:47 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (fjoe)


Attachments
poudriere build log for dahdi-kmod26 on 12.2 (33.27 KB, text/plain)
2021-01-22 05:09 UTC, dgilbert
no flags Details
patch for misc/dahdi-kmod (419 bytes, patch)
2021-01-25 14:48 UTC, dgilbert
no flags Details | Diff
patch for misc/dahdi-kmod26 (440 bytes, patch)
2021-01-25 14:49 UTC, dgilbert
no flags Details | Diff
Patch to fix indentation problem (379 bytes, patch)
2021-11-01 17:40 UTC, Greg Balfour
no flags Details | Diff
patch to fix BROKEN (296 bytes, text/plain)
2021-11-01 19:49 UTC, Greg Balfour
no flags Details
Complete fix for dahdi-kmod (759 bytes, patch)
2021-11-10 11:29 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dgilbert 2021-01-22 05:09:22 UTC
Created attachment 221805 [details]
poudriere build log for dahdi-kmod26 on 12.2

So... neither of these two ports compile.  I've attached the poudriere build log to this ticket.

If you examine the file GpakApi.c with an editor that treats a TAB as 8 spaces, you'll see quite a bit of indention madness.  If you squint, however, it all makes sense at TAB as 4 spaces.

The simplest fix for this port is to remove the -Wmisleading-indentation from the compile.

How is that done?
Comment 1 dgilbert 2021-01-23 15:35:34 UTC
Adding some detail:

This compiles on 12.1 (and fails on 12.2).  I'm not yet sure if -Wmisleading-indentation was inserted in between (in, say, ports.mk or somesuch).
Comment 2 dgilbert 2021-01-25 14:48:40 UTC
Created attachment 221906 [details]
patch for misc/dahdi-kmod
Comment 3 dgilbert 2021-01-25 14:49:33 UTC
Created attachment 221907 [details]
patch for misc/dahdi-kmod26
Comment 4 dgilbert 2021-01-25 14:52:46 UTC
Patches fix things, checked on 12.1 and 12.2

In Short, turn off -Werror.
Comment 5 dgilbert 2021-01-25 14:53:51 UTC
And if the maintainer wants out, I have an interest in maintaining this port as I'm using it.
Comment 6 Greg Balfour 2021-11-01 17:40:20 UTC
Created attachment 229202 [details]
Patch to fix indentation problem

misc/dahdi-kmod26 is currently marked as BROKEN with "does not compile: use of undeclared identifier 'thread_dtor'."  I just tried compiling it under 12.3-BETA2 with quarterly ports and the only issue I see is the indentation issue mentioned above.  Instead of patching the Makefile to turn off -Werror I would just fix the one instance of the problem.  See attached patch.  It replaces a tab character with 4 spaces.  After applying this patch the port compiles under 12.3-BETA2 and quarterly ports.

Is the current BROKEN message valid for FreeBSD 13 or 14?  It isn't for 12.
Comment 7 Greg Balfour 2021-11-01 19:49:51 UTC
Created attachment 229205 [details]
patch to fix BROKEN

I just fired up a 13.0-RELEASE VM and dahdi-kmod26 is in fact BROKEN for 13. But the fix is easy, see attached patch (which should probably be a new bug report).  There are also other errors which are easily dealt with by turning off -Werror.  So I'd go with the Makefile patch instead of my patch to GpakApi.c.
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2021-11-10 10:56:42 UTC
Maintainer timeout (9 months)
Comment 9 commit-hook freebsd_committer freebsd_triage 2021-11-10 10:56:56 UTC
A commit in branch main references this bug:

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

commit 2569669c0955d53caca83563325c13a791dbca5f
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-11-09 21:03:55 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2021-11-10 10:54:51 +0000

    misc/dahdi-kmod26: unbreak, change maintainer

    Unbreak build by adding missing header and disabling -Werror.
    Pass maintainership to submitter due to current maintainer inactivity.

    PR:             252907
    Approved by:    maintainer timeout (fjoe, 9 months)

 misc/dahdi-kmod26/Makefile                                     |  6 ++----
 misc/dahdi-kmod26/files/patch-drivers_dahdi_dahdi-base.c (new) | 10 ++++++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2021-11-10 10:56:57 UTC
A commit in branch main references this bug:

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

commit c5fa8f50683865bc13c56422b8dd0b199537102e
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-11-09 21:06:51 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2021-11-10 10:55:06 +0000

    misc/dahdi-kmod: partially unbreak, change maintainer

    Partially unbreak build by adding missing header and disabling
    -Werror. The remaining complete fix may be trivial but requires testing.
    Pass maintainership to submitter due to current maintainer inactivity.

    PR:             252907
    Approved by:    maintainer timeout (fjoe, 9 months)

 misc/dahdi-kmod/Makefile                               |  6 +++---
 .../files/patch-freebsd-drivers-dahdi-dahdi-base.c     | 18 +++++++++++++-----
 2 files changed, 16 insertions(+), 8 deletions(-)
Comment 11 Dmitry Marakasov freebsd_committer freebsd_triage 2021-11-10 11:28:43 UTC
I've committed a fix for misc/dahdi-kmod26, and applied the same fix to misc/dahdi-kmod.

As already mentioned, dahdi-kmod is not completely fixed yet, the new error is

    error: use of undeclared identifier 'SX_NOADAPTIVE'

The fix would be trivial - just remove the usage of this flag. Not sure of implications though; if I've read the documentation correctly, the flag would disable adaptive spinning, which doesn't make much sense to me. misc/dahdi-kmod26 uses plain spinlock in this place. Anyway I'm attaching the patch for misc/dahdi-kmod, could anyone please test it?
Comment 12 Dmitry Marakasov freebsd_committer freebsd_triage 2021-11-10 11:29:40 UTC
Created attachment 229406 [details]
Complete fix for dahdi-kmod
Comment 13 commit-hook freebsd_committer freebsd_triage 2021-11-10 11:31:04 UTC
A commit in branch main references this bug:

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

commit dec7dd55ef31e79d726c64b845dbea6f34c19b78
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-11-10 11:29:56 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2021-11-10 11:30:07 +0000

    misc/dahdi-kmod*: provide alive WWWs

    PR:             252907

 misc/dahdi-kmod/pkg-descr   | 2 +-
 misc/dahdi-kmod26/pkg-descr | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-01-11 17:19:19 UTC
A commit in branch main references this bug:

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

commit 8aa4f0e63bc87d61ed3f2af3b6da5915a2a715ce
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-11-10 10:57:09 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-01-11 17:16:28 +0000

    misc/dahdi-kmod: fix build

    PR:             252907

 misc/dahdi-kmod/files/patch-include_dahdi_compat_bsd.h (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 15 Dmitry Marakasov freebsd_committer freebsd_triage 2022-01-12 15:20:47 UTC
The build fix for dahdi-kmod was committed (though still not tested), so closing this.
Comment 16 Sergey Balyukov 2022-01-12 21:47:50 UTC
My build is successful both with and without the latest patch. I checked on three systems of version 12.3. On a real system, I get a kernel panic after loading one of the necessary modules. There is no such thing on two virtual hosts. I don't understand why yet, but everything worked on version 11.4. wctdm24xxp.ko module fails