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

Generate only one large library "libtoxcore". #442

Merged
merged 1 commit into from Dec 29, 2017

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 16, 2017

This library contains all the code for the old libtoxcore, libtoxav,
libtoxdns, and libtoxencryptsave. The build for toxav is still optional,
and disabling it causes libtoxcore to simply not contain those symbols
and the pkg-config file to not include opus and vpx as dependencies.


This change is Reviewable

@cebe
Copy link
Member

cebe commented Jan 17, 2017

@iphydf can you explain what you are doing here and why?

@iphydf iphydf force-pushed the one-big-lib branch 10 times, most recently from da4c1ea to 183033a Compare January 22, 2017 00:26
@iphydf
Copy link
Member Author

iphydf commented Jan 22, 2017

@cebe I've added a top level comment to the CMakeLists.txt explaining what it does. Why: avoiding the ABI mess that is toxcore.

@robinlinden
Copy link
Member

Reviewed 11 of 11 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@cebe cebe removed their assignment Jan 29, 2017
@SkyzohKey SkyzohKey added packaging Packaging P1 High priority labels Feb 13, 2017
@SkyzohKey
Copy link

:lgtm_strong:


Reviewed 11 of 11 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Oct 4, 2017

@zoff99 it's always activated when building with CMake.

@zoff99
Copy link

zoff99 commented Oct 4, 2017

@iphydf making cmake and autotools build even more different is a bad idea.
it will break builds :-(

@Diadlo
Copy link

Diadlo commented Oct 5, 2017

@iphydf What if someone wants to link his app without toxav, and simultaneously link with toxav for another app, for example?

@iphydf
Copy link
Member Author

iphydf commented Nov 20, 2017

@Diadlo do you or someone you know have that use case? Otherwise, YAGNI.

@iphydf
Copy link
Member Author

iphydf commented Nov 20, 2017

@zoff99 I agree. So after this we should make autotools do the same.

@Diadlo
Copy link

Diadlo commented Nov 20, 2017

@iphydf It's just like interface segregation. I just don't understand, why you want to merge all function of public API in one library, if they logically different

@iphydf iphydf force-pushed the one-big-lib branch 2 times, most recently from 3e9c956 to 8ac463f Compare December 28, 2017 18:33
@iphydf
Copy link
Member Author

iphydf commented Dec 28, 2017

@Diadlo I'll happily split it out again if and when toxav does not depend on toxcore internals.

The alternative is to have libraries split along the layer boundaries, so we end up having the many-small-libs situation, which we had before. That has different pros and cons. I hope toxav will eventually become independent of toxcore internals (@mannol has plans for this). At that point, I'd like toxav to be a separate repository, developed independently. In the meantime, the split is headaches for developers for no reason.

@iphydf
Copy link
Member Author

iphydf commented Dec 28, 2017

Oh, and why that is an alternative: because then toxav can correctly depend on toxnetcrypto and other things it uses. Right now, toxav is lying because it says it only depend on toxcore, while actually it depends on its internals. If we expose the internals correctly (through libraries), we can have everything separated.

@robinlinden
Copy link
Member

Reviewed 1 of 11 files at r1, 2 of 3 files at r2, 3 of 3 files at r3.
Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


CMakeLists.txt, line 323 at r3 (raw file):

    toxav/video.h)
  target_link_modules(toxav toxgroup ${OPUS_LIBRARIES} ${VPX_LIBRARIES})
  #message("*** toxav_LINK_MODULES: ${toxav_LINK_MODULES}")

This should probably be removed.


CMakeLists.txt, line 359 at r3 (raw file):

# Link it to all dependencies.
foreach(sublib ${toxcore_SUBLIBS})
  #message("*** toxcore_LINK_MODULES += ${${sublib}_LINK_MODULES}  # ${sublib}_LINK_MODULES")

This should probably be removed.


cmake/ModulePackage.cmake, line 154 at r3 (raw file):

  foreach(dep ${ARGN})
    #message("*** Processing dep ${dep} for ${target}")

This should probably be removed.


cmake/ModulePackage.cmake, line 165 at r3 (raw file):

        list(FIND LINK_MODULES ${dep} _index)
        if(_index EQUAL -1)
          #message("*** Adding ${dep} to ${target}_LINK_MODULES.")

This should probably be removed.


cmake/StrictAbi.cmake, line 36 at r3 (raw file):

      OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(REPLACE "\n" ";" sublib_SYMS ${sublib_SYMS})
  

Stray whitespace.


Comments from Reviewable

This library contains all the code for the old libtoxcore, libtoxav,
libtoxdns, and libtoxencryptsave. The build for toxav is still optional,
and disabling it causes libtoxcore to simply not contain those symbols
and the pkg-config file to not include opus and vpx as dependencies.
@iphydf
Copy link
Member Author

iphydf commented Dec 28, 2017

Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


CMakeLists.txt, line 386 at r2 (raw file):

Previously, cebe (Carsten Brandt) wrote…

what is this? looks super specific to a certain environment.

It's specific to toktok-stack, which is available to everyone (it's a github repo).


CMakeLists.txt, line 323 at r3 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

This should probably be removed.

Done.


CMakeLists.txt, line 359 at r3 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

This should probably be removed.

Done.


cmake/ModulePackage.cmake, line 154 at r3 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

This should probably be removed.

Done.


cmake/ModulePackage.cmake, line 165 at r3 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

This should probably be removed.

Done.


cmake/StrictAbi.cmake, line 36 at r3 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

Stray whitespace.

Done.


Comments from Reviewable

@robinlinden
Copy link
Member

:lgtm_strong:


Reviewed 3 of 3 files at r4.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority packaging Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants