-
-
Notifications
You must be signed in to change notification settings - Fork 440
Adding bazelmod #1009
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
base: master
Are you sure you want to change the base?
Adding bazelmod #1009
Conversation
bazel build does not work on macOs, I put it back into draft. |
MODULE.bazel
Outdated
@@ -0,0 +1,2 @@ | |||
module(name = "crowcpp", version = "1.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current version is 1.2.1.2 (version is set on branch only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it. Thank you for noticing!
.github/workflows/build_bazel.yml
Outdated
@@ -0,0 +1,60 @@ | |||
name: Build and test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you prefix the name with "bazel - "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
.github/workflows/build_bazel.yml
Outdated
if [ "$RUNNER_OS" == "Linux" ]; then | ||
curl --tlsv1.2 --proto =https -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 | ||
chmod +x bazel | ||
sudo mv bazel /usr/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work on some systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping bazelisk local now.
BUILD.bazel
Outdated
hdrs = glob(["include/**/*"]), | ||
includes = ["include"], | ||
visibility = ["//visibility:public"], | ||
copts = ["-DCROW_ENABLE_SSL"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crow supports the following options:
option(CROW_BUILD_EXAMPLES "Build the examples in the project" ${CROW_IS_MAIN_PROJECT})
option(CROW_BUILD_TESTS "Build the tests in the project" ${CROW_IS_MAIN_PROJECT})
option(CROW_BUILD_FUZZER "Instrument and build Crow fuzzer" OFF)
option(CROW_AMALGAMATE "Combine all headers into one" OFF)
option(CROW_INSTALL "Add install step for Crow" ON )
option(CROW_USE_BOOST "Use Boost.Asio for Crow" OFF)
option( CROW_RETURNS_OK_ON_HTTP_OPTIONS_REQUEST
"Returns HTTP status code OK (200) instead of 204 for OPTIONS request"
OFF )
option(CROW_ENABLE_SSL "Enable Crow's SSL feature for supporting https" OFF)
option(CROW_ENABLE_COMPRESSION "Enable Crow's Compression feature for supporting compressed http content" OFF)
I would at least set CROW_ENABLE_COMPRESSION too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added proper options for CROW_ENABLE_SSL
and using it with standalone asio.
Also added CROW_ENABLE_COMPRESSION
with zlib support.
All dependencies are pulled from the bazel registry.
Not supporting CROW_USE_BOOST
for now.
Can support try to enable more and more options in the future.
Thank you for the quick review and detailled feedback :) |
There is a problem on macOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set back to Draft as it does not build on MacOS 13
Hei @gittiver |
Hi,
would you accept a bazel module in your code?
I am trying to add CrowCpp to bazel registry and hence did the work anyway.
Also, if you are interested, I can add the test to the bazel build.