Skip to content

Add history.h as a symlink to readline.h to align with libreadline #25827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rbu9fe
Copy link

@rbu9fe rbu9fe commented Nov 4, 2024

Summary

Changes to recipe: editline/3.1

Motivation

editline is a readline-compatible library, whereas libreadline exports its API in two header files: readline.h and history.h. Some consumers support using any of these readline-compatible libraries, which only works when they expose the same functions as well as headers. Since editline only provides a single header readline.h the Conan package should provide a symbolic link history.h linking to readline.h so that consumers find the expected header.

Note that the editline Debian package does the same thing here.

Details

Add a symbolic link history.h linking to (and next to) readline.h.


@CLAassistant
Copy link

CLAassistant commented Nov 4, 2024

CLA assistant check
All committers have signed the CLA.

@uilianries
Copy link
Member

@rbu9fe Hello! 👋

Thank you for your suggestion of customizing this Conan recipe 😄

Some consumers support using any of these readline-compatible libraries, which only works when they expose the same functions as well as headers.

Do you have a real example of a project only consuming history.h and are blocked without this PR?


I did a quick search and I only found Debian and Ubuntu using this symlink:

Other Linux distros are only building without such trick:

And other multiproposal package managers are not creating that symlink:


I understand your concern about aligning that header according to libreadline, but I'm afraid this is a particular case that may risk breaking general users, than solving some real issue. Regards!

@rbu9fe
Copy link
Author

rbu9fe commented Jun 12, 2025

I'm using lldpd together with editline, which doesn't work when editline doesn't provide history.h.
How can adding a symbolic link risk breaking other users? Since it's an additive change only I thought it's not causing side effects.

@uilianries
Copy link
Member

@rbu9fe Hello again!

How can adding a symbolic link risk breaking other users? Since it's an additive change only I thought it's not causing side effects.

That change is adding a header that was not expected before in the package and is not part of the default build of libedit. As ConanCenterIndex tries to keep as closer as possible to the upstream project and there is no large evidence of that pattern, but only Debian using it, I would ask you to open an issue to the upstream first to discuss a proper solution that affects all consumers.

Still, for your specific case, I would recommend building lldpd with the compiler defines HAVE_LIBREADLINE and HAVE_EDITLINE_READLINE_H but not with HAVE_READLINE_HISTORY:

https://github.com/lldpd/lldpd/blob/9034c9332cca0c8b1a20e1287f0e5fed81f7eb2a/src/client/client.h#L56

So you will be able to build without errors.

In case you really want to proceed with that change, you have a few options:

  • Use a Artifactory instance with a copy your changed recipe and built package.

  • Use Local Recipes Index to point your fork as the remote when building editline.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants