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

Crowcpp 0.2 Fork, support for FreeBSD #4085

Merged
merged 14 commits into from
Jan 11, 2021
Merged

Crowcpp 0.2 Fork, support for FreeBSD #4085

merged 14 commits into from
Jan 11, 2021

Conversation

madduci
Copy link
Contributor

@madduci madduci commented Jan 5, 2021

Specify library name and version: crowcpp-crow/0.2

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@madduci madduci mentioned this pull request Jan 5, 2021
@conan-center-bot
Copy link
Collaborator

Failure in build 1 (cea8765d4d46c4a134b4e3a9e9981db6973c8221):

  • crowcpp-crow/0.2
    • Hooks errors detected:
      • [HOOK - conan-center.py] pre_export(): ERROR: [NO FINAL ENDLINE (KB-H041)] File '/home/conan/w/cci_PR-4085/recipes/crowcpp-crow/all/patches/001-disable-examples.patch' does not end with an endline (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H041)

@madduci
Copy link
Contributor Author

madduci commented Jan 5, 2021

see #3064

@conan-center-bot
Copy link
Collaborator

Failure in build 2 (66d7a7479966af07ca08ed21ccb4523647a1a9e4):

  • crowcpp-crow/0.2
    • Hooks errors detected:
      • [HOOK - conan-center.py] pre_export(): ERROR: [NO FINAL ENDLINE (KB-H041)] File '/home/conan/w/cci_PR-4085/recipes/crowcpp-crow/all/patches/001-disable-examples.patch' does not end with an endline (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H041)

@conan-center-bot
Copy link
Collaborator

Some configurations of 'crowcpp-crow/0.2' failed in build 3 (0e3b07529151f7a0facd3545ab3e75fdfdb9ce77):

@conan-center-bot
Copy link
Collaborator

All green in build 4 (c62d8027588d7d270d274c1741ba3d821b07d311)! 😊

include_directories("${PROJECT_SOURCE_DIR}")

-add_subdirectory(examples)
+#add_subdirectory(examples)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I read it correctly, then you are part of this project right?

Could you please consider adding a CMake option like BUILD_EXAMPLES so that we don't need to patch it?

Copy link
Contributor Author

@madduci madduci Jan 5, 2021

Choose a reason for hiding this comment

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

I'm not part of the project. The patch addresses an issue in the library that has been solved after the release tag v0.2. Until there's no new release of the library, I'm skipping the build of the examples, leaving only the tests active.
EDIT: This is the fix and it's in the master branch, not yet released: CrowCpp/Crow#63

Copy link
Contributor

Choose a reason for hiding this comment

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

The fix you're talking about is to be able to build examples in all environments.
But conan cci recipes prefer not to build examples at all.

To make it easy for the recipe, it would be great having this add_subdirectory(examples) under if (BUILD_EXAMPLES) and we would just BUILD_EXAMPLES to False, instead of patching.

What I suggest:

  • to make a PR in the crow project to add this variable (it may be ON by default, to not change the current behaviour)
  • then ask the developer to release 0.2.1.

After that patch for examples will not be required at all.

It might be an overkill and/or too difficult, but it would make maintenance easier for the future versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I understand your point, which I totally share. I will try to do my best

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've submitted the PR in the repository, the project maintainers plan to do a release soon. I will update the recipe once they'll release a new version!

include_directories("${PROJECT_SOURCE_DIR}")

-add_subdirectory(examples)
+#add_subdirectory(examples)
Copy link
Contributor

Choose a reason for hiding this comment

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

The fix you're talking about is to be able to build examples in all environments.
But conan cci recipes prefer not to build examples at all.

To make it easy for the recipe, it would be great having this add_subdirectory(examples) under if (BUILD_EXAMPLES) and we would just BUILD_EXAMPLES to False, instead of patching.

What I suggest:

  • to make a PR in the crow project to add this variable (it may be ON by default, to not change the current behaviour)
  • then ask the developer to release 0.2.1.

After that patch for examples will not be required at all.

It might be an overkill and/or too difficult, but it would make maintenance easier for the future versions.

Comment on lines 9 to 10
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14 -pedantic -Wextra")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -pedantic -Wextra")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to change the C++ version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've seen that no C++14 constructs are used, but C++11 is required by some boost header used in the project. Since the conan build system is using gcc 4.9, I've pushed it to C++11 instead of 14

Copy link
Contributor

Choose a reason for hiding this comment

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

We try to minimize the patches we apply, but this one follows the draft rules #3903 so okay!

Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

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

According to the project https://github.com/CrowCpp/crow#attributions

There's a few missing external deps... I dont know where they come from though (not in the CMake)

@The-EDev
Copy link
Contributor

The-EDev commented Jan 5, 2021

@prince-chrismc

According to the project https://github.com/CrowCpp/crow#attributions

There's a few missing external deps... I dont know where they come from though (not in the CMake)

The attributions are for libraries that are copied into the code, all the mentioned libraries' header files are inside include/crow already. Hence why Boost and OpenSSL are not on the list, since they require the user to install them.

@prince-chrismc
Copy link
Contributor

prince-chrismc commented Jan 5, 2021

Ahhh thank you for the clarification!

I would discourage that since the consumer does not have any choice about which version is used... like the nodejs/http_parser is very common... I see it's wrapped with a crow namespace so it's on the safe side... but usually this produces conflicts

the only blocker is my question #4085 (comment)

I saw in my second pass it's a windows limitation for C++14 but that was a unix section...

Comment on lines 14 to 22
@@ -42,7 +42,7 @@ set(PROJECT_INCLUDE_DIR
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")

-add_subdirectory(examples)
+#add_subdirectory(examples)

if (MSVC)
else()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@@ -42,7 +42,7 @@ set(PROJECT_INCLUDE_DIR
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
-add_subdirectory(examples)
+#add_subdirectory(examples)
if (MSVC)
else()

Not required if you only build amalgamation as target.

@conan-center-bot
Copy link
Collaborator

All green in build 5 (3a399287e977d97005d33293ae91ffaec964b3b4)! 😊

@prince-chrismc
Copy link
Contributor

Now that you are building only the main target you should be able to remove the patches and openssl requirement

you might need to explicitly copy ant not use the cmake.install in that case

@conan-center-bot
Copy link
Collaborator

All green in build 7 (29433a3cc31040fe9217d1c6556d943b1d0df971)! 😊

prince-chrismc
prince-chrismc previously approved these changes Jan 8, 2021
Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

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

LGTM!

mathbunnyru
mathbunnyru previously approved these changes Jan 10, 2021
Extending OS recognition to FreeBSD

Co-authored-by: Anonymous Maarten <[email protected]>
@mathbunnyru
Copy link
Contributor

@ericLemanissier could you run freebsd build, please?

@conan-center-bot
Copy link
Collaborator

All green in build 8 (0a8b5bdf40765f475378016d877057827d45031d)! 😊

@madebr
Copy link
Contributor

madebr commented Jan 11, 2021

@mathbunnyru

@ericLemanissier could you run freebsd build, please?

You need to add FreeBSD to the title, for his script to pick up this pr.

@madduci madduci changed the title Crowcpp 0.2 Fork Crowcpp 0.2 Fork, support for FreeBSD Jan 11, 2021
@conan-center-bot
Copy link
Collaborator

All green in build 9 (0a8b5bdf40765f475378016d877057827d45031d)! 😊

@ericLemanissier
Copy link
Contributor

ericLemanissier commented Jan 11, 2021

https://github.com/ericLemanissier/conan-center-index/runs/1679500069?check_suite_focus=true failed:

warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/tools/gcc.jam:226: in gcc.init from module gcc
error: toolset gcc initialization:
error: no command provided, default command 'g++' not found
error: initialized from
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/build/toolset.jam:44: in toolset.using from module toolset
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/build-system.jam:658: in load from module build-system
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/kernel/modules.jam:295: in import from module modules
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/kernel/bootstrap.jam:139: in boost-build from module
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/boost-build.jam:8: in module scope from module

it tries to invoke g++, even if the profile should use clang

@mathbunnyru
Copy link
Contributor

https://github.com/ericLemanissier/conan-center-index/runs/1679500069?check_suite_focus=true failed:

warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/tools/gcc.jam:226: in gcc.init from module gcc
error: toolset gcc initialization:
error: no command provided, default command 'g++' not found
error: initialized from
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/build/toolset.jam:44: in toolset.using from module toolset
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/build-system.jam:658: in load from module build-system
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/kernel/modules.jam:295: in import from module modules
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/src/kernel/bootstrap.jam:139: in boost-build from module
/root/.conan/data/b2/4.2.0/_/_/build/723bca155d56e10e54e03a13336d979ffec56a56/source/boost-build.jam:8: in module scope from module

it tries to invoke g++, even if the profile should use clang

As far as I can tell, the problem is with boost, so I think this recipe is good to go.

@SSE4
Copy link
Contributor

SSE4 commented Jan 11, 2021

@mathbunnyru I remember FreeBSD switched to clang some time ago, that might be required to use clang toolset instead of gcc in boost recipe. also, what about the conan profile for FreeBSD, does it use clang or gcc?

@madebr
Copy link
Contributor

madebr commented Jan 11, 2021

The problem is with boost.build (b2), not boost itself.

@madduci
Copy link
Contributor Author

madduci commented Jan 11, 2021

If my PR in the main project is approved, Boost and OpenSSL will be fully optional (only required by tests and examples), but the recipe for the "amalgamation" target will not require Boost and OpenSSL anymore. They will be required directly in the user's "conanfile.txt" or "conanfile.py" recipe in the project where crow is needed.

@conan-center-bot conan-center-bot merged commit 39698b6 into conan-io:master Jan 11, 2021
@madduci madduci deleted the crowcpp-crow branch January 12, 2021 08:14
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.

10 participants