Skip to content

Conversation

@J-B-Blankenship
Copy link

@J-B-Blankenship J-B-Blankenship commented Jan 27, 2026

CMake Approach Issues

First Issue
Non-ASCII characters cannot be parsed by glob.

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)

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 the cmake toolchain.

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.

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 J-B-Blankenship changed the title Refine srcs glob to include and exclude patterns Updated Bazel Instructions Jan 28, 2026
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.

1 participant