-
Notifications
You must be signed in to change notification settings - Fork 491
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
WIP: Port libarchive to CMake #2602
base: master
Are you sure you want to change the base?
Conversation
This port also dynamically links bsdtar and bsdcpio to libarchive. Therefore bsdtar and bsdcpio now depend on libarchive.
The CI output shows a filesystem level diff at least. |
libarchive/PKGBUILD
Outdated
|
||
# CNG breaks pacman on Vista due to BCryptDeriveKeyPBKDF2 | ||
cmake \ | ||
-G"Unix Makefiles" \ |
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.
Have you tried using Ninja?
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 didn't since I wasn't sure DESTDIR
worked with Ninja. Apparently it works and now PKGBUILD uses Ninja. However this issue with Ninja is annoying: ninja-build/ninja#1482
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.
Yes it is. CMAKE_BUILD_PARALLEL_LEVEL
can be used with cmake --build
(instead of calling ninja directly)
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.
Hmm I should amend the commit with that. Thanks for the info @jeremyd2019
libarchive seems to use a unique way to give "sonames" to their libraries: https://github.com/libarchive/libarchive/blob/3.5.1/CMakeLists.txt#L74 So it changes file name to |
f35526a
to
1d6aec8
Compare
If soname changes, all dependencies need to be rebuilt. Luckily there aren't too many: https://packages.msys2.org/package/libarchive?repo=msys&variant=x86_64 (see "Required by" section) |
I know :) I haven't investigated libarchive source code history to have enough confidence in ABI stability of their interfaces. If they want to increment soname at each release, though, I wouldn't get my hopes high. BTW it seems the dependents of libarchive use static libs instead of dlls. It's done to not bork a working installation, I guess? |
So either we fix https://github.com/libarchive/libarchive/blob/2d57843d3c1bd6061df94d2554d3349ef60bf8e3/CMakeLists.txt#L74 to not add the minor version (it's pretty clear this is wrong as it is now imo), or we rebuild (bump pkgrel of all packages in this PR) |
From libarchive/libarchive#1065 I infer that the soname in the CMake is the correct one. So every minor version is a soname change. |
This is my first contribution to the repository so I may need some changes. This is a WIP PR. I want to make sure the build works and meets the expectations before merging it.
Since the CMakeLists provided the option for dynamically linking
bsdtar
andbsdcpio
with libarchive, I enabled that setting. Thereforebsdtar
andbsdcpio
now depend onlibarchive
which provides all the other dependencies.Unfortunately I cannot build autotools version of libarchive. Some autoconf rules seem to be missing in my default MSYS2 installation with
base-devel
group of packages (missingmakedepends()
?). Therefore, I cannot make a 1-to-1 comparison.I plan to add a
check()
function to PKGBUILD in order to runmake test
. Currently a few of them fails/segfaults. The fails seem to be actual programming errors in libarchive and they may need to be patched.Long logfile of failed tests
LastTest.log