Opened 15 months ago
Closed 11 months ago
#70842 closed defect (fixed)
rapidjson: error: cannot assign to non-static data member 'length' with const-qualified type 'const SizeType' (aka 'const unsigned int')
| Reported by: | kwolcott | Owned by: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | sequoia | Cc: | barracuda156 |
| Port: | rapidjson |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
const SizeType' (aka 'const unsigned int')
319 | GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
| ~~~~~~ ^
/opt/local/include/rapidjson/document.h:325:20: note: non-static data member 'length' declared const here
325 | const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
| ~~~~~~~~~~~~~~~^~~~~~
1 error generated.
make[2]: *** [src/lfortran/CMakeFiles/lfortran_lib.dir/ast_to_json.cpp.o] Error 1
MacOS 15.0
Attachments (1)
Change History (8)
Changed 15 months ago by kwolcott
| Attachment: | lfortran_port_build_failure.log.bz2 added |
|---|
comment:1 follow-up: 3 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | barracuda156 added |
|---|---|
| Description: | modified (diff) |
| Keywords: | sequoia added |
| Owner: | set to MarcusCalhoun-Lopez |
| Port: | rapidjson added |
| Status: | new → assigned |
comment:3 Changed 11 months ago by barracuda156
Replying to ryandesign:
Remember to use WikiFormatting.
You didn't show what the error was but from your log it was:
/opt/local/include/rapidjson/document.h:319:82: error: cannot assign to non-static data member 'length' with const-qualified type 'const SizeType' (aka 'const unsigned int')That sounds like a bug in the port that provides the file /opt/local/include/rapidjson/document.h, namely rapidjson.
Yes, it is rapidjson is broken. I have seen a number of examples of the same failure. Just now:
[292/478] /opt/local/bin/g++-mp-14 -DARROW_EXTRA_ERROR_CONTEXT -DARROW_WITH_TIMING_TESTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/build/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src/generated -isystem /opt/local/include -Wno-noexcept-type -Wno-self-move -pipe -I/opt/local/libexec/boost/1.81/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.81/include -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -fdiagnostics-color=always -Wall -fno-semantic-interposition -maltivec -O3 -DNDEBUG -O2 -ftree-vectorize -std=c++17 -arch ppc -mmacosx-version-min=10.6 -fPIC -MD -MT src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o -MF src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o.d -o src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src/arrow/extension/opaque.cc
FAILED: src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o
/opt/local/bin/g++-mp-14 -DARROW_EXTRA_ERROR_CONTEXT -DARROW_WITH_TIMING_TESTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/build/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src/generated -isystem /opt/local/include -Wno-noexcept-type -Wno-self-move -pipe -I/opt/local/libexec/boost/1.81/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.81/include -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -fdiagnostics-color=always -Wall -fno-semantic-interposition -maltivec -O3 -DNDEBUG -O2 -ftree-vectorize -std=c++17 -arch ppc -mmacosx-version-min=10.6 -fPIC -MD -MT src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o -MF src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o.d -o src/arrow/CMakeFiles/arrow_json.dir/extension/opaque.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src/arrow/extension/opaque.cc
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_apache-arrow/apache-arrow/work/arrow-19.0.0/cpp/src/arrow/extension/opaque.cc:25:
/opt/local/include/rapidjson/document.h: In member function 'arrow::rapidjson::GenericStringRef<CharType>& arrow::rapidjson::GenericStringRef<CharType>::operator=(const arrow::rapidjson::GenericStringRef<CharType>&)':
/opt/local/include/rapidjson/document.h:319:82: error: assignment of read-only member 'arrow::rapidjson::GenericStringRef<CharType>::length'
319 | GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
| ~~~~~~~^~~~~~~~~~~~
It is fixed in rapidjson-devel. However it is not obvious for anyone just trying to build some port which relies on rapidjson that instead rapidjson-devel must be used. The port should be updated or at least a fix for this backported.
comment:4 Changed 11 months ago by barracuda156
Replying to kwolcott:
Looks like it is working now.
The issue has nothing to do with lfortran, it is a bug in a version of rapidjson which MacPorts uses. It is still unfixed.
comment:5 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)
| Port: | lfortran removed |
|---|---|
| Summary: | lfortran port fails to compile → rapidjson: error: cannot assign to non-static data member 'length' with const-qualified type 'const SizeType' (aka 'const unsigned int') |
The port should be updated
There's nothing to update to; the rapidjson port is already at the latest stable version, 1.1.0. There is already an upstream bug report asking the developers to release a new stable version. Until that happens, you can try to identify which upstream commit fixed it so that it can be backported.
comment:6 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)
I believe this is the upstream bug: https://github.com/Tencent/rapidjson/issues/718
And this the fix: https://github.com/Tencent/rapidjson/pull/719
but I haven't tested the fix. Let us know if you test it and it works.
comment:7 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |

Remember to use WikiFormatting.
You didn't show what the error was but from your log it was:
That sounds like a bug in the port that provides the file /opt/local/include/rapidjson/document.h, namely rapidjson.