Bug 280602 - devel/linenoise: Switch to comlin fork
Summary: devel/linenoise: Switch to comlin fork
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: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks: 280340
  Show dependency treegraph
 
Reported: 2024-08-04 00:13 UTC by Daniel Engberg
Modified: 2024-08-12 18:47 UTC (History)
1 user (show)

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


Attachments
Patch for linenoise (3.42 KB, patch)
2024-08-04 00:13 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2024-08-04 00:13:30 UTC
Created attachment 252488 [details]
Patch for linenoise

Switch to port as it provides build files for Meson which fixes various usability issues including providing a .pc file (pkgconfig).

Compile and runtime tested on FreeBSD 14.1-RELEASE (amd64) (make, make check-plist, make test)

Poudriere testport OK 14.1-RELEASE (amd64)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2024-08-04 00:16:09 UTC
See also https://github.com/antirez/linenoise/pull/223 regarding upstreams take on the issue. Various repos have partial patches for fix all issues but this is the most complete one I found that required minor patching.
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2024-08-08 17:30:31 UTC
Friendly ping
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2024-08-11 02:58:18 UTC
Hi Daniel,

I decided to leave devel/linenoise intact, and create the new port with the patch that you submitted.

Please let me know if there are any problems with it.


Thanks,
Yuri
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-08-11 02:58:50 UTC
A commit in branch main references this bug:

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

commit 713a610437d168a3224dd5f4928de9e0705e20ed
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-08-11 02:56:11 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-08-11 02:58:24 +0000

    devel/comlin: New port: Small self-contained alternative to readline and libedit

    PR:             280602
    Reported by:    Daniel Engberg <diizzy@FreeBSD.org>

 devel/Makefile                             |  1 +
 devel/comlin/Makefile (new)                | 27 +++++++++++++++++++++++++++
 devel/comlin/distinfo (new)                |  3 +++
 devel/comlin/files/patch-meson.build (new) | 21 +++++++++++++++++++++
 devel/comlin/pkg-descr (new)               | 11 +++++++++++
 5 files changed, 63 insertions(+)
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2024-08-11 06:34:23 UTC
The issue is that after commit 6049047 comlin no longer compatible with linenoise,  even before that it has a bunch of fixes that upstream doesn't carry.
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2024-08-11 06:41:51 UTC
The issue is that after commit 6049047 ( https://github.com/drobilla/comlin/commit/44cd0db05ee76fd89f7f0107eccfbbe694f69e18 ) comlin no longer compatible with linenoise,  even before that it has a bunch of fixes that upstream doesn't carry.

The current port also lacks any kind of pkgconfig/cmake helper and Poudriere will error out in its current state.

====> Running Q/A tests (stage-qa)
Error: /usr/local/bin/quich is linked to /usr/local/lib/liblinenoise.so which does not have a SONAME.  devel/linenoise needs to be fixed.
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2024-08-11 18:40:56 UTC
(In reply to Daniel Engberg from comment #6)

Hi Daniel,


If another port requires some specific past revision of the project, perhaps you should create a fork port that is fixed at this revision, with PKGNAMESUFFIX, etc.

It should also be brought to the attention of the upstream of the package that requires a specific old revision of a dependency that they probably should update their project.


Yuri
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2024-08-11 18:42:00 UTC
SONAME isn't a fatal error.
I'll let their upstream know.
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2024-08-11 20:48:15 UTC
The issue is that the port in its current state is "troublesome" to utilize in multiple ways and could use some enhancements in general. 

It doesn't provide any kind of pkgconfig or CMake config-file packages and find-module Packages. This isn't a showstopper but it requires more hacking for each consumer rather than just relying on pkgconfig or CMake. Multiple package repos have patches in place to fix this issue so we're not alone regarding this issue just late trying to fix it (to our advantage). As I mentioned earlier upstream doesn't see this as an issue and seeming "wont fix", https://github.com/antirez/linenoise/pull/223

The same goes for the SONAME issue, some repos have tried to fix it in various ways. poudriere-devel will actually mark a port as failed as I linked to earlier so that's needs to be addressed too either way.

The fork incorporates all commits from "upstream" as well as multiple fixes including a build system/framework which takes care of all issues instead of having a to maintain all that ourselves.

Prior to commit https://github.com/drobilla/comlin/commit/44cd0db05ee76fd89f7f0107eccfbbe694f69e18 upstream fork didn't break compatibility as explained in the commit message.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2024-08-11 21:30:59 UTC
(In reply to Daniel Engberg from comment #9)

Hi Daniel,


I just added the SONAME. It is really easy to do.

What concerns with the lack of cmake or pkgconfig files - there are many ports and software packages which don't provide these. This is an annoyance, but not a huge problem. It is always possible to add appropriate compilation and link flags.


Yuri
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2024-08-11 22:07:33 UTC
https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/development/libraries/linenoise

But again, this is the very reason why I wanted to avoid a lot of hacking in our tree... ;-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-08-12 06:21:49 UTC
A commit in branch main references this bug:

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

commit caf574aa4e5db9f2fff8fbd48c42b8b82d0258ea
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-08-12 02:45:49 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-08-12 06:21:25 +0000

    devel/linenoise: Add .pc file

    PR:             280602

 devel/linenoise/Makefile                    |  9 +++++++--
 devel/linenoise/files/linenoise.pc.in (new) | 10 ++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)
Comment 13 Daniel Engberg freebsd_committer freebsd_triage 2024-08-12 17:06:54 UTC
Can you rename the pc file so it matches the library (liblinenoise)? This also more inline with how other projects name their .pc files

Best regards,
Daniel
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-08-12 18:47:15 UTC
A commit in branch main references this bug:

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

commit 93f2103ad4c2b157a047d5b6dd854e72767c82c9
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-08-12 18:46:11 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-08-12 18:46:39 +0000

    devel/linenoise: Rename .pc file

    PR:             280602

 devel/linenoise/Makefile                                      | 6 +++---
 devel/linenoise/files/{linenoise.pc.in => liblinenoise.pc.in} | 0
 2 files changed, 3 insertions(+), 3 deletions(-)