Skip to content

Fix warning in unsuffix/2, add Elixir 1.20/OTP 29 to CI, update mix.lock#11

Merged
josevalim merged 7 commits into
phoenixframework:mainfrom
gilbertwong96:fix/warnings-and-ci-deps
Jun 14, 2026
Merged

Fix warning in unsuffix/2, add Elixir 1.20/OTP 29 to CI, update mix.lock#11
josevalim merged 7 commits into
phoenixframework:mainfrom
gilbertwong96:fix/warnings-and-ci-deps

Conversation

@gilbertwong96

Copy link
Copy Markdown
Contributor

Three small housekeeping changes for the Phoenix.Template project:

1. Pin prefix_size in bitstring size(...) (lib/phoenix/template.ex:505)

Elixir's bitstring size(...) modifier requires a pin operator when a variable is defined outside the match. The current code triggers a compile warning:

warning: the variable "prefix_size" is accessed inside size(...) of a bitstring
but it was defined outside of the match. You must precede it with the pin operator

Adding ^ matches the existing ^suffix::binary and silences the warning.

2. Add Elixir 1.20 / OTP 29 to CI matrix (.github/workflows/ci.yml)

Extends the existing matrix with a 1.20/29 entry so the project is exercised on a current Elixir/OTP pair. Existing 1.9/20 and 1.12/24 entries (the latter with the lint job) are left untouched.

3. Update mix.lock for newer ex_doc UI/UX

mix deps.update --all. All bumps are within the constraints already declared in mix.exs:

dep from to
earmark_parser 1.4.39 1.4.44
ex_doc 0.31.0 0.40.3
jason 1.0.0 1.4.5
makeup 1.1.1 1.2.1
makeup_elixir 0.16.1 1.0.1
makeup_erlang 0.1.3 1.1.0
nimble_parsec 1.4.0 1.4.2
phoenix_html 2.14.3 4.3.0

Verified locally:

  • mix compile --warnings-as-errors — clean
  • mix test — 15/15 pass
  • MIX_ENV=docs mix docs — generates the new ex_doc 0.40 outputs (html, llms.txt, epub)

Elixir requires the pin operator on variables used inside the size(...)
modifier of a bitstring when they are defined outside the match.

  warning: the variable "prefix_size" is accessed inside size(...) of
  a bitstring but it was defined outside of the match. You must
  precede it with the pin operator

  lib/phoenix/template.ex:505: Phoenix.Template.unsuffix/2
Bumps transitive deps to current Hex releases; major bumps for
makeup_elixir, makeup_erlang, and phoenix_html are within the
constraints already declared in mix.exs.

  earmark_parser  1.4.39 → 1.4.44
  ex_doc          0.31.0 → 0.40.3
  jason           1.0.0  → 1.4.5
  makeup          1.1.1  → 1.2.1
  makeup_elixir   0.16.1 → 1.0.1
  makeup_erlang   0.1.3  → 1.1.0
  nimble_parsec   1.4.0  → 1.4.2
  phoenix_html    2.14.3 → 4.3.0

  mix compile --warnings-as-errors: clean
  mix test: 15/15 passed
  mix docs: generated (llms.txt, epub, html)
@josevalim

Copy link
Copy Markdown
Member

I see only part of the changes describe? perhaps you forgot ot push a commit? :)

@gilbertwong96

Copy link
Copy Markdown
Contributor Author

I see only part of the changes describe? perhaps you forgot ot push a commit? :)

Yes, sorry for the mistake. Just updated.

@josevalim

Copy link
Copy Markdown
Member

We may need to update the Ubuntu VMs that we use. :(

@gilbertwong96

Copy link
Copy Markdown
Contributor Author

We may need to update the Ubuntu VMs that we use. :(

Updated to the latest ubuntu lts version already.

@gilbertwong96

Copy link
Copy Markdown
Contributor Author

Please trigger pipeline again @josevalim 😂

@gilbertwong96

Copy link
Copy Markdown
Contributor Author

There's no Elixir 1.9 on ubuntu 24.04 for GitHub workflow, we have to bump minimum Elixir support to 1.12 for this project.

@gilbertwong96

Copy link
Copy Markdown
Contributor Author

Personally, I think it's better to bump minimum version to Elixir 1.16.

@josevalim

Copy link
Copy Markdown
Member

Yes, the syntax you are using requires 1.16

Elixir 1.9 went EOL in 2020 and OTP 20/21/22/23 are not built for
ubuntu-24.04 by builds.hex.pm, so the 1.9/OTP 20 matrix entry
cannot be installed on the current runner. Bumping the minimum
supported runtime to Elixir 1.12 / OTP 24 (the lowest pair available
on ubuntu-24.04) keeps the project in a maintainable state.

  - mix.exs: elixir ~> 1.9  -> ~> 1.16
  - ci.yml:  drop 1.9 / OTP 20 matrix entry and add 1.16 OTP 24 matrix entry
@gilbertwong96 gilbertwong96 force-pushed the fix/warnings-and-ci-deps branch from be4d0a5 to af3a14f Compare June 14, 2026 09:59
@gilbertwong96

Copy link
Copy Markdown
Contributor Author

Updated

@josevalim

Copy link
Copy Markdown
Member

I think you just need mix deps.unlock --unused and you can win this battle!!!

- Bump earmark_parser 1.4.44 -> 1.4.45 (required by ex_doc 0.40.3)
- Drop mime, plug, plug_crypto, telemetry (no longer needed at this level of the template)
@gilbertwong96 gilbertwong96 force-pushed the fix/warnings-and-ci-deps branch from aa86b6f to eda60ba Compare June 14, 2026 11:12
@gilbertwong96

Copy link
Copy Markdown
Contributor Author

Finally, it passed two CI checks, do you think whether we need to add more CI tasks for Elixir 1.17, 1.18 and 1.19 ?

@josevalim

Copy link
Copy Markdown
Member

In theory we test the oldest and most recent supported pairs. So OTP 25 with Elixir v1.16 and then 29 with 1.20. We can add it in a feature PR too!

@josevalim josevalim merged commit a5dd67c into phoenixframework:main Jun 14, 2026
2 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@gilbertwong96 gilbertwong96 deleted the fix/warnings-and-ci-deps branch June 14, 2026 14:41
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