Elixir v1.19.0-rc.1 released

1. Enhancements

Elixir

  • [Kernel] Raise when U+2028 and U+2029 characters are present in comments and strings to avoid line spoofing attacks
  • [Kernel] Include the line for the previous clause in errors/warnings related to conflicts between defaults on function definitions
  • [Macro] Add __escape__/1 callback so structs can escape references and other runtime data types in Macro.escape/1
  • [OptionParser] Support the :regex type
  • [OptionParser] Enhance parsing error to display available options
  • [String] Update to Unicode 17.0.0

ExUnit

  • [ExUnit] Set a process label for each test

Logger

  • [Logger] Accept any enumerable in Logger.metadata/1

Mix

  • [mix format] Add options to mix format to allow excluding of files
  • [mix test] Add --name-pattern option to mix test
  • [Mix.install/2] Support the :compilers option

2. Bug fixes

Elixir

  • [Code] Return error on invalid unicode sequences in Code.string_to_quoted/2 instead of raising
  • [Code] Properly handle column annotation for in in not in expressions
  • [Enum] Fix infinite loop on Enum.take/2 with negative index on empty enumerable
  • [Inspect] Inspect ill-formed structs as maps
  • [Kernel] Properly increment metadata newline when ? is followed by a literal newline character

ExUnit

  • [ExUnit.Assertions] Fix order in ExUnit results when listing pinned variables
  • [ExUnit.Assertions] Raise if attempting to raise an assertion error with invalid message (not a binary)

IEx

  • [IEx] Abort pipelines when there is an error in any step along the way

Mix

  • [mix compile] Fix bug where reverting changes to an external resource (such as HEEx template) after a compilation error would make it so the source module would not be compiled
  • [mix compile] Avoid failures when locking compilation across different users
  • [mix compile] Fix race condition when renaming files used by the compilation lock
  • [mix test] Prevent mix test from overriding :failures_manifest_path option

3. Hard deprecations

Elixir

  • [Code] Warn if line-break characters outside of \r and \r\n are found in strings according to UX#55. This warning will be fast-tracked into an error for security reasons in Elixir v1.20, following a similar rule to bidirectional control characters. They will already raise if found in comments
24 Likes

Alright folks, in a nutshell, this release addresses all feedback from the previous RC:

  1. Fully compatible with Erlang/OTP 28.1+
  2. Struct update syntax has been adapted into a type assertion operator
  3. Addresses issues with certain dependencies taking too long to compile

Please give it a try, so we can finally ship v1.19!

38 Likes

Just want to share the performance gains on deps compilations for my large day-job project on an AMD Ryzen 9 5900X 12-Core Processor:

mix deps.compile --force
frank@…git/hsm/main on ī‚  main [✘!?⇔] via šŸ’§ v1.18.4 (OTP 27) took 2m20s
mix compile --force
Compiling 569 files (.ex)
frank@…git/hsm/main on ī‚  main [✘!?⇔] via šŸ’§ v1.18.4 (OTP 27) took 18s
mix deps.compile --force
mix deps.compile running across 24 OS processes
frank@…git/hsm/main on ī‚  main [✘!?⇔] via šŸ’§ v1.19.0-rc.1 (OTP 28) took 55s
mix compile --force
Compiling 569 files (.ex)
frank@…git/hsm/main on ī‚  main [✘!?⇔] via šŸ’§ v1.19.0-rc.1 (OTP 28) took 19s

Great work, team! :rocket:

20 Likes

Compilation from the source (using asdf install elixir ref:1.19.0-rc.1) was completed, but a new warning has appeared during tests, see:

There are 3 things that look bad and 2 of them may be important if they appear in other use cases:

  1. none as a line in src/conflict.yrl - I guess it’s a bug? Or maybe it’s something like meta[:line] || "none"?

  2. conflict naming is rather alarming and I’m not sure if it should be ignored like a typical warning

  3. The warning message is not clear. I only know that there is some ā€œconflictā€, but I have no idea what’s conflicting and where I can find it (none as a line number also does not helps here). 1 shift/reduce, 0 reduce/reduce is some short that is rather not commonly known or I have forget about or missed something as I don’t remember similar warning or error message like that.

The application exited for parsetools is not a new thing so I know it’s not a problem especially that it’s labelled as notice. What’s I just realised is why we have notice level in this case … I guess it’s usually warn/warning or sometimes error. :light_bulb:

If all of those messages are expected then silencing only those 2 things would make the installation logs clear. Is there a way to instruct asdf and other tools to configure this process, so those messages would not show up? In a manual compilation for development purposes of course those messages are fine. However it’s not the same if we talk about installation from source. :thinking:

I was testing v1.19 before many times especially for parallel dependency compilation and I also see a huge improvement. It’s worth to mention that such improvements or even better applies to every phoenix application, so this is not the type of speedup most developers could just not notice. :heart:

Also there is at least one bug fix not mentioned. In short @compile debug_info: true does not worked while @compile {:debug_info, true} and @compile :debug_info did. For more information see:

Moving from 1.19-rc.0 to 1.19-rc.1, I am now seeing some mysterious compiler output. It appears to be stuck.

(It has now taken much longer than 10s, and I’m still waiting as I type out this message)

I think it might be the same issue as v1.19.0-rc.1 - compilation does not finish with for comprehension in Ecto.Migrator anomymous function Ā· Issue #14810 Ā· elixir-lang/elixir Ā· GitHub.

1 Like

Ah yes, apologies for the noise! I see even that a colleague of mine already posted in that issue.

I am getting:

== Compilation error in file lib/myfile.ex ==
** (CompileError) elixir_compiler_304: undefined function '__aliases__'/1 in '__MODULE__'/1
    (stdlib 7.1) lists.erl:2641: :lists.foreach_1/2

I haven’t been able to reduce this to a test case yet, curious if anyone else is seeing something like this.

You need to show us the related code from myfile.ex. We can’t just guess what you have there.

I don’t think you understood what I meant with ā€œI haven’t been able to reduce this to a test case yet,ā€, it means I can’t share just this file, I would need to share the entire codebase.

I understand, but it does not help us help you. If you want you can invite just me to your repo, so I can investigate the problem for you. I guess you should have no problem with inviting someone with read-only rule. Of course you may say you can’t just trust people, but such a stacktrace is not enough.

For example due to pattern-matching functions are expected to simply fail on non-matching data and that’s fine, because in a ā€œprivateā€ part of core it should never happen. The maintainers usually needs a use case, so they can investigate what caused such an edge case.

Look that if wrong data would come to example function below we have no idea what kind of data it is as well as which code in core caused the issue, because there is not enough information in the stacktrace:

defp my_core_function(integer) do
  Integer.to_string(integer)
end

Adding an is_integer/1 check and clause for other data is not a solution here, but a workaround for the problem.

@Eiji it is fine to put just a snippet asking if someone else ran into the same issue. It helps in case the issue is known so they don’t have to dig deeper.

In this case, however, this issue is not known, so we would indeed need a reproduction.

Thank you @hkrutzer, @Eiji and everythone else helping us catch the remaining bugs.

5 Likes

Oh, looks like you get it wrong. Of course, it’s fine to ask a simplest question, so we can ask about details later (unless mods would give us more strict rules). Maybe it was just my intuition, but it did not look like something that’s so ā€œeasy to solveā€ (as explained above).

I was online, so I could spend let’s say 5 min on accepting invite and investigate problem. I did things like that before mostly for Elixir core and credo. I’m more than fine doing such a small things even for free as I like testing new changes in Elixir and if someone would find me helpful and offer me a contract it would be a nice bonus.

2 Likes

I’m pleasantly surprised by how much faster the test execution and compilation are now. It’s going to make me way more productive at work! Huge thanks to everyone who contributed to this awesome performance upgrade.

2 Likes

Linking your issue here for the record since you did manage to reproduce it (thank you!)

5 Likes