-
Notifications
You must be signed in to change notification settings - Fork 123
Move headers Part 3 #4941
Move headers Part 3 #4941
Conversation
As a preview: After this PR, I will tackle |
d72d21a
to
7a8afcd
Compare
also extract base and pluginload object libraries
This changes many functions from internal.c into static inline since they are just wrappers with extra asserts. This change should improve the compiler's ability to perform optimizations, since it now always has insight into the functions. The static inline functions are only declared in internal headers. To make them available publically, we also re-export them via elektra-utility.so.
@atmaxinger @hannes99 This PR might take a bit more time to review. The simple |
jenkins build libelektra please |
jenkins build libelektra please |
jenkins build libelektra please |
@atmaxinger @flo91 Could one of you take a look at this PR? |
- The package `texlive-most` is not available anymore, I've replaced it with `texlive-core` and `texlive-bin`
fix error in Cirrus CI build
- fixes failed build of refman.pdf with recent TeX Live versions - see issue ElektraInitiative#4966
elektraChangeTrackingGetContextFromPlugin; | ||
elektraChangeTrackingCalculateDiff; | ||
|
||
# FIXME: separate lib? part of merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why diff should be a part of merge TBH. A separate lib maybe, but on the other hand it's an integral part of KDB so IDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change tracking part is integral to KDB, but the pure diff part could be used standalone (just with core), AFAIK. I thought of merge, since diff & merge are somewhat related concepts.
EDIT: Although I think merge depends on libgit, so its probably not even possible to put the diff stuff there.
elektraMemDup; | ||
elektraRealloc; | ||
elektraStrCaseCmp; | ||
elektraStrCmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a bit off-topic, but why exactly do we need our own implementation of strcmp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symbols.map
files actually need to be cleanup when all this restructuring is done. elektraStrCmp
isn't actually public anymore. It's now just an internal static inline
function with extra asserts around standard strcmp
.
libelektra/src/include/internal/utility/compare.h
Lines 40 to 45 in 3af13a2
static inline int elektraStrCmp (const char * s1, const char * s2) | |
{ | |
ELEKTRA_ASSERT (s1 != NULL && s2 != NULL, "Got null pointer s1: %p s2: %p", VOID_CAST (s1), VOID_CAST (s2)); | |
return strcmp (s1, s2); | |
} |
This PR actually turns most of these "just a standard libc function with extra asserts" into internal static inline
functions. For the ones that need to be public (elektraMalloc
, etc.) we re-export them via libelektra-utility
as normal functions too, but internally use the static inline
versions. More complicated things like elektraFormat
are still normal functions everywhere, but are linked statically (but unexported) into libelektra-core
to avoid a dependency.
jenkins build libelektra please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another great PR. 🚀
I left a few comments, but overall LGTM.
However, I'm not sure if it's a good idea to have the Latex package changes in this PR. I'd much rather see them fixed in master, and then rebase this branch to master again.
I cherry picked the commits (without change) from #4967, so if all goes well, they should disappear when this is eventually merged into master. 3ec05e1 and f3b783b might need to be applied to |
Co-authored-by: Maximilian Irlinger <[email protected]>
jenkins build libelektra please |
What happens in this PR?
With #4940 the pure header updates for should be concluded. However, the decisions listed in #4920 also include some additional changes like new libraries.
This PR includes many CMake changes and finally splits
src/libs/elektra
properly intosrc/libs/core
andsrc/libs/kdb
.Among the CMake changes, is a change in how
BUILD_FULL
andBUILD_STATIC
work. Instead of collecting all the source and header files and compiling them again, we just collect all the CMake targets and use the$<TARGET_OBJECTS:...>
syntax to add everything as dependencies.The PR also introduces two new libraries
src/libs/base
andsrc/libs/pluginload
. These are not actual libraries that can be installed. Instead, as described in the decisions, they areOBJECT
libraries in CMake, meaning the.c
files are compiled into.o
files but nothing more. We do this, so we can extract base functionality (likeelektraMalloc
) and plugin loading fromelektra-core
andelektra-kdb
, without introducing additional dependencies.The PR also introduces a new
src/libs/type
, which is just a bit ofsrc/libs/ease
extracted into a separate library.Finally, this PR has a change that was hinted at in #4940 (comment). It turns quite a few functions which are just small wrappers around stdlib functions (
elektraMalloc
,elektraFree
, etc.) intostatic inline
functions in internal headers. The way this is done is a bit quirky, but it works and allowed the compiler to do more in-depth analysis (see 679085b).Hints for reviewers
The PR is a bit bigger, because there are many (similar) changes to CMake files, but otherwise it should be like any other PR in terms of reviews. All commits where done manually.
Most of the CMake changes are just removing
add_headers
and other stuff that isn't actually needed. If you don't understand something, just ask.Basics
(added as entry in
doc/news/_preparation_next_release.md
which contains_(my name)_
)Please always add them to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.doc/news/_preparation_next_release.md
scripts/dev/reformat-all
Checklist
(not in the PR description)
Review
Labels