pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/elixir



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Dec 31 21:47:17 UTC 2023

Modified Files:
        pkgsrc/lang/elixir: Makefile PLIST distinfo

Log Message:
elixir: update to 1.16.0.

(5 test failures)

# Changelog for Elixir v1.16

## Code snippets in diagnostics

Elixir v1.15 introduced a new compiler diagnostic format and the ability to print multiple error diagnostics per compilation (in addition to multiple warnings).

With Elixir v1.16, we also include code snippets in exceptions and diagnostics raised by the compiler. For example, a syntax error now includes a pointer to where the error happened:

```
** (SyntaxError) invalid syntax found on lib/my_app.ex:1:17:
    error: syntax error before: '*'
    │
  1 │ [1, 2, 3, 4, 5, *]
    │                 ^
    │
    └─ lib/my_app.ex:1:17
```

For mismatched delimiters, it now shows both delimiters:

```
** (MismatchedDelimiterError) mismatched delimiter found on lib/my_app.ex:1:18:
    error: unexpected token: )
    │
  1 │ [1, 2, 3, 4, 5, 6)
    │ │                └ mismatched closing delimiter (expected "]")
    │ └ unclosed delimiter
    │
    └─ lib/my_app.ex:1:18
```

For unclosed delimiters, it now shows where the unclosed delimiter starts:

```
** (TokenMissingError) token missing on lib/my_app:8:23:
    error: missing terminator: )
    │
  1 │ my_numbers = (1, 2, 3, 4, 5, 6
    │              └ unclosed delimiter
 ...
  8 │ IO.inspect(my_numbers)
    │                       └ missing closing delimiter (expected ")")
    │
    └─ lib/my_app:8:23
```

Errors and warnings diagnostics also include code snippets. When possible, we will show precise spans, such as on undefined variables:

```
  error: undefined variable "unknown_var"
  │
5 │     a - unknown_var
  │         ^^^^^^^^^^^
  │
  └─ lib/sample.ex:5:9: Sample.foo/1
```

Otherwise the whole line is underlined:

```
error: function names should start with lowercase characters or underscore, invalid name CamelCase
  │
3 │   def CamelCase do
  │   ^^^^^^^^^^^^^^^^
  │
  └─ lib/sample.ex:3
```

A huge thank you to Vinícius Müller for working on the new diagnostics.

## Revamped documentation

Elixir's Getting Started guides have been made part of the Elixir repository and incorporated into ExDoc. This was an opportunity to revisit and unify all official guides and references.

