Skip to content

Add zstd support #2088

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

Merged
merged 9 commits into from
Mar 16, 2025
Merged

Add zstd support #2088

merged 9 commits into from
Mar 16, 2025

Conversation

davidalo
Copy link
Contributor

@davidalo davidalo commented Mar 5, 2025

No description provided.

@falbrechtskirchinger
Copy link
Contributor

FYI, the broken tests are fixed by #2089 and #2090.

@yhirose
Copy link
Owner

yhirose commented Mar 6, 2025

@davidalo could you rebase your code based on the latest master branch, and fix the format errors reported by 'test/style-check'? Thanks!

@davidalo davidalo force-pushed the add-zstd-support branch 2 times, most recently from c269370 to 290eb0a Compare March 6, 2025 17:49
@davidalo
Copy link
Contributor Author

davidalo commented Mar 6, 2025

@davidalo could you rebase your code based on the latest master branch, and fix the format errors reported by 'test/style-check'? Thanks!

Done!

@davidalo
Copy link
Contributor Author

davidalo commented Mar 6, 2025

All tests are passing on my side.

@falbrechtskirchinger
Copy link
Contributor

All tests are passing on my side.

Well, is CI running any of the tests? (Ignoring the internal server error on GH's end.) On Ubuntu and macOS, tests are run through test/Makefile. And on Windows (where we use CMake), we don't have the dependencies (I assume).

Let me know if you need assistance with any of that.

@yhirose
Copy link
Owner

yhirose commented Mar 6, 2025

@davidalo as @falbrechtskirchinger mentioned, the unit tests should run on the GitHub Actions CI. The following lines are for the Brotri support. You can do the same or similar for the zstd support.

BROTLI_DIR = $(PREFIX)/opt/brotli
BROTLI_SUPPORT = -DCPPHTTPLIB_BROTLI_SUPPORT -I$(BROTLI_DIR)/include -L$(BROTLI_DIR)/lib -lbrotlicommon -lbrotlienc -lbrotlidec
TEST_ARGS = gtest/gtest-all.cc gtest/gtest_main.cc $(OPENSSL_SUPPORT) $(ZLIB_SUPPORT) $(BROTLI_SUPPORT) -pthread -lcurl

run: sudo apt-get update && sudo apt-get install -y libbrotli-dev libcurl4-openssl-dev

run: vcpkg install gtest curl zlib brotli

-DHTTPLIB_REQUIRE_BROTLI=ON

Copy link
Contributor

@sum01 sum01 left a comment

Choose a reason for hiding this comment

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

Don't forget to add to httplibConfig.cmake.in

@yhirose
Copy link
Owner

yhirose commented Mar 15, 2025

@davidalo could you please follow up the review comments? Thanks!

@davidalo
Copy link
Contributor Author

@davidalo could you please follow up the review comments? Thanks!

Yes, sorry busy week... Pushed three commits with the requested changes but suffering from conflicts. Rebasing and solving conflicts now.

@davidalo davidalo requested review from sum01 and yhirose March 15, 2025 09:13
@davidalo davidalo force-pushed the add-zstd-support branch 4 times, most recently from 8d426ad to 9e81d40 Compare March 15, 2025 09:39
@davidalo
Copy link
Contributor Author

@yhirose @sum01 @falbrechtskirchinger fixed following your comments, thanks for them. Tests pass, except for the abi test, which fails for something unrelated to this PR. Please check it now.

@falbrechtskirchinger
Copy link
Contributor

Tests pass, except for the abi test, which fails for something unrelated to this PR. Please check it now.

Don't worry about the ABI test, it's purely informational and (mostly) intended for the maintainer.

For CMake, you still need to add ZStd to https://github.com/yhirose/cpp-httplib/blob/master/cmake/httplibConfig.cmake.in. Someone else can take care of Meson after the PR has been merged.

I'm short on time and will do a detailed review later if no one else does.

@davidalo
Copy link
Contributor Author

Don't worry about the ABI test, it's purely informational and (mostly) intended for the maintainer.

For CMake, you still need to add ZStd to https://github.com/yhirose/cpp-httplib/blob/master/cmake/httplibConfig.cmake.in. Someone else can take care of Meson after the PR has been merged.

I'm short on time and will do a detailed review later if no one else does.

Thanks for your comments, added zstd to httplibConfig.cmake.in

@yhirose yhirose merged commit c765584 into yhirose:master Mar 16, 2025
14 of 16 checks passed
@yhirose
Copy link
Owner

yhirose commented Mar 16, 2025

@davidalo thanks for your fine contribution!

@davidalo
Copy link
Contributor Author

Thanks everyone for your review and for this great library!

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.

5 participants