Skip to content

Relax :meck constraint to allow 1.x (fixes OTP 29 compile)#64

Merged
TheFirstAvenger merged 1 commit into
DockYard:mainfrom
patrols:relax-meck-for-otp-29
Jun 5, 2026
Merged

Relax :meck constraint to allow 1.x (fixes OTP 29 compile)#64
TheFirstAvenger merged 1 commit into
DockYard:mainfrom
patrols:relax-meck-for-otp-29

Conversation

@patrols
Copy link
Copy Markdown
Contributor

@patrols patrols commented May 24, 2026

Summary

meck 0.9.2, currently pinned by ~> 0.9.2 in mix.exs, no longer compiles on Erlang/OTP 29. The legacy 'catch ...' syntax in src/meck_matcher.erl was deprecated for years and became a compile-time error in OTP 29:

src/meck_matcher.erl:76:9: Warning: 'catch ...' is deprecated; please use 'try ... catch ... end' instead.
...
** (Mix) Could not compile dependency :meck

meck 1.0 (released 2024-12-13) fixes this and meck 1.1.1 is the current latest. flame_on only uses :meck.new/2, :meck.expect/3, and :meck.passthrough/1 (in lib/flame_on/capture/server.ex and lib/flame_on/capture/mock_function.ex), all of which have unchanged signatures in 1.x.

Changes

  • mix.exs: {:meck, "~> 0.9.2"}{:meck, "~> 0.9 or ~> 1.0"}. Existing users with meck 0.9.x already locked in mix.lock are unaffected; only fresh installs or users explicitly bumping pick up 1.x.
  • mix.lock: bumps the repo's pinned meck to 1.1.1 so this repo's CI / mix test actually exercises a working version (without this, mix deps.get keeps the existing 0.9.2 lock entry and the OTP 29 compile still fails).

`meck 0.9.2` no longer compiles on Erlang/OTP 29: the legacy
`'catch ...'` syntax in `meck_matcher.erl` was deprecated for years
and became a compile-time error in OTP 29. `meck 1.0` (released
2024-12-13) fixes this and has API-compatible `new/2`, `expect/3`,
and `passthrough/1` — the only meck APIs flame_on uses
(see `lib/flame_on/capture/server.ex`,
`lib/flame_on/capture/mock_function.ex`).

The constraint is widened to `~> 0.9 or ~> 1.0` so existing users
on OTP <= 28 with `meck 0.9.x` already in their lock are
unaffected — only OTP 29 users will pick up 1.x. The included
`mix.lock` bump moves this repo's pinned `meck` to 1.1.1 so the
test suite installs a working version.

Tested locally on Elixir 1.20.0-rc.6 / OTP 29.0:

    $ mix deps.get
    $ mix test
    ...
    73 passed
@TheFirstAvenger TheFirstAvenger merged commit 9a0cb1d into DockYard:main Jun 5, 2026
1 check passed
@TheFirstAvenger
Copy link
Copy Markdown
Member

🎖❤️⭐️⚪️⭐️💙🎖
Thanks!

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