Conversation
…in `tinycbor`, and which doesn't build on macOS/BSDs when `cjson` is installed.
Contributor
Author
|
@gcxfd, can you see if this fixes your |
Contributor
Author
|
It's fixed upstream, too, now: intel/tinycbor#221. So we don't need this fix anymore (if we upgrade our tinycbor version), but I think it's still worth it to have, because otherwise we're pulling in an unneeded dependency, but only sometimes, and there could be some other future error there. |
Contributor
Author
|
intel/tinycbor#221 has now been tested on macOS by @boyland-pf and it works, so we just need to test this one now (with cargo install c2rust --git https://github.com/immunant/c2rust --branch kkysen/tinycbor-disable-cjsonOnce that's tested, we should be able to merge this I think. |
Contributor
|
This also compiles on mac. |
fw-immunant
approved these changes
Jun 28, 2022
Contributor
fw-immunant
left a comment
There was a problem hiding this comment.
Thanks for tracking down the issue here. Fix looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #353.
This unconditionally disables building
tools/json2cbor/intinycbor, which isn't needed for our uses oftinycborand is an optional dependency. Normally it is autodetected whencjsonis found, and it still is, but now we append to the generated.configfile to explicitly disable it.On macOS/BSD,
tools/json2cbor/json2cbor.cdoesn't build because it defines_POSIX_C_SOURCE, which in BSD libc, preventsasprintffrom being declared, which is used bytools/json2cbor/json2cbor.c. This can be fixed by removing the_POSIX_C_SOURCEdefine, but that'd have to be fixed in a patch or upstream in https://github.com/intel/tinycbor, which it probably should be, but the fix would take longer.However, either way, we don't need
json2cbor, so we can just always disable it, and it's better to be explicit about our dependencies than unknowingly having an optional dependency oncjsonthat affects the build.