We have also incorporated and extended the work on [Understanding Code Smells in Elixir Functional 
Language](https://github.com/lucasvegi/Elixir-Code-Smells/blob/main/etc/2023-emse-code-smells-elixir.pdf), by Lucas Vegi and Marco Tulio Valente, from 
[ASERG/DCC/UFMG](http://aserg.labsoft.dcc.ufmg.br/), into the official document in the form of anti-patterns. The anti-patterns are divided into four categories: code-related, design-related, 
process-related, and meta-programming. Our goal is to give all developers examples of potential anti-patterns, with context and examples on how to improve their codebases.

Another [ExDoc](https://github.com/elixir-lang/ex_doc) feature we have incorporated in this release is the addition of cheatsheets, starting with [a cheatsheet for the Enum 
module](https://hexdocs.pm/elixir/main/enum-cheat.html). If you would like to contribute future cheatsheets to Elixir itself, feel free to start a discussion with an issue.

Finally, we have started enriching our documentation with [Mermaid.js](https://mermaid.js.org/) diagrams. You can find examples in the [GenServer](https://hexdocs.pm/elixir/main/GenServer.html) and 
[Supervisor](https://hexdocs.pm/elixir/main/Supervisor.html) docs.

## v1.16.0 (2023-12-22)

### 1. Enhancements

#### EEx

  * [EEx] Include relative file information in diagnostics

#### Elixir

  * [Code] Add `:emit_warnings` for `Code.string_to_quoted/2`
  * [Code] Automatically include columns in parsing options
  * [Code] Introduce `MismatchedDelimiterError` for handling mismatched delimiter exceptions
  * [Code.Fragment] Handle anonymous calls in fragments
  * [Code.Formatter] Trim trailing whitespace on heredocs with `\r\n`
  * [File] Add `:offset` option to `File.stream!/2`
  * [Kernel] Auto infer size of matched variable in bitstrings
  * [Kernel] Preserve column information when translating typespecs
  * [Kernel] Suggest module names based on suffix and casing errors when the module does not exist in `UndefinedFunctionError`
  * [Kernel.ParallelCompiler] Introduce `Kernel.ParallelCompiler.pmap/2` to compile multiple additional entries in parallel
  * [Kernel.SpecialForms] Warn if `True`/`False`/`Nil` are used as aliases and there is no such alias
  * [Macro] Add `Macro.compile_apply/4`
  * [Module] Add support for `@nifs` annotation from Erlang/OTP 25
  * [Module] Add support for missing `@dialyzer` configuration
  * [String] Update to Unicode 15.1.0
  * [String] Add `String.replace_invalid/2`
  * [Task] Add `:limit` option to `Task.yield_many/2`

#### Logger

  * [Logger] Add `Logger.levels/0`

#### Mix

  * [mix] Add `MIX_PROFILE` to profile a list of comma separated tasks
  * [mix archive.install] Support `--sparse` option
  * [mix compile.app] Warn if both `:applications` and `:extra_applications` are used
  * [mix compile.elixir] Pass original exception down to diagnostic `:details` when possible
  * [mix compile.elixir] Optimize scenario where there are thousands of files in `lib/` and one of them is changed
  * [mix deps.clean] Emit a warning instead of crashing when a dependency cannot be removed
  * [mix escript.install] Support `--sparse` option
  * [mix release] Include `include/` directory in releases
  * [mix test] Allow testing multiple file:line at once, such as `mix test test/foo_test.exs:13 test/bar_test.exs:27`

### 2. Bug fixes

#### Elixir

  * [Code] Keep quotes for atom keys in formatter
  * [Code.Fragment] Fix crash in `Code.Fragment.surround_context/2` when matching on `->`
  * [IO] Raise when using `IO.binwrite/2` on terminated device (mirroring `IO.write/2`)
  * [Kernel] Do not expand aliases recursively (the alias stored in Macro.Env is already expanded)
  * [Kernel] Ensure `dbg` module is a compile-time dependency
  * [Kernel] Warn when a private function or macro uses `unquote/1` and the function/macro itself is unused
  * [Kernel] Re-enabled compiler optimizations for top level functions in scripts (disabled in v1.14.0 but shouldn't impact most programs)
  * [Kernel] Do not define an alias for nested modules starting with `Elixir.` in their definition
  * [Kernel.ParallelCompiler] Consider a module has been defined in `@after_compile` callbacks to avoid deadlocks
  * [Macro] Address exception on `Macro.to_string/1` for certain ASTs
  * [Path] Lazily evaluate `File.cwd!/0` in `Path.expand/1` and `Path.absname/1`
  * [Path] Ensure `Path.relative_to/2` returns a relative path when the given argument does not share a common prefix with `cwd`

#### ExUnit

  * [ExUnit] Raise on incorrectly dedented doctests

#### IEx

  * [IEx.Pry] Fix prying functions with only literals in their body

#### Mix

  * [mix archive.install] Restore code paths after `mix archive.install`
  * [mix compile] Ensure files with duplicate modules are recompiled whenever any of the files change
  * [mix compile] Update Mix compiler diagnostics documentation and typespecs to match the Elixir compiler behaviour where both lines and columns start from one (before it inaccurately said that 
columns started from zero)
  * [mix escript.install] Restore code paths after `mix escript.install`

### 3. Soft deprecations (no warnings emitted)

#### Elixir

  * [File] Deprecate `File.stream!(file, options, line_or_bytes)` in favor of keeping the options as last argument, as in `File.stream!(file, line_or_bytes, options)`
  * [Kernel.ParallelCompiler] Deprecate `Kernel.ParallelCompiler.async/1` in favor of `Kernel.ParallelCompiler.pmap/2`
  * [Path] Deprecate `Path.safe_relative_to/2` in favor of `Path.safe_relative/2`

#### Mix

  * [mix compile] Returning a four-element tuple as a position in `Mix.Task.Compiler.Diagnostic`

### 4. Hard deprecations

#### Elixir

  * [Date] Deprecate inferring a range with negative step, call `Date.range/3` with a negative step instead
  * [Enum] Deprecate passing a range with negative step on `Enum.slice/2`, give `first..last//1` instead
  * [Kernel] `~R/.../` is deprecated in favor of `~r/.../`. This is because `~R/.../` still allowed escape codes, which did not fit the definition of uppercase sigils
  * [String] Deprecate passing a range with negative step on `String.slice/2`, give `first..last//1` instead

#### ExUnit

  * [ExUnit.Formatter] Deprecate `format_time/2`, use `format_times/1` instead

#### Mix

  * [mix compile.leex] Require `:leex` to be added as a compiler to run the `leex` compiler
  * [mix compile.yecc] Require `:yecc` to be added as a compiler to run the `yecc` compiler


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 pkgsrc/lang/elixir/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/lang/elixir/PLIST
cvs rdiff -u -r1.33 -r1.34 pkgsrc/lang/elixir/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/elixir/Makefile
diff -u pkgsrc/lang/elixir/Makefile:1.38 pkgsrc/lang/elixir/Makefile:1.39
--- pkgsrc/lang/elixir/Makefile:1.38    Mon Oct 23 14:42:23 2023
+++ pkgsrc/lang/elixir/Makefile Sun Dec 31 21:47:16 2023
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.38 2023/10/23 14:42:23 adam Exp $
+# $NetBSD: Makefile,v 1.39 2023/12/31 21:47:16 wiz Exp $
 
-DISTNAME=      elixir-1.15.7
+DISTNAME=      elixir-1.16.0
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=elixir-lang/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}

Index: pkgsrc/lang/elixir/PLIST
diff -u pkgsrc/lang/elixir/PLIST:1.9 pkgsrc/lang/elixir/PLIST:1.10
--- pkgsrc/lang/elixir/PLIST:1.9        Sun Jul  2 08:09:37 2023
+++ pkgsrc/lang/elixir/PLIST    Sun Dec 31 21:47:16 2023
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.9 2023/07/02 08:09:37 wiz Exp $
+@comment $NetBSD: PLIST,v 1.10 2023/12/31 21:47:16 wiz Exp $
 bin/elixir
 bin/elixirc
 bin/iex
@@ -155,6 +155,7 @@ lib/elixir/lib/elixir/ebin/Elixir.Macro.
 lib/elixir/lib/elixir/ebin/Elixir.Map.beam
 lib/elixir/lib/elixir/ebin/Elixir.MapSet.beam
 lib/elixir/lib/elixir/ebin/Elixir.MatchError.beam
+lib/elixir/lib/elixir/ebin/Elixir.MismatchedDelimiterError.beam
 lib/elixir/lib/elixir/ebin/Elixir.Module.LocalsTracker.beam
 lib/elixir/lib/elixir/ebin/Elixir.Module.ParallelChecker.beam
 lib/elixir/lib/elixir/ebin/Elixir.Module.Types.Behaviour.beam
@@ -269,6 +270,7 @@ lib/elixir/lib/elixir/ebin/elixir_rewrit
 lib/elixir/lib/elixir/ebin/elixir_sup.beam
 lib/elixir/lib/elixir/ebin/elixir_tokenizer.beam
 lib/elixir/lib/elixir/ebin/elixir_utils.beam
+lib/elixir/lib/elixir/ebin/iex.beam
 lib/elixir/lib/ex_unit/ebin/Elixir.ExUnit.AssertionError.beam
 lib/elixir/lib/ex_unit/ebin/Elixir.ExUnit.Assertions.beam
 lib/elixir/lib/ex_unit/ebin/Elixir.ExUnit.CLIFormatter.beam

Index: pkgsrc/lang/elixir/distinfo
diff -u pkgsrc/lang/elixir/distinfo:1.33 pkgsrc/lang/elixir/distinfo:1.34
--- pkgsrc/lang/elixir/distinfo:1.33    Mon Oct 23 14:42:23 2023
+++ pkgsrc/lang/elixir/distinfo Sun Dec 31 21:47:16 2023
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.33 2023/10/23 14:42:23 adam Exp $
+$NetBSD: distinfo,v 1.34 2023/12/31 21:47:16 wiz Exp $
 
-BLAKE2s (elixir-1.15.7.tar.gz) = 649cabd75a291c2964a922b66b9449e5d76b78b559b2aff71d326efa293d0896
-SHA512 (elixir-1.15.7.tar.gz) = a46f0569cbff342f15a04776f8d57cf2554867546004adabd9b9dff36c184ec56a78f2df2fc6c0855e65c11277662f694f5e6a8c6e1716cf4e22d8fdd5e1d4ae
-Size (elixir-1.15.7.tar.gz) = 3151775 bytes
+BLAKE2s (elixir-1.16.0.tar.gz) = 436ddcf98cba87b20ccf0cbf11284126a8321c470f5be95b6ed2a1e1ef408d60
+SHA512 (elixir-1.16.0.tar.gz) = b1685d4a6745c08becab02f46a4767189781fd95f0eaa16d78a93e83a1750c5832c509e536c30e635ab62840aae5498052d7ab10a51242161f632405ca99f9cf
+Size (elixir-1.16.0.tar.gz) = 3351329 bytes
 SHA1 (patch-Makefile) = 9b7a1aeef4367b7315fd7a91c53ff533aeaa0aff



Home | Main Index | Thread Index | Old Index