Skip to content

Conversation

@RileyLeff
Copy link

Hi, looks like jsonify depends on a version of rapidjsonr that isn't available on CRAN. The DESCRIPTION asks for 1.2.1 but the latest available is 1.2.0 and the CRAN page doesn't seem to link to a github repo. This was breaking package installs for me. Installs fine with 1.2.0.

If you're also currently stuck on a jsonify install and this PR hasn't been merged yet, try this:

pak::pak("rileyleff/jsonify")

I tried running the tests and found that the tests don't work, but they fail in the exact same way if I revert to the previous commit, so I think it's fine:

rileyleff@redwood jsonify % Rscript -e "devtools::test()"
ℹ Testing jsonify
✔ | F W  S  OK | Context
✔ |          2 | as_json                                                                                                            
⠏ |          0 | simplify                                                                                                           Assertion failed: (IsArray()), function Size, file document.h, line 1635.
zsh: abort      Rscript -e "devtools::test()"

@dcooley
Copy link
Collaborator

dcooley commented Oct 22, 2025

I'm not sure I see the need to downgrade the linked version.

The description specifies the 'remotes' for rapidjsonr here

remotes:
https://github.com/SymbolixAU/rapidjsonr

The CRAN version links to 1.2.0


The tests work fine for me

> devtools::test()
ℹ Testing jsonify
✔ | F W  S  OK | Context
✔ |          2 | as_json                                                                                                       
✔ |         28 | simplify                                                                                                      
✔ |      1  93 | from_json                                                                                                     
✔ |          9 | from_ndjson                                                                                                   
✔ |         12 | columns                                                                                                       
✔ |         58 | dataframes                                                                                                    
✔ |         30 | Dates                                                                                                         
✔ |         25 | digits                                                                                                        
✔ |         28 | lists                                                                                                         
✔ |          7 | matrix                                                                                                        
✔ |          4 | prettify                                                                                                      
✔ |          8 | SEXPTYPE                                                                                                      
✔ |          1 | source code                                                                                                   
✔ |         28 | unbox                                                                                                         
✔ |         11 | validate                                                                                                      
✔ |         47 | vectors                                                                                                       
✔ |         12 | to_ndjson                                                                                                     

══ Results ════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
── Skipped tests (1) ──────────────────────────────────────────────────────────────────────────────────────────────────────────
• Tests fail on windows (1): test-from_json.R:431:3

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 403 ]

@RileyLeff
Copy link
Author

RileyLeff commented Oct 23, 2025

Reading this back, I probably should've provided some more context in my first message.

My initial problem was that I couldn't get CRAN jsonify to install from source after upgrading to MacOS Tahoe on M1. Source install on ubuntu x86 seems to work fine. The error message is pasted at the end of this comment because it's very long. CRAN has jsonify 1.2.2 as the most recent version. For some reason the binary install from CRAN wasn't working for me yesterday, but seems to be working ok now, maybe an environment problem on my end. Source install from CRAN still gives me the same error today.

I forked this repo with the intention of fixing the compilation bug, but found that someone else had already edited file of interest, commenting that it was an update for jsonify version 1.2.3.

So naturally I tried installing jsonify directly from this repo, but got this error:

pak::pak("SymbolixAU/jsonify")
✔ Updated metadata database: 2.95 MB in 2 files.
✔ Updating metadata database ... done
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:

  • SymbolixAU/jsonify: Can't install dependency rapidjsonr (>= 1.2.1)
    Type .Last.error to see the more details.

So while my first thought was to just bump down the dependency to the latest CRAN version, seems like the problem is that pak is not detecting the remote correctly. Interestingly this seems to work fine if I install with devtools or remotes. My understanding is that the remotes section of the description should be formatted like SymbolixAU/rapidjsonr? Currently it's bare URL. Not a huge problem but was just more troubleshooting than I would like to do to install a package.

Thanks for quick response!

Long compilation error message below (which I believe is fixed as of 1.2.3)

