Jens Geyer created THRIFT-6186:
----------------------------------

             Summary: lib/erl eunit tests cannot run on OTP 29: the pinned meck 
0.9.2 does not compile
                 Key: THRIFT-6186
                 URL: https://issues.apache.org/jira/browse/THRIFT-6186
             Project: Thrift
          Issue Type: Bug
          Components: Erlang - Library, Build Process
            Reporter: Jens Geyer


lib/erl itself compiles on OTP 29, but {{make -C lib/erl check}} cannot get as 
far as running a test, because the eunit-only {{meck}} dependency does not 
compile there.

rebar.config pins it in the test profile:

{code}
{profiles, [
    {test, [
        {deps, [{meck, "0.9.2"}]},
{code}

meck 0.9.2 compiles with warnings treated as errors, and {{catch ...}} became 
deprecated in OTP 29:

{code}
===> Fetching meck v0.9.2
===> Compiling meck
===> Compiling _build/test/lib/meck/src/meck_matcher.erl failed
    /-- _build/test/lib/meck/src/meck_matcher.erl:
    |
 76 |  (catch erlang:apply(hamcrest, assert_that, [Value, HamcrestMatcher])) == 
true;
    |   \-- 'catch ...' is deprecated; please use 'try ... catch ... end' 
instead.
Compile directive 'nowarn_deprecated_catch' can be used to suppress warnings in 
selected modules.
{code}

Verified on a clean ubuntu:24.04 with the prebuilt OTP 29.0.6 build from 
builds.hex.pm. 25.3.2.9, 26.2.5.21, 27.3.4.17 and 28.5.0.6 all give 349 tests 
and 0 failures on the same tree, so this is specific to 29.

Worth noting that lib/erl's own sources use the same deprecated construct in 
several places -- thrift_sslsocket_transport, thrift_reconnecting_client and 
thrift_socket_server among them. Those are warnings rather than errors because 
the project does not set warnings_as_errors, so they do not block the build 
today, but they are the same cleanup and could reasonably be done in the same 
pass.

Options, roughly in order of preference:

# Raise the meck pin. 1.0.0 is current and compiles on 29.
# Keep 0.9.2 and add {{nowarn_deprecated_catch}} for the dependency, which is 
awkward to do cleanly for a hex dep.

The CI job added in THRIFT-6171 covers 25.3, 26.2, 27.3 and 28.5 and 
deliberately leaves 29 out, with a comment in the matrix pointing here. Once 
this is fixed, 29 should be added to that matrix.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to