Elixir 1.18 Deal with :warnings_as_errors deprecation in compiler_options/1
warning: :warnings_as_errors is deprecated as part of Code.get_compiler_option/1 (elixir 1.18.3) lib/code.ex:1597: Code.get_compiler_option/1 (elixir 1.18.3) lib/code.ex:1572: anonymous fn/2 in Code.compiler_options/1 (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1 (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2 (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4 warning: :warnings_as_errors is deprecated as part of Code.put_compiler_option/2, instead you must pass it as a --warnings-as-errors flag. If you need to set it as a default in a mix task, you can also set it under aliases: [compile: "compile --warnings-as-errors"] (elixir 1.18.3) lib/code.ex:1710: Code.put_compiler_option/2 (elixir 1.18.3) lib/code.ex:1573: anonymous fn/2 in Code.compiler_options/1 (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1 (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2 (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4
This commit is contained in:
parent
63cbc1208d
commit
5addbf39fb
4 changed files with 17 additions and 7 deletions
|
|
@ -43,9 +43,6 @@ defmodule Pleroma.Application do
|
|||
# every time the application is restarted, so we disable module
|
||||
# conflicts at runtime
|
||||
Code.compiler_options(ignore_module_conflict: true)
|
||||
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
|
||||
# due to protocol consolidation warnings
|
||||
Code.compiler_options(warnings_as_errors: false)
|
||||
Pleroma.Telemetry.Logger.attach()
|
||||
Config.Holder.save_default()
|
||||
Pleroma.HTML.compile_scrubbers()
|
||||
|
|
@ -93,6 +90,21 @@ defmodule Pleroma.Application do
|
|||
end
|
||||
end
|
||||
|
||||
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
|
||||
# due to protocol consolidation warnings
|
||||
# :warnings_as_errors is deprecated via Code.compiler_options/2 since 1.18
|
||||
if elixir_version = System.version() do
|
||||
[major, minor] =
|
||||
elixir_version
|
||||
|> String.split(".")
|
||||
|> Enum.map(&String.to_integer/1)
|
||||
|> Enum.take(2)
|
||||
|
||||
if major == 1 and minor < 18 do
|
||||
Code.compiler_options(warnings_as_errors: false)
|
||||
end
|
||||
end
|
||||
|
||||
# Define workers and child supervisors to be supervised
|
||||
children =
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue