Skip to content
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

Fix unconditional uses of Linux-specific extensions #2812

Merged
merged 10 commits into from Jan 8, 2024

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Dec 12, 2023

Should fix the issues brought up in #2807 - portability rot that inevitably happens when you only build on one target.

@pmatilai pmatilai added bug build Build-system related labels Dec 12, 2023
@pmatilai pmatilai changed the title Portability fixes Fix build dependencies on Linux-specific extensions Dec 18, 2023
@pmatilai pmatilai changed the title Fix build dependencies on Linux-specific extensions Fix unconditional uses of Linux-specific extensions Dec 18, 2023
@pmatilai pmatilai force-pushed the portability-pr branch 2 times, most recently from 7a30644 to bbbf6b0 Compare December 18, 2023 14:13
Conditionalize elfdeps build on libelf availability.
We missed the use of this non-standard function on review. rpmsort
needs to be fixed to not rely on GNU extensions but in the meanwhile
we need to check for that function and disable if not present.
This regressed when we axed our internal glob copy in commit
66fa46c. Luckily GLOB_ONLYDIR is only
an optimization so we can just skip it if not available.
Should've been in commit 04d49fb
where basename() usage was introduced.

And because the standard version of basename() has non-const argument,
we run into rpm2archive using non-standard const argument to main(),
because popt got it wrong. Move the const-cast to the popt invocation
for consistency with the other codebase.

Suggested-by: Mark Dascher <mark@papertrail.com>
Yet more rather obvious fallout from the cmake transition. It's strange
these don't fail the build on Linux.

Suggested-by: Mark Dascher <mark@papertrail.com>
I clearly remember testing the behavior wrt these and concluding that the
cmake exported interface syntax doesn't require conditionalizing.
Clearly it does though, so dunno what I was supposed to have tested
back then.

Suggested-by: Mark Dascher <mark@papertrail.com>
We checked for libintl in the top-level CMakeLists.txt but then never
used it for anything. This only ever worked on glibc where this all
is bundled in. Unfortunately Intl only becomes an importable target
in cmake >= 3.20 which is too new for us to rely on for now.

Python bindings are omitted here because we don't have any translated
messages in there. Whether we should is another topic.
This is mildly annoying, librpm users don't need to link to popt but
this one include in rpmcli.h (that most API users wont even use) forces
a public dependency on it.

Another possibility could be splitting out the "cli" part of librpm
one way or another, but that doesn't seem worth all the trouble it would
be.
@pmatilai
Copy link
Member Author

pmatilai commented Jan 8, 2024

As per #2807 (comment) mission accomplished.

@pmatilai pmatilai merged commit 75965c1 into rpm-software-management:master Jan 8, 2024
1 check passed
@pmatilai pmatilai deleted the portability-pr branch January 8, 2024 10:32
@dmnks dmnks mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Build-system related REGRESSION
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant