Updated Bazel Instructions#1291
Conversation
Non-ASCII characters cannot be parsed by glob. Resolves the following error when trying to build: ERROR: /root/.cache/bazel/_bazel_root/646bcbb063181c5dac5a581e1c4fefdd/external/_main~_repo_rules~cpr/BUILD.bazel:22:6: Foreign Cc - CMake: Building cpr failed: error reading file '@@_main~_repo_rules~cpr//:test/data/test_file_hello_äüöp_2585_你好.txt': /root/.cache/bazel/_bazel_root/646bcbb063181c5dac5a581e1c4fefdd/external/_main~_repo_rules~cpr/test/data/test_file_hello_äüöp_2585_你好.txt (No such file or directory)
Updated Bazel dependencies and build configuration for cpr.
Removed reference to external Bazel repository due to being years out of date.
|
@J-B-Blankenship thanks for contributing! Could you please provide a minimal example for this? I've never really used bazel and this would make testing a bit easier. |
I have this repo where it is being used: https://github.com/RogueDB/roguedb-open-source. It should be stable for the If you want a quick test, you can do the following:
Inside the container:
The change primarily does the following:
Please let me know if you have additional questions. If I can make the instructions clearer, I can also do that. |
* Refine srcs glob to include and exclude patterns Non-ASCII characters cannot be parsed by glob. Resolves the following error when trying to build: ERROR: /root/.cache/bazel/_bazel_root/646bcbb063181c5dac5a581e1c4fefdd/external/_main~_repo_rules~cpr/BUILD.bazel:22:6: Foreign Cc - CMake: Building cpr failed: error reading file '@@_main~_repo_rules~cpr//:test/data/test_file_hello_äüöp_2585_你好.txt': /root/.cache/bazel/_bazel_root/646bcbb063181c5dac5a581e1c4fefdd/external/_main~_repo_rules~cpr/test/data/test_file_hello_äüöp_2585_你好.txt (No such file or directory) * Refactor Bazel setup for cpr library Updated Bazel dependencies and build configuration for cpr. * Update README to remove Bazel link Removed reference to external Bazel repository due to being years out of date.
|
@J-B-Blankenship Does the https://registry.bazel.build/modules/cpr module not work for you? |
I honestly just looked at the README.md. I did not try the Bazel registry (didn't know it existed). |
|
No problem. I can put up a PR to update the instructions. |
CMake Approach Issues
First Issue
Non-ASCII characters cannot be parsed by glob.
Second Issue
Resolving this error still causes an issue with
<filesystem>. I was unable to override C++17 for C++20 to make this work with thecmaketoolchain.Repo Reference Issue
In addition, the referenced Bazel repo is deprecated by several years. I was unable to get them to work with BAZEL modules.
Solution
Use Bazel to build the project with a patch to remove the generated version file
cpr/cprver.h(only created with the CMake command).This was confirmed to work on Ubuntu 24.04. Modifications should be straightforward for Bazel users on Windows or Mac as it uses common toolchains.