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

Reduce circular dependencies #5409

Closed
wants to merge 3 commits into from
Closed

Reduce circular dependencies #5409

wants to merge 3 commits into from

Conversation

smcv
Copy link
Collaborator

@smcv smcv commented May 15, 2023

The overall goal of this branch is to break up unmanageably large translation units, and make the common/ code more understandable by separating it into layers (utils < exports < context < ...) instead of having all modules call into all other modules. The version in this PR only partially achieves that, but it's a start.

  • exports: Remove unused headers

    The exports module doesn't actually need these, and this removes a
    circular dependency: previously, exports both depended on and was
    depended on by dir.

  • common: Move flatpak_context_get_allowed_exports to FlatpakContext

    This allows us to break a circular dependency between utils and context.

  • common: Don't depend on generated D-Bus code in utils module

    Each of these is only needed in one place, so move them there. This is
    another step towards the utils module being the lowest-level.

@smcv smcv force-pushed the split-utils branch 2 times, most recently from 803535e to de5d51e Compare May 16, 2023 12:01
@smcv smcv mentioned this pull request May 17, 2023
@smcv
Copy link
Collaborator Author

smcv commented May 17, 2023

I tried also splitting up flatpak-dir into the lower-level parts that deal with a single FlatpakDir, and higher-level parts that do the deploy operation (which needs to be able to see into all installations system-wide, not just the one we're installing into, for related extensions and extra data); but that's relatively complicated and is in "package management" code that I'm less familiar with. So for this PR, I'm restricting myself to only disentangling the lower-level parts of Flatpak, mainly basic utilities and sandbox setup.

smcv added 3 commits May 2, 2024 15:11
The exports module doesn't actually need these, and this removes a
circular dependency: previously, exports both depended on and was
depended on by dir.

Signed-off-by: Simon McVittie <[email protected]>
This allows us to break a circular dependency between utils and context.

Signed-off-by: Simon McVittie <[email protected]>
Each of these is only needed in one place, so move them there. This is
another step towards the utils module being the lowest-level.

Signed-off-by: Simon McVittie <[email protected]>
@smcv smcv marked this pull request as ready for review May 2, 2024 14:22
@smcv smcv changed the title Split up flatpak-utils and reduce circular dependencies Reduce circular dependencies May 2, 2024
@smcv
Copy link
Collaborator Author

smcv commented May 3, 2024

Merged as part of #5801.

@smcv smcv closed this May 3, 2024
@smcv smcv deleted the split-utils branch May 6, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant