Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.17.3
->1.18.1
1.17.3
->1.18.0
27.1.2
->27.2
Release Notes
elixir-lang/elixir (elixir)
v1.18.1
Compare Source
1. Enhancements
2. Bug fixes
Elixir
Code.Fragment.container_cursor_to_quoted/2
with:trailing_fragment
parses expressions that were supported in previous versions@file
annotation@file
annotation:no_parens
metadata when using capture with arity on all casesExUnit
--repeat-until-failure
can be combined with groupsMix
--warnings-as-errors
v1.18.0
Compare Source
https://elixir-lang.org/blog/2024/12/19/elixir-v1-18-0-released/
Elixir v1.18 is an impressive release with improvements across the two main efforts happening within the Elixir ecosystem right now: set-theoretic types and language servers. It also comes with built-in JSON support and adds new capabilities to its unit testing library. Here is a quick break down.
Type system improvements
The most exciting change in Elixir v1.18 is type checking of function calls, alongside gradual inference of patterns and return types. To understand how this will impact your programs, consider the following code in "lib/user.ex":
Elixir's type system will infer that the
drive/2
function expects a%User{}
struct and returns either{:ok, dynamic()}
,{:error, :no_choice}
, or{:error, :not_allowed}
.Therefore, the following code in a separate module (either in a separate or the same file), should emit a violation, due to an invalid argument:
Here is the warning:
And the next snippet will warn because the
:error
clause will never match, as that's not a valid return type of theUser.drive/2
call:And here is the warning:
For more details on typing inference and the trade-offs made by the Elixir team, see our official documentation.
There are many other improvements to the type system, which we will go in detail within the official release. Meanwhile, here is a list summary of the overall improvements done to the type system:
Type inference of patterns (typing inference of guards will be part of an upcoming release)
Type checking of all language constructs, including local and remote calls, except
for
,with
, and closuresType checking of all functions inlined by the compiler found in
Kernel
Type checking of all conversion functions inlined by the compiler
Support for tuples and lists as composite types as well as type checking of their basic operations
Detection of clauses and patterns that will never match from
case
,cond
, and=
Detection of unused clauses in private functions
ExUnit improvements
ExUnit now supports parameterized tests to run the same test module multiple times under different parameters.
For example, Elixir ships a local, decentralized and scalable key-value process storage called
Registry
. The registry can be partitioned and its implementation differs depending if partitioning is enabled or not. Therefore, during tests, we want to ensure both modes are exercised. With Elixir v1.18, we can achieve this by writing:ExUnit parameterizes whole test modules. If your modules are configured to run concurrently, as above, so will the parameterized ones.
ExUnit also comes with the ability of specifying test groups. While ExUnit supports running tests concurrently, those tests must not have shared state between them. However, in large applications, it may be common for some tests to depend on some shared state, and other tests to depend on a completely separate state. For example, part of your tests may depend on Cassandra, while others depend on Redis. Prior to Elixir v1.18, these tests could not run concurrently, but in v1.18 they might as long as they are assigned to different groups. Tests modules within the same group do not run concurrently, but across groups, they might.
With features like async tests, suite partitioning, and now grouping, Elixir developers have plenty of flexibility to make the most use of their machine resources, both in development and in CI.
mix format --migrate
The
mix format
command now supports an explicit--migrate
flag, which will convert constructs that have been deprecated in Elixir to their latest version. Because this flag rewrites the AST, it is not guaranteed the migrated format will always be valid when used in combination with macros that also perform AST rewriting.As of this release, the following migrations are executed:
Normalize parens in bitstring modifiers - it removes unnecessary parentheses in known bitstring modifiers, for example
<<foo::binary()>>
becomes<<foo::binary>>
, or adds parentheses for custom modifiers, where<<foo::custom_type>>
becomes<<foo::custom_type()>>
.Charlists as sigils - formats charlists as
~c
sigils, for example'foo'
becomes~c"foo"
.unless
as negatedif
s - rewritesunless
expressions usingif
with a negated condition, for exampleunless foo do
becomesif !foo do
.More migrations may be added in future releases.
JSON support
This release includes official support for JSON encoding and decoding.
Both encoder and decoder fully conform to RFC 8259 and ECMA 404 standards.
Encoding
Encoding can be done via
JSON.encode!/1
andJSON.encode_to_iodata!/1
functions. The default encoding rules are applied as follows:integer() | float()
true | false
nil
binary()
atom()
list()
%{binary() => _}
%{atom() => _}
%{integer() => _}
You may also implement the
JSON.Encoder
protocol for custom data structures. Elixir already implements the protocol for all Calendar types.If you have a struct, you can derive the implementation of the
JSON.Encoder
by specifying which fields should be encoded to JSON:Decoding
Decoding can be done via
JSON.decode/2
andJSON.decode!/2
functions. The default decoding rules are applied as follows:integer() | float()
true | false
nil
binary()
%{binary() => _}
Language server listeners
4 months ago, we welcomed the Official Language Server team, with the goal of unifying the efforts behind code intelligence, tools, and editors in Elixir. Elixir v1.18 brings new features on this front by introducing locks and listeners to its compilation. Let's understand what it means.
At the moment, all language server implementations have their own compilation environment. This means that your project and dependencies during development are compiled once, for your own use, and then again for the language server. This duplicate effort could cause the language server experience to lag, when it could be relying on the already compiled artifacts of your project.
This release address by introducing a compiler lock, ensuring that only a single operating system process running Elixir compiles your project at a given moment, and by providing the ability for one operating system process to listen to the compilation results of others. In other words, different Elixir instances can now communicate over the same compilation build, instead of racing each other.
These enhancements do not only improve editor tooling, but they also directly benefit projects like IEx and Phoenix. For example, you can invoke
IEx.configure(auto_reload: true)
and IEx will automatically reload modules changed elsewhere, either by a separate terminal or your IDE.Potential incompatibilities
This release no longer supports WERL (a graphical user interface on Windows used by Erlang 25 and earlier). For a better user experience on Windows terminals, use Erlang/OTP 26+ (this is also the last Elixir release to support Erlang/OTP 25).
Furthermore, in order to support inference of patterns, Elixir will raise if it finds recursive variable definitions. This means patterns that never match, such as this one, will no longer compile:
However, recursion of root variables (where variables directly point to each other), will also fail to compile:
While the definition above could succeed (as long as all three arguments are equal), the cycle is not necessary and could be removed, as below:
You may also prefer to write using guards:
1. Enhancements
Elixir
elixir
,elixirc
, andmix
on Windows. Those provide a safer entry point for running Elixir from other platformsDuration.to_string/1
Code.format_string!/2
--
and---
inCode.format_string!/2
to make precedence clearerCode.string_to_quoted/2
whentoken_metadata: true
to help compute ranges from the AST:capture_arg
as its own entry inCode.Fragment.surround_context/2
Config.read_config/1
Enum.product_by/2
andEnum.sum_by/2
MissingApplicationsError
exception to denote missing applicationsJSON
module with encoding and decoding functionalityJSON.Encoder
for all Calendar types_
), such ashttp_сервер
. Previously allowed highly restrictive identifiers, which mixed Latin and other scripts, such as the japanese word for t-shirt,Tシャツ
, now require the underscore as wellelem/2
unquote
andunquote_splicing
to catch bugs earlierERL_COMPILER_OPTIONS=deterministic
. Keep in mind deterministic builds strip source and other compile time information, which may be relevant for programsList.ends_with?/2
dbg
handling ofif/2
,with/1
and of code blocksMacro.struct_info!/2
to return struct information mirroringmod.__info__(:struct)
Registry.lock/3
for local lockingPartitionSupervisor.resize!/2
to resize the number of partitions in a supervisor (up to the limit it was started with)Process.sleep/1
@undefined_impl_description
to customize error message when an implementation is undefined__deriving__/1
as optional macro callback toProtocol
, no longer requiring empty implementationsExUnit
ExUnit.Case
test_pid
as a tagIEx
IEx.configure(auto_reload: true)
to automatically pick up modules recompiled from other operating system processes:dot_iex
support toIEx.configure/1
Mix
mix format --migrate
to migrate from deprecated functionality:listeners
configuration to listen to compilation events from the current and other operating system processes2. Bug fixes
Elixir
Code.string_to_quoted/2
next_break_fits
respectsline_length
unquote
andunquote_splicing
to provide better error reports instead of failing too late inside the compilerStream.transform/5
URI.merge/2
ExUnit
assert/1
with=
IEx
IEx.Helpers.recompile/0
will reload modules changed by other operating system processesMix
--all-warnings
when files do not changerebar3
in some casespriv
directories.app
files deterministic in releasesMix.Shell
on Windows when outputting non UTF-8 characters3. Soft deprecations (no warnings emitted)
Elixir
color/3
is deprecated in favor ofcolor_doc/3
fold_doc/2
is deprecated in favor offold/2
unless
in favor ofif
. Usemix format --migrate
to automate the migrationMacro.struct!/2
is deprecated in favor ofMacro.struct_info!/2
__deriving__/3
inside theAny
implementation is deprecated, derive it inside the protocol definition itself4. Hard deprecations
EEx
<%#
is deprecated in favor of<%!--
or<% #
c:EEx.handle_text/2
is deprecated in favor ofc:EEx.handle_text/3
Elixir
:warnings_as_errors
is deprecated viaCode.put_compiler_option/2
. This must not affect developers, as the:warnings_as_errors
option is managed by Mix tasks, and not directly used via theCode
moduleEnumerable.slice/1
List.zip/1
is deprecated in favor ofEnum.zip/1
Module.eval_quoted/3
in favor ofCode.eval_quoted/3
Range.new/2
Tuple.append/2
is deprecated, useTuple.insert_at/3
insteadMix
mix cmd --app APP
in favor ofmix do --app APP
:warnings_as_errors
configuration in:elixirc_options
is deprecated. Instead pass the--warnings-as-errors
flag tomix compile
. Alternatively, you might alias the task:aliases: [compile: "compile --warnings-as-errors"]
:warnings_as_errors
configuration in:test_elixirc_options
is deprecated. Instead pass the--warnings-as-errors
flag tomix test
. Alternatively, you might alias the task:aliases: [test: "test --warnings-as-errors"]
compilers/0
in favor ofMix.Task.Compiler.compilers/0
v1.17
The CHANGELOG for v1.17 releases can be found in the v1.17 branch.
erlang/otp (erlang)
v27.2
: OTP 27.2Compare Source
OTP 27.2
Erlang/OTP 27.2 is the second maintenance patch package for OTP 27, with mostly bug fixes as well as improvements.
Potential incompatibilities:
full_result
request optionwhen returning an asynchronous request.
For details about bugfixes and potential incompatibilities see the Erlang 27.2 README
The Erlang/OTP source can also be found at GitHub on the official Erlang repository, https://github.com/erlang/otp
Download links for this and previous versions are found here
v27.1.3
: OTP 27.1.3Compare Source
Check out the git tag OTP-27.1.3, and build a full OTP system including
documentation. Apply one or more applications from this build as patches to your
installation using the 'otp_patch_apply' tool. For information on install
requirements, see descriptions for each application version below.
common_test-1.27.4
The common_test-1.27.4 application can be applied independently of other
applications on a full OTP 27 installation.
Fixed Bugs and Malfunctions
With this change, cth_surefire hook module handles group path reduction for a
skipped group. This fixes a bug manifesting with improper group path for a
group executed after a group which was skipped.
Own Id: OTP-19365
Related Id(s): ERIERL-1157, PR-9080
Improvements and New Features
With this change, prefix option can be specified in cth_conn_log option list.
Option allows to specify how much of additional information is added in raw
log output.
Own Id: OTP-19293
Related Id(s): ERIERL-1139, PR-8924, PR-8931
compiler-8.5.3
The compiler-8.5.3 application can be applied independently of other
applications on a full OTP 27 installation.
Fixed Bugs and Malfunctions
In rare circumstances, the destructive tuple update optimization could be
applied when it was unsafe.
Own Id: OTP-19340
Related Id(s): GH-9014, PR-9024
In rare circumstances involving appending to multiple binaries, the compile
could emit unsafe code that would crash the runtime system.
Own Id: OTP-19374
Related Id(s): GH-9100, PR-9111
erts-15.1.3
The erts-15.1.3 application can be applied independently of other applications
on a full OTP 27 installation.
Fixed Bugs and Malfunctions
gen_udp:send on domain local can leak inet_reply messages.
Own Id: OTP-19332
Related Id(s): #8989
net:getifaddrs does not properly report the running flag on windows.
Own Id: OTP-19366
Related Id(s): ERIERL-1134, OTP-19061
kernel-10.1.2
Note! The kernel-10.1.2 application cannot be applied independently of other
applications on an arbitrary OTP 27 installation.
Fixed Bugs and Malfunctions
On windows the socket:recv could return with success ({ok, Data}) even though
not all data had been read.
Own Id: OTP-19328
gen_udp:send on domain local can leak inet_reply messages.
Own Id: OTP-19332
Related Id(s): #8989
Failure to create an UDP IPv6 socket when inet_backend = socket with certain
IPv6 socket options.
Own Id: OTP-19357
net:getifaddrs does not properly report the running flag on windows.
Own Id: OTP-19366
Related Id(s): ERIERL-1134, OTP-19061
public_key-1.16.4
The public_key-1.16.4 application can be applied independently of other
applications on a full OTP 27 installation.
Fixed Bugs and Malfunctions
If both
ext-key-usage
andkey-usage
are defined for a certificate itshould be checked that these usages are consistent with each other. This will
have the affect that such certificates where the
ext-key-usages
is marked ascritical and the usages is consistent with the
key-use
it can be consideredvalid without mandatory application specific checks for the
ext-key-useage
extension.
Own Id: OTP-19240
Related Id(s): PR-8840, OTP-19532
Handle decoding of EDDSA key properly, when decoding a PEM file that contains
only the public EDDSA key.
Own Id: OTP-19350
Related Id(s): GH-9009, PR-9053
ssh-5.2.4
The ssh-5.2.4 application can be applied independently of other applications on
a full OTP 27 installation.
Fixed Bugs and Malfunctions
With this change, ssh connection does not crash upon receiving exit-signal
message for an already terminated channel.
Own Id: OTP-19326
Related Id(s): GH-8929, PR-8995
ssl-11.2.5
Note! The ssl-11.2.5 application cannot be applied independently of other
applications on an arbitrary OTP 27 installation.
Fixed Bugs and Malfunctions
Avoid generating an internal alert for case that should have been an orderly
shutdown by the supervisor.
Own Id: OTP-19311
Related Id(s): PR-8980
If present, extended key-usage TLS (SSL) role check (
pk-clientAuth
,pk-serverAuth
) should always be performed for peer-cert. An intermediate CAcert may relax the requirement if
AnyExtendedKeyUsage
purpose is present.In OTP-25.3.2.8, OTP-26.2 and OTP-27.0 these requirements became too relaxed.
There where two problems, firstly the peer cert extension was only checked if
it was marked critical, and secondly the CA cert check did not assert the
relaxed
AnyExtendedKeyUsage
purpose.This could result in that certificates might be misused for purposes not
intended by the certificate authority.
Thanks to Bryan Paxton for reporting the issue.
Own Id: OTP-19352
Related Id(s): PR-9130, CVE-2024-53846, OTP-19240
Improvements and New Features
Back port certificate_authorities option for TLS-1.3 servers to pre TLS-1.3
servers to enable them to disable the sending of certificate authorities in
their certificate request. This will have same affect as the the TLS-1.3
server option although it is handled by a different mechanism in these
versions, where the functionality is described to be more of a guidance,
although some pre TLS clients have proven to make it mandatory as in TLS-1.3
extension handling.
Own Id: OTP-19325
Related Id(s): ERIERL-1147, PR-9001
Thanks to
Frej Drejhammar, zmstone
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.