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

Move general common code to "core" library #1868

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

CendioOssman
Copy link
Member

The common/ structure has been a bit messy in some cases because some general infrastructure was located in common/rfb. Besides the confusion about the purpose of each library, it also created dependency loops, creating issues such as #1691.

Solve this by moving generic support code to a new library called "core" that serves as a base for everything else.

I've tried to perform this move in a way that minimises the diffs, and hence damage to git blame.

@CendioOssman CendioOssman requested review from samhed and removed request for samhed November 12, 2024 19:36
@CendioOssman CendioOssman force-pushed the corelib branch 2 times, most recently from 494c375 to 5811d4b Compare November 14, 2024 19:48
@KangLin
Copy link
Contributor

KangLin commented Nov 15, 2024

I think it's okay to just move the cross-platform part and keep the structure of the other RFBs.
It's a good job!

@CendioOssman CendioOssman force-pushed the corelib branch 5 times, most recently from f8e901f to b8953f9 Compare November 21, 2024 14:51
@CendioOssman CendioOssman marked this pull request as ready for review November 21, 2024 15:00
@CendioOssman CendioOssman requested a review from samhed November 21, 2024 15:00
@CendioOssman
Copy link
Member Author

The latest shuffling caused the commit "Move configuration to core library" to fail to build. The problem is the dependency loops, and that commit just got unlucky.

We might get lucky shuffling the order around, but we also might not. I don't know if it's worth the extra effort or if we can live with one broken commit.

This inline class just makes this header overly complex.
Make compile times faster by reducing the number of headers included in
other headers.
libtool seems to have some issues ordering everything correctly, and
this seems to work better.
This is a network function, so it makes more sense in the network
library.
Try to keep the code more compact for the simple things where the type
should be obvious from the context. Helps us avoid line wrapping.

Also remove explicit conversions to Region where the compiler is able to
figure it out by itself, again to reduce line length.
We normally avoid specifying a class' own namespace prefix in order to
keep the code more compact. Region was the sole exception.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Avoid surprises by specifying the number of entries in the array,
rather than the total size of the array.
Make this code a bit more readable by getting rid of some of the
repeated casts.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Make it clearer what is protocol handling and what is just general
plumbing.

This is one step of several.
Let's clear things up by categorizing our utility functions.
These functions assumes there is a specific ordering between the given
moments. Make sure we don't return something completely crazy if this
ordering isn't true.
They weren't that well used, and were mostly just confusing special
functions anyway.

Allows us to move away from generic and ambigious headers such as
"util".
It's just string helper functions here, so let's get rid of the
catch-all name for this module.
These are general plumbing, so they fit in nicely with the new core
library.
OS abstractions are generic enough that we can merge these with the new
core library.
OS abstractions are generic enough that we can merge these with the new
core library.
We should hopefully no longer require the common libraries to be linked
twice anymore for things to work.
To reduce the risk of duplicating the libraries on the link line, as we
have absolute paths in the .la files.
There were not many uses of this left after the move to std::exception
and the move to the core library. Let's get rid of the last stragglers
and reduce the risk of name collisions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants