Skip to content

Prepare for Elixir 1.19#137

Merged
randycoulman merged 10 commits into
mainfrom
prepare-for-elixir-1.19
Jun 10, 2025
Merged

Prepare for Elixir 1.19#137
randycoulman merged 10 commits into
mainfrom
prepare-for-elixir-1.19

Conversation

@randycoulman

@randycoulman randycoulman commented Mar 22, 2025

Copy link
Copy Markdown
Owner

There are a number of deprecations in 1.19 that we need to handle:

  • the separator character for mix do changes from , to +
  • regexes can no longer be used in compile-time contexts (module attributes and struct defaults)
  • regexes can no longer be compared directly with each other; they need to be compared on their Regex.source instead

There's also a forthcoming deprecation in 1.20 that we need to work around:

  • ExUnit.Filters.parse_path/1 is being deprecated in favor of ExUnit.Filters.parse_paths/1. The newer function is only available in Elixir 1.16 and newer and we (and Elixir) still support 1.14 and 1.15, so we conditionally use the new function in Elixir 1.20 and above.

@randycoulman randycoulman marked this pull request as draft March 22, 2025 05:16
`+` is now [the preferred separator](https://hexdocs.pm/mix/1.18.3/Mix.Tasks.Do.html) for `mix do` and has been supported since Elixir 1.14.

Given that it has better support on Windows than the older `,`, we'll officially drop support for Elixir 1.13 and earlier and use the `+` separator.
@randycoulman randycoulman force-pushed the prepare-for-elixir-1.19 branch from 39758f0 to bb36f9f Compare March 23, 2025 02:09
randycoulman and others added 6 commits June 7, 2025 22:18
Allow passing in overrides to `Config.new` and merge them into the default `ansi_enabled?` flag.

We now no longer rely on manually creating Config structs in the tests.
This prepares for Elixir 1.19/OTP 28 dropping support for compile-time regexes.

Co-authored-by: Frank Dugan III <frank3@duganator.com>
OTP 28 changes the internal structure of regexes so that they are no longer directly comparable.

We add some undocumented helper functions to `Config` for doing the necessary comparisons and then use them.
Includes OTP 28 compatibility.
Runs v1.19/OTP 28 locally and in CI. Also updates the `main` build to use OTP 28.
It includes some new rules to automatically fix some Elixir 1.19 deprecations.
@randycoulman randycoulman force-pushed the prepare-for-elixir-1.19 branch from 7134f6c to 9db3ad2 Compare June 8, 2025 06:17
Set fail-fast to false to allow all versions to run to completion in order to get full feedback on a change.

Also, mark the `main` build as `experimental` because it may fail from time to time.
ExUnit in Elixir 1.20 deprecates `ExUnit.Filters.parse_path/1` in favor of `ExUnit.Filters.parse_paths/1`. However, the newer function is only available in Elixir 1.16 and newer and we (and Elixir) still support 1.14 and 1.15.

To address this, we conditionally use the newer function in 1.20 and above (including pre-releases) and the older function otherwise.
@randycoulman randycoulman marked this pull request as ready for review June 10, 2025 02:26
@randycoulman randycoulman merged commit f744a98 into main Jun 10, 2025
13 of 14 checks passed
@randycoulman randycoulman deleted the prepare-for-elixir-1.19 branch June 10, 2025 02:28
randycoulman added a commit that referenced this pull request Jun 10, 2025
There are a number of deprecations in 1.19 that we need to handle:
- the separator character for `mix do` changes from `,` to `+`
- regexes can no longer be used in compile-time contexts (module attributes and struct defaults)
- regexes can no longer be compared directly with each other; they need to be compared on their `Regex.source` instead

There's also a forthcoming deprecation in 1.20 that we need to work around:
- `ExUnit.Filters.parse_path/1` is being deprecated in favor of `ExUnit.Filters.parse_paths/1`. The newer function is only available in Elixir 1.16 and newer and we (and Elixir) still support 1.14 and 1.15, so we conditionally use the new function in Elixir 1.20 and above.

Closes #138

Co-authored-by: Frank Dugan III <frank3@duganator.com>
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