! Failed to build source package jsonify.
Full installation output:

  • installing source package ‘jsonify’ ...
    ** this is package ‘jsonify’ version ‘1.2.2’
    ** package ‘jsonify’ successfully unpacked and MD5 sums checked
    staged installation is only possible with locking
    ** using non-staged installation
    ** libs
    using C++ compiler: ‘Apple clang version 17.0.0 (clang-1700.3.19.1)’
    using C++11
    using SDK: ‘’
    clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.5.1/lib/R/include" -DNDEBUG -DSTRICT_R_HEADERS -I'/Users/rileyleff/.r/packages/rapidjsonr/include' -I'/Users/rileyleff/.r/packages/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -I../inst/include/ -fPIC -g -O2 -std=gnu++11 -std=c++17 -Wall -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
    clang++ -std=gnu++11 -I"/opt/homebrew/Cellar/r/4.5.1/lib/R/include" -DNDEBUG -DSTRICT_R_HEADERS -I'/Users/rileyleff/.r/packages/rapidjsonr/include' -I'/Users/rileyleff/.r/packages/Rcpp/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -I../inst/include/ -fPIC -g -O2 -std=gnu++11 -std=c++17 -Wall -pedantic -fdiagnostics-color=always -c from_json.cpp -o from_json.o
    In file included from from_json.cpp:1:
    In file included from ../inst/include/jsonify/from_json/api.hpp:5:
    ../inst/include/jsonify/from_json/from_json.hpp:84:22: error: no matching conversion for functional-style cast from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'std::string' (aka 'basic_string')
    84 | names[ i++ ] = std::string( key );
    | ^~~~~~~~~~~~~~~~~~
    ../inst/include/jsonify/from_json/from_json.hpp:131:16: note: in instantiation of function template specialization 'jsonify::from_json::parse_object<rapidjson::GenericValue<rapidjson::UTF8<>>>' requested here
    131 | return parse_object( json, simplify, fill_na );
    | ^
    ../inst/include/jsonify/from_json/from_json.hpp:190:12: note: in instantiation of function template specialization 'jsonify::from_json::parse_json<rapidjson::GenericValue<rapidjson::UTF8<>>>' requested here
    190 | return parse_json( json, simplify, fill_na );
    | ^
    ../inst/include/jsonify/from_json/api.hpp:37:32: note: in instantiation of function template specialization 'jsonify::from_json::from_json<rapidjson::GenericValue<rapidjson::UTF8<>>>' requested here
    37 | return jsonify::from_json::from_json( doc, simplify, fill_na );
    | ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1012:64: note: candidate constructor not viable: no known conversion from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'const allocator_type' (aka 'const std::allocator') for 1st argument
    1012 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1022:71: note: candidate constructor not viable: no known conversion from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'const string' for 1st argument
    1022 | _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS basic_string(const basic_string& __str)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1042:55: note: candidate constructor not viable: no known conversion from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'string' for 1st argument
    1042 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
    | ^ ~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1082:55: note: candidate constructor template not viable: no known conversion from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'const char ' for 1st argument
    1082 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT
    __s) {
    | ^ ~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1216:55: note: candidate constructor not viable: no known conversion from 'const GenericValue<UTF8, MemoryPoolAllocator>' to 'initializer_list' for 1st argument
    1216 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il) {
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1174:42: note: candidate template ignored: requirement '__can_be_converted_to_string_view<char, std::char_traits, rapidjson::GenericValue<rapidjson::UTF8, rapidjson::MemoryPoolAllocatorrapidjson::CrtAllocator>>::value' was not satisfied [with _Tp = GenericValue<UTF8, MemoryPoolAllocator>]
    1174 | _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
    | ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1006:55: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    1006 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string()
    | ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1032:3: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    1032 | basic_string(const basic_string& __str, const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1063:55: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    1063 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str, const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1088:55: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    1088 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1098:55: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    1098 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) {
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1110:55: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    1110 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c) { __init(__n, __c); }
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1184:42: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    1184 | _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t, const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1191:55: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    1191 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(_InputIterator __first, _InputIterator __last) {
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1220:55: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    1220 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il, const _Allocator& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:948:64: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
    948 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
    | ^
    949 | __uninitialized_size_tag, size_type __size, const allocator_type& __a)
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1104:3: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
    1104 | basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1134:55: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
    1134 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(size_type __n, _CharT __c, const _Allocator& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1149:3: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
    1149 | basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator())
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1197:3: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
    1197 | basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:969:3: note: candidate constructor template not viable: requires 4 arguments, but 1 was provided
    969 | basic_string(__init_with_sentinel_tag, _Iter __first, _Sent __last, const allocator_type& __a)
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1140:3: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
    1140 | basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator())
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string:1162:3: note: candidate constructor template not viable: requires at least 3 arguments, but 1 was provided
    1162 | basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type())
    | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    make: *** [from_json.o] Error 1
    ERROR: compilation failed for package ‘jsonify’
  • removing ‘/private/var/folders/b8/lbc6z9z95nx32b8k58dd2lg00000gn/T/RtmpJ0GtHd/pkg-lib138127fb056b9/jsonify’
    Type .Last.error to see the more details.

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.

2 participants