Skip to content

Bump mochiweb to 3.5.0 so it compiles on OTP 27 - #4245

Open
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:fix/mochiweb-otp27-maybe-keyword
Open

Bump mochiweb to 3.5.0 so it compiles on OTP 27#4245
tas50 wants to merge 1 commit into
chef:mainfrom
tas50:fix/mochiweb-otp27-maybe-keyword

Conversation

@tas50

@tas50 tas50 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

OTP 27 enables the maybe expression (EEP-49) by default, which makes maybe a reserved word. mochiweb 3.1.1 uses it as a bare atom in mochiweb_multipart, so the module no longer parses:

mochiweb_multipart.erl:278:13: syntax error before: ','
mochiweb_multipart.erl:331:9: syntax error before: ','

Those are {maybe, Start} and {maybe, Skip}. The half-dozen function ... is unused warnings reported alongside them are fallout from the failed parse, not separate problems — worth noting, because at a glance they look like the actual issue.

The fix

Upstream quoted the atom ({'maybe', ...}) in 3.2.2. This goes to 3.5.0 = 52bc688521efb5b11d1faf9d0d38c14c31b03b5a, which is the current head of the main branch that all three rebar.config files already declare they track:

{mochiweb, ".*", {git, "https://github.com/mochi/mochiweb", {branch, "main"}}},

The lockfiles had simply held at 666ac57 (3.1.1, 2023-02-12) since then. So this is the lock catching up with the declared intent, landing on a tagged release.

Verified

In containers, from a clean _build:

Result
OTP 26 oc_bifrost, bookshelf and oc_erchef all compile — no regression
OTP 27 with this plus the pc bump, oc_bifrost compiles through to completion — no mochiweb syntax errors, no further blockers in that service

The OTP 27 runs relax require_otp_vsn, still pinned to 26.2.5.21, which is a separate decision.

Related

One incidental finding while testing: lager itself compiles cleanly on OTP 27. It is not a compile-time blocker, whatever its other problems.

OTP 27 enables the maybe expression (EEP-49) by default, which makes
`maybe` a reserved word. mochiweb 3.1.1 uses it as a bare atom in
mochiweb_multipart, so the module no longer parses:

  mochiweb_multipart.erl:278:13: syntax error before: ','
  mochiweb_multipart.erl:331:9: syntax error before: ','

Those are {maybe, Start} and {maybe, Skip}. The half dozen "function
... is unused" warnings reported alongside them are fallout from the
failed parse, not separate problems.

Upstream quoted the atom in 3.2.2. This goes to 3.5.0, which is the
current head of the main branch that all three rebar.config files
already declare they track -- the lockfiles had simply held at
666ac57 (3.1.1, 2023-02-12) since then.

Verified in containers, from a clean _build:

  - OTP 26: oc_bifrost, bookshelf and oc_erchef all compile. No
    regression.
  - OTP 27: with this and the pc plugin bump, oc_bifrost compiles
    through to completion -- no mochiweb syntax errors, no further
    blockers in that service.

The OTP 27 runs relax require_otp_vsn, which is still pinned to
26.2.5.21 and is a separate decision.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50
tas50 requested review from a team as code owners September 7, 2026 17:32
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.

1 participant