Skip to content

Update to Elixir 1.18 / OTP 27#281

Open
valpackett wants to merge 19 commits intomainfrom
push-kpzoowvkulko
Open

Update to Elixir 1.18 / OTP 27#281
valpackett wants to merge 19 commits intomainfrom
push-kpzoowvkulko

Conversation

@valpackett
Copy link
Copy Markdown
Collaborator

All the things I've had to fix to start the server on my laptop with current Elixir & OTP because I was too lazy to get older versions (: See commit messages for the actual errors that popped up.

mix release also requires removing json from mix.exs due to the new built-in json, but that would break things on older Elixir so that should be done only when actually upgrading the "officially used" version…

Tests have 2 failures for me:

  • test/contact/eci_data_test.exs:122 — the order of items is swapped around 🤷‍♀️
  • test/server/mtt_worker_test.exs:151 — length(mbox) is 0 🤔

@tttp
Copy link
Copy Markdown
Member

tttp commented Apr 15, 2025

Hi,

Could you update the version in mix.exs and I'll merge.

What do you use to install elixir? asdf?

as for the errors: eci_data_test: order shouldn't matter, and in any case, the ECI as a campaign tactic has been killed by the EU.

mtt_worker_test: I'll have a look. does it succeed on the test "live sending" ? it might be he test mailbox that isn't working with 1.18/your config

@valpackett
Copy link
Copy Markdown
Collaborator Author

What do you use to install elixir? asdf?

Since it wasn't packaged in Chimera Linux, I just did curl -LO https://github.com/elixir-lang/elixir/releases/download/v1.18.2/elixir-otp-27.zip && mkdir ~/.local/share/elixir/ && cd ~/.local/share/elixir/ && tar -xvf ~/Downloads/elixir-otp-27.zip when picking up Elixir again for another project recently 🤣

Could you update the version in mix.exs and I'll merge.

Sure

it might be he test mailbox that isn't working with 1.18/your config

Yeah, I might investigate that further then. All good with these dep updates on 1.12?

@tttp
Copy link
Copy Markdown
Member

tttp commented Apr 17, 2025

I'll move to elixir 1.18 too, what would be the point of keeping 1.12?

and now that I write it:

  • could you update the major version and change the readme?

@valpackett valpackett changed the title Update dependencies to work on Elixir 1.18 / OTP 27 Update to Elixir 1.18 / OTP 27 Apr 18, 2025
@tttp tttp marked this pull request as draft April 18, 2025 06:50
@tttp
Copy link
Copy Markdown
Member

tttp commented Apr 23, 2025

@valpackett is there anything blocking here that we can help with?

@valpackett
Copy link
Copy Markdown
Collaborator Author

@tttp well… maybe a description of the expectations wrt how the test suite behaves now :) but I'll run the tests in a container with older elixir and compare.

@valpackett valpackett force-pushed the push-kpzoowvkulko branch 6 times, most recently from 49ada79 to d383ed9 Compare May 8, 2025 08:53
@valpackett valpackett marked this pull request as ready for review May 8, 2025 08:58
@valpackett
Copy link
Copy Markdown
Collaborator Author

OK, this should be ready, the test suite has equivalent results before and after the upgrade (the mtt_worker_test.exs:152 mailbox thing failed in CI even for the current live branch).

@valpackett valpackett force-pushed the push-kpzoowvkulko branch from 2cb73f4 to f6f0ee9 Compare May 27, 2025 23:47
This seems to help with the 3 intermittent failures due to Stats being down.
With Elixir 1.18, `metadata` being in the main logger options results in:

** (Mix) Could not start application logger: exited in: Logger.App.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) argument error
            (stdlib 6.2) :maps.from_list([:request_id, :user, :operation])
            (elixir 1.18.2) lib/enum.ex:1543: Enum.into_map/1
            (logger 1.18.2) lib/logger/app.ex:40: Logger.App.start/2
`null` goes into migrations, not schemas. It's been ignored so far but
with ecto 3.8.0 it will raise an error.

https://elixirforum.com/t/ecto-schema-argumenterror-invalid-option-null-for-field-3/49631
Fixes compilation on Elixir 1.18 / OTP 27
Required to fix the following compile error with Elixir 1.18:
** (Kernel.TypespecError) lib/ecto/query.ex:428: type dynamic/0 is a built-in type and it cannot be redefined

Since ecto_trail is stuck on an older requirement, use override.
The old version of rabbit_common fails to compile on Erlang/OTP 27:

===> Compiling src/rabbit_types.erl failed
src/rabbit_types.erl:12:20: syntax error before: '/'
src/rabbit_types.erl:29:16: syntax error before: '::'
src/rabbit_types.erl:50:43: syntax error before: 'maybe'
src/rabbit_types.erl:54:36: syntax error before: 'maybe'

The rabbitmq stuff forces the plug_cowboy update due to rabbit_common
depending on ranch which is also used by cowboy.
Docs are discarded for private functions, I think this one makes sense
for the public one
Even with the json dep in mix.exs, JSON seems to refer to the built-in now
and we get the "JSON.encode/1 does not exist" error
@valpackett valpackett force-pushed the push-kpzoowvkulko branch 6 times, most recently from dea0e7b to 8380cc7 Compare July 22, 2025 21:30
/home/runner/work/_temp/52e2ec20-2d52-465b-804d-25ed3b1de4d9.sh: line 1: ./utils/configure-rabbitmq-develop.sh: No such file or directory
@OliFady OliFady mentioned this pull request Mar 16, 2026
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.

3 participants