Skip to content

Fix xref exclude deprecation warning - #86

Merged
josevalim merged 1 commit into
livebook-dev:mainfrom
fhunleth:fix-xref-warning
Jul 10, 2026
Merged

Fix xref exclude deprecation warning#86
josevalim merged 1 commit into
livebook-dev:mainfrom
fhunleth:fix-xref-warning

Conversation

@fhunleth

Copy link
Copy Markdown
Contributor

This fixes the following warning with Elixir 1.20:

warning: "xref: [exclude: ...]" in your mix.exs file is deprecated, instead use: "elixirc_options: [no_warn_undefined: ...]"
  (mix 1.20.2) lib/mix/tasks/compile.elixir.ex:243: Mix.Tasks.Compile.Elixir.xref_exclude_opts/2
  (mix 1.20.2) lib/mix/tasks/compile.elixir.ex:142: Mix.Tasks.Compile.Elixir.run/1
  (mix 1.20.2) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.20.2) lib/mix/task.compiler.ex:299: Mix.Task.Compiler.run_compiler/2
  (mix 1.20.2) lib/mix/task.compiler.ex:287: Mix.Task.Compiler.run/4
  (mix 1.20.2) lib/mix/tasks/compile.all.ex:75: Mix.Tasks.Compile.All.do_run/2

Comment thread mix.exs Outdated
name: "VegaLite",
elixir: "~> 1.12",
# Modules used by VegaLite.WxViewer if available
elixirc_options: [no_warn_undefined: [:wx, :wx_object, :wxFrame, :wxWebView]],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably move this to that module then?

@compile {:no_warn_undefined, [:wx, :wx_object, :wxFrame, :wxWebView]}

Instead of a global? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You caught me trying to get away with the minimal change to reduce the warnings I get when building Nerves Livebook. :)

PR updated with the local change.

This fixes the following warning with Elixir 1.20:

```
warning: "xref: [exclude: ...]" in your mix.exs file is deprecated, instead use: "elixirc_options: [no_warn_undefined: ...]"
  (mix 1.20.2) lib/mix/tasks/compile.elixir.ex:243: Mix.Tasks.Compile.Elixir.xref_exclude_opts/2
  (mix 1.20.2) lib/mix/tasks/compile.elixir.ex:142: Mix.Tasks.Compile.Elixir.run/1
  (mix 1.20.2) lib/mix/task.ex:502: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.20.2) lib/mix/task.compiler.ex:299: Mix.Task.Compiler.run_compiler/2
  (mix 1.20.2) lib/mix/task.compiler.ex:287: Mix.Task.Compiler.run/4
  (mix 1.20.2) lib/mix/tasks/compile.all.ex:75: Mix.Tasks.Compile.All.do_run/2
```
@josevalim
josevalim merged commit 3d7a641 into livebook-dev:main Jul 10, 2026
2 checks passed
@josevalim

Copy link
Copy Markdown
Contributor

💚 💙 💜 💛 ❤️

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.

2 participants