Jens Geyer created THRIFT-6255:
----------------------------------
Summary: OCaml: lib/ocaml does not compile on any OCaml release
since 4.06
Key: THRIFT-6255
URL: https://issues.apache.org/jira/browse/THRIFT-6255
Project: Thrift
Issue Type: Bug
Components: OCaml - Library
Reporter: Jens Geyer
{{lib/ocaml}} still uses the mutable-string API that OCaml removed in 4.06
(2017), when {{-safe-string}} became the default and {{string}} became
immutable:
* {{lib/ocaml/src/TFramedTransport.ml:9}}, {{:51}}, {{:62}} -- {{String.create}}
* the same file, {{String.unsafe_set}} in {{encode_frame_size}}
* {{lib/ocaml/src/TBinaryProtocol.ml}} -- three more of the same
{{String.create}}, {{String.set}} and {{String.unsafe_set}} were deprecated in
4.02 and deleted in 4.06, so the binding fails to build on every compiler a
user is likely to have. That also means no fix to {{lib/ocaml}} can be tested,
which blocks ordinary maintenance -- the framed-transport issue filed alongside
this one is an example.
h2. Suggested fix
Port the mutable-string uses to {{Bytes}} ({{Bytes.create}},
{{Bytes.unsafe_set}}, {{Bytes.to_string}}/{{Bytes.of_string}} at the
boundaries), which is the standard 4.06 migration and keeps the public
{{string}}-typed interface where it is part of the transport signature.
If the binding is not to be maintained, the alternative is to deprecate it the
way the Swift binding was, so that its state is at least recorded. Either way
the current situation -- shipped in the release tarball, not buildable --
should not stand.
Related: THRIFT-4092 (add OCaml to the build process) cannot be acted on before
this.
_Drafted with AI assistance (Claude Opus 5); reviewed and filed by Jens Geyer._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)