Skip to content

fix: boolean conversion#248

Open
attilaolah wants to merge 1 commit intodocling-project:mainfrom
attilaolah:pr-184-fixup
Open

fix: boolean conversion#248
attilaolah wants to merge 1 commit intodocling-project:mainfrom
attilaolah:pr-184-fixup

Conversation

@attilaolah
Copy link
Copy Markdown

@attilaolah attilaolah commented Apr 3, 2026

This is an attempt at fixing the issue described in #184.

This PR updates the #include order in src/parse.h to so that <nlohmann/json.hpp> would come before <cxxopts.hpp>, resolving a build failure when -DDCXXOPTS_USE_UNICODE is defined by the cxxopts pkg-config script.

I'm not 100% sure this is the "correct" way to fix the underlying root cause, but it does resolve the issue described in the original pull request and makes docling-parse compile both with and without CXXOPTS_USE_UNICODE.


To avoid regressions, it would be nice to have a CI step that builds with -DCXXOPTS_USE_UNICODE.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

DCO Check Passed

Thanks @attilaolah, all your commits are properly signed off. 🎉

@mergify
Copy link
Copy Markdown

mergify bot commented Apr 3, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@attilaolah attilaolah marked this pull request as draft April 3, 2026 21:20
@attilaolah

This comment was marked as outdated.

This change fixes a bizarre build failure that happens when trying to
build docling-parse with system cxxopts that define `CXXOPTS_USE_UNICODE`.

The error causes implicit conversion from boolean types to fail, causing
errors like this:

```
In file included from /build/docling_parse-5.7.0/src/parse.h:44,
                 from /build/docling_parse-5.7.0/app/parse_fonts.cpp:17:
/build/docling_parse-5.7.0/src/parse/config.h: In member function ‘nlohmann::json_abi_v3_12_0::json pdflib::decode_config::to_json() const’:
/build/docling_parse-5.7.0/src/parse/config.h:60:58: error: no matching function for call to ‘nlohmann::json_abi_v3_12_0::basic_json<>::basic_json(const bool&)’
   60 |     j["do_sanitization"] = nlohmann::json(do_sanitization);
      |                                                          ^
```

Signed-off-by: Attila Oláh <attila@dorn.haus>
@attilaolah
Copy link
Copy Markdown
Author

python3.14-docling-parse-5.7.0.drv.log

Here are the full build logs with the original failure, without this patch applied. With the patch applied, the build passes.

attilaolah added a commit to attilaolah/citations that referenced this pull request Apr 3, 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