-
Notifications
You must be signed in to change notification settings - Fork 353
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
4.19 unbuildable on macOS due to Linux-specific extensions #2807
Comments
If rpm depends on a non-POSIX extension then it generally is a bug. Such cases just need to be tracked independently, but in brief:
|
Oh, looking at the GLOB_ONLYDIR a bit closer: it is and always was an optimization only, so we can simply check for its availability and avoid use if it's not present. Which actually makes it trivial to fix. Addressed in #2812 now too. |
That's great news, thanks! I've never actually tried building this myself, but I gave it a whirl on that branch. Here's some more adjustments that I had to make:
Obviously not recommending all of these changes literally–this was just the easiest way for me to map out all of the potential issues remaining. I tried deciphering #2238 to see which of these might've been lost in the CMake transition, but I figure y'all would be better at figuring that out. I'm also not 100% sure that I'm running cmake exactly as Homebrew would. So if any of this was supposed to work already, then I might've just been doing something strange. Just wanted to throw this up there in case it's helpful. Thanks again! |
Overall that looks just like more cmake transition fallout, uff. I'll look into it. PRIVATE vs PUBLIC depends on whether said linkage is private to the library or not, this is relevant for (other) software using these libraries. For example, librpm has PUBLIC linkage to librpmio because in order to use librpm, one must also link to librpmio. However most of rpm's dependencies are of no concern to other software (eg you don't need to link to liblua in order to use librpm), these are PRIVATE linkages. |
Pushed fixes for most of the above issues to #2812. The intl case is indeed a bit more complicated. For one, we only check for Intl package, but never actually use it for anything 🤦 and this only works because glibc has this all built it. I'll need to think about that (and preferably find some way to test myself), but at least rpm should be buildable now, with ENABLE_NLS=OFF. |
Does the following, on top of #2812, make it buildable with ENABLE_NLS? (not sure this is the best way to do it but ...)
|
Almost! 🙂 I didn't realize that cmake was supposed to handle this automatically, and until now I'd been setting
So if I move Also the |
Thanks for testing! That's also a fine reminder of how global includes and the like get problematic real fast, so I ended up pushing a target-based version to the PR instead. So unless I screwed something up, the PR should be compilable on a whole bunch of platforms where >= 4.19.0 previously was not. |
Added to misc/CMakeLists.txt:
Added to rpmio/rpmpgp_legacy/CMakeLists.txt:
Added to python/CMakeLists.txt: And then everything worked. I think that last one got hidden when we tried globally including Intl_INCLUDE_DIRS, just because it's |
Actually popt needs to be a public include directory for rpm because of that rpmcli.h include, I didn't realize/remember we had such a thing... But okay, we're getting close now. |
Hmm, actually there shouldn't be any need for rpmbuild.h to include rpmcli.h either. |
Pushed another update to the PR, hopefully that covers these final bits too. |
Bingo! It works now:
Those cmake options are basically just the args listed in Homebrew's rpm.rb, plus So I believe that PR solves this issue completely. Happy new year! |
Excellent! 🥳 And again, thank you for reporting, suggesting fixes and testing. This is how it works 👍 |
As per above report, fixed by #2812 There's nothing controversial in the PR so those who need non-Linux builds before 4.19.2 gets released, just apply the PR as a whole. At least cmake makes applying buildsys related patches sane. |
RPM 4.19.1.1 can be built on MacOS again. See rpm-software-management/rpm#2807 for details.
RPM 4.19.1.1 can be built on MacOS again. See rpm-software-management/rpm#2807 for details.
RPM 4.19.1.1 can be built on MacOS again. See rpm-software-management/rpm#2807 for details.
RPM 4.19.1.1 can be built on MacOS again. See rpm-software-management/rpm#2807 for details.
RPM 4.19.1.1 can be built on MacOS again. See rpm-software-management/rpm#2807 for details.
This is similar to #2222, but I read the conclusion there as "the RPM team won't bend over backwards to support an OS that isn't POSIX complaint," which makes perfect sense to me. Now, macOS has added the missing POSIX function described in that issue, but 4.20 won't build for different reasons:
GLOB_ONLYDIR
strchrnul
The discussion for #2046 even acknowledges that it'll break POSIX compatibility:
It sounds like the Homebrew team has basically given up on trying to build rpm for macOS, so I wanted to open this issue to clarify if that's warranted or not. If we should expect every new version to break POSIX compatibility, then I'd agree that probably makes sense. But I'm not sure if that's the actual intent?
The text was updated successfully, but these errors were encountered: