-
Notifications
You must be signed in to change notification settings - Fork 12
Update cmake files for distros packaging #6
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
Conversation
|
This is copy of the original openfec upstream PR: OpenFEC/OpenFEC#2 |
| else(DEBUG STREQUAL "ON") | ||
| # Release mode | ||
| set(CMAKE_BUILD_TYPE Release) | ||
| set(CMAKE_C_FLAGS "-O4") |
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.
This should be set by host/distro. In case it's really needed, it should have CACHE keyword to be overridable by distro CFLAGS.
| target_link_libraries( eperftool openfec m) | ||
|
|
||
|
|
||
| install(TARGETS eperftool) |
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.
Add install target.
|
|
||
| target_link_libraries(simple_client openfec m) | ||
|
|
||
| install(TARGETS simple_server simple_client) |
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.
Add install target.
|
|
||
| target_link_libraries( descr_stats m) | ||
|
|
||
| install(TARGETS descr_stats) |
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.
Add install target.
|
We are trying to get this package into Fedora, Fedora review request: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2121558 |
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
|
Hi, sorry for delay, thanks for PR and detailed explanations. After merging other PRs, this one got conflicts. I've rebased it on fresh When rebasing, I've removed one change: IIRC, using O3 was important in case of OpenFEC (and O4 = O3). Unfortunately I don't remember exact details.
I see. I'll address it in separate commit, so that by default it will be O3, but could be overwritten. That is what is needed for packaging, right? But I recommend to package this lib with O3. |
|
Related: #5 |
|
I've pushed follow-up commit: Add OPTIMIZE option (65bd0cb)
This way, we preserve behavior of forcing -O3 by default, but add a way to override it. Please let me know if that suits your need or we need some other changes. |
|
Tagged v1.4.2.5 with this fix included. |
Thanks, LGTM. |
|
@yarda Could you clarify why do we need install targets for executables? (eperftool, simple_server, simple_client, descr_stats) In my understanding, they all are either internal developer tools or examples, not intended for end users. Can we remove these install targets? |
|
@yarda Could you also explain what's wrong with I mean this set of changes: - add_test("create_instance" ${EXECUTABLE_OUTPUT_PATH}/test_create_instance)
+ add_test("create_instance" ${PROJECT_BINARY_DIR}/tests/test_create_instance)This changes broke openfec tests. I'm now trying to find the best way to fix them. |
We usually package everything that's available in the upstream project including internal tools/tools for developers, because the Fedora package can also be (and usually is) used by developers. These tools are currently packaged in the openfec-utils (I was also thinking about the openfec-tools name) sub package. If you think these tools are not needed, maybe they could be removed from the release tarball (and still kept in the git or removed from the git if not useful at all). Or if you think these tools can be useful for developers and shouldn't be installed by the end users, maybe you could provide specific target for them? I.e. not to install them by default. I think the current state when it is compiled by default and not installed is not optimal. |
The build dir (the directory holding the built binaries) can be (and on Fedora is) elsewhere (out of the tree build). As I understand these cmake variables |
|
Thanks,
Personally I think that:
On the other hand, if the convention is to package such stuff, then OK. It's just a bit surprising to me, but I'm not very familiar with packaging conventions.
Sounds good. I'll add separate target, so that package maintainers can decide whether to use it or not.
I see... When you're building openfec in-tree, binaries are by default installed into Then, when you try to run tests, tests expect to find those tools in Note that How exactly does Fedora run cmake?
One possible solution is:
What do you think? |
In fedora cmake is run with the following arguments: It works with most of the cmake projects, but IIRC I had problems with the original EXECUTABLE_OUTPUT_PATH. I will retry with the current version. |
Are there any requirements where the executables and shared objects should be located after invoking Is it wrong if they are located in bin/Release in source dir? |
|
|
@yarda Hi, I've merged this PR because it's needed for package for arch. But let me know if you'll have any issues or comments. |
|
Sorry for the delay. Now I am trying to rebase to openfec-1.4.2.5, but I have still problems with the tests: Full build log: https://kojipkgs.fedoraproject.org//work/tasks/8169/96708169/build.log Moreover I spotted two new problems, problem 1: I.e. the source files shouldn't have the executable bit in the released tarball. Problem 2: It's because it's running |
|
No worries for delay. For the git describe problem, could you try 1.4.2.6 instead? It should be fixed. I'll take a look at the other stuff.. |
|
With the 1.4.2.6 the git describe problem is gone and the tests also work. There is still the following: I.e. 4 files have wrong mode in the tarball. Otherwise LGTM. |
|
@yarda I've tagged 1.4.2.8, which removes those executable bits. Seems they come from original source tarball. https://github.com/roc-streaming/openfec/releases/tag/v1.4.2.8 |
Signed-off-by: Jaroslav Škarvada jskarvad@redhat.com