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 decompression functions to separate files #58

Closed
wants to merge 4 commits into from

Conversation

lucasdemarchi
Copy link
Contributor

Closes: #47

Copy link
Collaborator

@evelikov evelikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use if ENABLE_XZ within the C file(s) instead?

I'm not a huge fan of conditionals in the build system, especially since if the option evaluates to false the file will be missing from the dist tarball.

With --without-xz ... the default, I think we'll get some issues ... that is unless you explicitly use --with-xz for the release tarballs. IMHO DISTCHECK_CONFIGURE_FLAG should also be updated to include it regardless of this PR.

@lucasdemarchi
Copy link
Contributor Author

Can we use if ENABLE_XZ within the C file(s) instead?

I don't see a point in having the compiler handle a completely empty file. IMO it also makes it harder to understand how something is disabled by having to open each individual file.

It's not how it's usually done in projects like kernel (with files being included according to kconfig) or systemd (with meson).

Make sure to pass enable all compression libraries so all sources are
included.

Signed-off-by: Lucas De Marchi <[email protected]>
Move xz-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Declare struct kmod_file in a shared libkmod-internal-file.h that will
be included only by sources implementing kmod_file decompression
routines.

Signed-off-by: Lucas De Marchi <[email protected]>
Move zlib-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Signed-off-by: Lucas De Marchi <[email protected]>
Move zstd-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Signed-off-by: Lucas De Marchi <[email protected]>
@lucasdemarchi lucasdemarchi deleted the tip-decompression branch July 24, 2024 04:44
@lucasdemarchi lucasdemarchi restored the tip-decompression branch July 24, 2024 04:44
@lucasdemarchi lucasdemarchi reopened this Jul 24, 2024
Copy link
Collaborator

@evelikov evelikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that works. Fwiw the series:

Reviewed-by: Emil Velikov <[email protected]>

lucasdemarchi added a commit that referenced this pull request Jul 26, 2024
Make sure to pass enable all compression libraries so all sources are
included.

Reviewed-by: Emil Velikov <[email protected]>
Link: #58
Signed-off-by: Lucas De Marchi <[email protected]>
lucasdemarchi added a commit that referenced this pull request Jul 26, 2024
Move xz-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Declare struct kmod_file in a shared libkmod-internal-file.h that will
be included only by sources implementing kmod_file decompression
routines.

Reviewed-by: Emil Velikov <[email protected]>
Link: #58
Signed-off-by: Lucas De Marchi <[email protected]>
lucasdemarchi added a commit that referenced this pull request Jul 26, 2024
Move zlib-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Reviewed-by: Emil Velikov <[email protected]>
Link: #58
Signed-off-by: Lucas De Marchi <[email protected]>
lucasdemarchi added a commit that referenced this pull request Jul 26, 2024
Move zstd-related function to a separate file so it's easier to isolate
the dependency on each decompression library.

Reviewed-by: Emil Velikov <[email protected]>
Link: #58
Signed-off-by: Lucas De Marchi <[email protected]>
@lucasdemarchi
Copy link
Contributor Author

Applied, thanks.

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.

Isolate (de)compression libraries
2 participants