Commit Graph
1777 Commits
Author SHA1 Message Date
José Valim 1d661fb91d Do not skip optional dependencies which are required downstream 2026-08-28 10:05:48 +02:00
José Valim 37c7da4fbf Fix constant retrigger of protocol consolidations in umbrellas
Closes #15727.
2026-08-11 22:09:55 +02:00
Rodolfo Carvalho 44405c300b Ensure no double newlines in files generated by "mix new" (#15711) 2026-08-03 08:59:29 +02:00
Rodolfo Carvalho a9021b1c8d Fix trailing whitespace in files generated by "mix new" (#15710) 2026-08-02 11:22:48 +02:00
Aaron Tinio 44ea7a621e Pass :sigils to mix format plugins invoked for a sigil (#15672)
mix format passes the :sigils option to a plugin invoked for a file
extension, but not to a plugin invoked for a sigil, because the sigil
formatter closure captures the options before :sigils is put into them.
A plugin that formats embedded Elixir code therefore cannot dispatch a
sigil nested inside the sigil it is formatting by passing on the options
it received, so the same snippet formats differently in a .heex file and
in an ~H sigil.

The sigil formatters are part of the options they receive, so a private
function rebuilds the list whenever a sigil is formatted.
2026-07-25 10:52:31 +02:00
Jean Klingler bec8d39796 Add :migrate_atom_interpolations option to formatter (#15531) 2026-07-02 08:04:25 +09:00
José Valim 9cb8bb63ce Check for missing requirement in the loader 2026-06-26 18:43:53 +02:00
José Valim eecafef2c0 Track dependency removal for local dependencies, closes #15445 2026-06-24 17:55:33 +02:00
José Valim 1ad6e735cb Track dependency removal for fetchable dependencies 2026-06-24 17:55:33 +02:00
José Valim 264200a4a6 Avoid unecessary umbrella recompilation when a path dependency's manifest is newer but unchanged, closes #15454 2026-06-17 15:54:55 +02:00
Jean Klingler 83e9b66e65 Add to_unsafe_atom/1 and soft-deprecate to_atom/1 (#15494) 2026-06-16 20:50:11 +09:00
José Valim 502421c94e Fix env outdated deps compilation
We should only avoid cleaning for path dependencies.
Fetch dependencies should go through the previous process.

Closes #15467.
2026-06-13 12:08:52 +02:00
José Valim 6f18bf70c0 Persist code paths and Code.compiler_options across partitions
Closes #15457
2026-06-12 21:00:46 +02:00
José Valim f594d98a15 Raise if a Git refspec starts with - as it is parsed as a CLI flag 2026-06-10 09:27:32 +02:00
José Valim 0cdfc80737 Validate paths and files when extracting archives 2026-06-09 14:15:27 +02:00
Aaron Tinio d714fb203b Honor --no-compile in mix format (#15443) 2026-06-07 21:34:23 +02:00
José Valim 5337ab8716 Revert expansion of or/and in guards
This partially reverts aad63173 as it caused
massive AST to generate when expanding guards
with `expr in [...]` checks in them, as each
`or` became a full-blown case expression.

Alternative approaches will be explored in
future releases.
2026-05-22 09:51:09 +02:00
José Valim af6d6b2cbe Mark stale fetchable deps for compile before convergence
A fetched git dependency could report {:ok, vsn} from its
stale .app before Mix checked the stored SCM manifest lock.
If the same dependency then appeared again through a stricter
transitive requirement, the converger would mark it as
:divergedreq instead of :compile.

Validate the SCM manifest while loading the dependency so
fetchable deps with a stale stored lock are marked for
compilation before convergence reuses their status.
Add regression tests for the transitive git case and for
the direct converger case.

Closes #15406.
2026-05-21 12:54:55 +02:00
José Valim 4dd6c3cf6a Revert "Allow overriding specific dependencies in override (#15193)"
Hex uses the flag in a way that's not visibile to Mix,
so we have false positives. Closes #15407.

This reverts commit bc7af21c02.
2026-05-21 10:17:05 +02:00
José Valim 6962dc2d91 Deprecate xref: [exclude: ...] 2026-05-16 13:24:12 +02:00
José Valim c3e1aa706d Infer signatures across application boundaries, closes #15360 2026-05-16 13:14:06 +02:00
Jonatan Kłosko 536e53b173 Respect --raise when mix test --warnings-as-errors passes with warnings (#15390) 2026-05-15 10:30:28 +02:00
José Valim 64d381bd05 Avoid warnings when editor is not set 2026-05-14 21:55:35 +02:00
José Valim 35497755b5 Use non_executable_binary_to_term on loopback pubsub 2026-05-06 23:42:55 +02:00
José Valim 68aae43703 Revert "Add each_directory to File.rm_rf, closes #15308 (#15311)"
This reverts commit d02e61d75e.

It did not address the original root problem.
2026-04-26 18:02:46 +02:00
José Valim d02e61d75e Add each_directory to File.rm_rf, closes #15308 (#15311) 2026-04-26 10:39:46 +02:00
José Valim a5e19ad385 Support --output in mix deps.tree and mix app.tree, closes #15288 2026-04-20 08:17:12 +02:00
Emiliano Mancuso 92221937d3 Return {0, -1} for missing files in last_modified_and_size/1, closes #15258 (#15259) 2026-04-13 08:25:49 +02:00
José Valim 139da8fa5f Only check for lock files in non-path dependencies (see #15158) 2026-04-11 16:55:54 +02:00
José Valim 8f40bf117a Add "mix source MODULE" to print or open a given module/function location (#15234) 2026-04-04 21:11:25 +02:00
José Valim 8d691697ff Support types and callbacks in mix help 2026-04-04 20:01:18 +02:00
José Valim a9ce579829 Revert structs into export time dependencies 2026-03-23 12:52:50 +01:00
João Duarte a7b2d6c679 Fix --warnings-as-errors not catching misnamed test file warnings (#15194) 2026-03-16 18:30:08 +01:00
José Valim bc7af21c02 Allow overriding specific dependencies in override (#15193)
Closes #14082. Closes #14156.
2026-03-14 09:48:39 +01:00
Jonatan Kłosko fb2657aa55 Fix compile env change triggering full recompilation of path dependencies (#15188) 2026-03-13 08:11:01 +01:00
José Valim f9310524b1 Revert "Fix unnecessary recompilation when dbg_callback is modified at runtime (#15007)" (#15185)
This reverts commit c80a3b1a0e.
2026-03-12 12:50:48 +01:00
José Valim b18637fb97 Treat modules with --no-debug-info as uncached, closes #15159
Additionally make sure --debug-info is part of the cache key.
2026-03-12 11:12:26 +01:00
José Valim 3452e6ab2f Ensure compilation of sibling deps do not mark path deps as changed, closes #15158 2026-03-11 17:02:00 +01:00
José Valim a064a00601 Fix CI and improve ExUnit results 2026-03-11 11:19:51 +01:00
Jean Klingler 2c54f9a64a More cleanup: remove compatibility code for OTP26- (#15166)
* Remove compatibility code for OTP26-

* Remove support for application/erlang+html docs v1

* Remove workaround for bug in older OTP versions

* Update OTP version checks

* Remove OTP25- skipping in tests

* More test cleanup
2026-03-10 16:12:36 +09:00
Jean Klingler 2817a70680 Remove mentions to OTP27+ versions from docs, comments and tests (#15165)
* Remove mentions of "since OTP27+"

* Remove test code for OTP26-
2026-03-10 15:39:03 +09:00
George Guimarães 8cda8e1bae Print formatted file names in mix format --verbose (#15119) 2026-02-28 12:25:38 +01:00
Michał Łępicki 6d5f43318c Allow specifying SEED when running tests (#15111)
this is helpful when reproducing flaky test failures
2026-02-25 09:12:15 +01:00
José Valim a0ef7f0c3e Move struct validation in patterns and updates to type checker
This means changing a struct definition only cases
recompilation when structs are created, no longer on
matches and updates.

Closes #15098.
2026-02-23 14:24:29 +01:00
José Valim 9ba89f4da6 Properly handle compile attributes in Erlang sources 2026-02-18 13:53:24 +01:00
José Valim ab7c019d24 Topsort Erlang modules before compilation, closes #15100 2026-02-18 10:59:32 +01:00
José Valim a5361436c4 Do not propagate parent config when building archives/escripts (#15097)
Closes #15094.
2026-02-07 18:47:13 +01:00
José Valim f7b179ac1d Ensure system_env is applied for Elixir deps, closes #15095 2026-02-05 23:41:12 +01:00
Dave Lucia 3c8fe8606c Faise on --min-cycle-label <= 0 (#15027)
Provides an error message in favor of

```
mix xref graph --format cycles --min-cycle-label 0 --label compile-connected
** (FunctionClauseError) no function clause matching in Enum.count_until/3

    The following arguments were given to Enum.count_until/3:

        # 1
        [{"lib/foo.ex", nil}, {"lib/bar.ex", nil}]

        # 2
        #Function<4.83728021/1 in Mix.Tasks.Xref.cycle_filter_fn/1>

        # 3
        0

    Attempted function clauses (showing 1 out of 1):

        def count_until(enumerable, fun, limit) when is_integer(limit) and limit > 0

    (elixir 1.19.4) lib/enum.ex:783: Enum.count_until/3
    (mix 1.19.4) lib/mix/tasks/xref.ex:1247: anonymous fn/3 in Mi
```
2025-12-30 09:21:51 +01:00
Jeffrey LoandJosé Valim bb9721f27c More robust git version parsing (#15019)
When GIT_TRACE=1 is set in the env, `mix deps.get` fails with an
unexpected `FunctionClauseError` due to `git --version`'s output
including trace output from git itself:

```
λ GIT_TRACE=1 mix deps.get
* Getting ariel (git@github.com:foo/bar.git - main)
22:17:06.786357 git.c:476               trace: built-in: git init --quiet
22:17:06.798692 git.c:476               trace: built-in: git remote add origin git@github.com:foo/bar.git
22:17:06.804333 git.c:476               trace: built-in: git config remote.origin.url git@github.com:foo/bar.git
** (FunctionClauseError) no function clause matching in Mix.SCM.Git.parse_version/1

    The following arguments were given to Mix.SCM.Git.parse_version/1:

        # 1
        "22:17:06.809548 git.c:476               trace: built-in: git version\ngit version 2.50.1\n"

    Attempted function clauses (showing 1 out of 1):

        defp parse_version(<<"git version ", version::binary>>)

    (mix 1.18.4) lib/mix/scm/git.ex:426: Mix.SCM.Git.parse_version/1
    (mix 1.18.4) lib/mix/scm/git.ex:419: Mix.SCM.Git.git_version/0
    (mix 1.18.4) lib/mix/scm/git.ex:132: Mix.SCM.Git.checkout/2
    (elixir 1.18.4) lib/file.ex:1665: File.cd!/2
    (mix 1.18.4) lib/mix/dep/fetcher.ex:68: Mix.Dep.Fetcher.do_fetch/3
    (mix 1.18.4) lib/mix/dep/converger.ex:238: Mix.Dep.Converger.all/9
    (mix 1.18.4) lib/mix/dep/converger.ex:170: Mix.Dep.Converger.init_all/8
    (mix 1.18.4) lib/mix/dep/converger.ex:110: Mix.Dep.Converger.all/4
```

This patch updates `git_version` to handle trace noise by running
parse on the final output line of `git --version`.

New `deps.git_test` added to exercise the `GIT_TRACE` condition.

* Update lib/mix/test/mix/tasks/deps.git_test.exs

---------

Co-authored-by: José Valim <jose.valim@gmail.com>
2025-12-17 08:59:13 +01:00