Warnings-as-errors fails build for dependencies in 1.17.0rc1

I’ve been using mix compile --warnings-as-errors --force as a check in CI to ensure I don’t ship code with warnings. This has worked in the past, displaying warnings from dependencies, and only failing if the warnings were from my own code. In 1.17.0rc1, this seems to have changed- it fails but I don’t see any warnings from my codebase:

❯ mix compile --warnings-as-errors --force
warning: using map.field notation (without parentheses) to invoke function Absinthe.Blueprint.Schema.ObjectTypeDefinition.functions() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/blueprint/schema.ex:62: Absinthe.Blueprint.Schema.functions/1
  (absinthe 1.7.6) lib/absinthe/schema/notation.ex:2342: Absinthe.Schema.Notation.functions_for_type/2
  (absinthe 1.7.6) lib/absinthe/schema/notation.ex:2293: Absinthe.Schema.Notation.lift_functions/3
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:117: Absinthe.Blueprint.Transform.walk/4
  (elixir 1.17.0-rc.1) lib/enum.ex:1829: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3

warning: using map.field notation (without parentheses) to invoke function IdoWeb.GraphqlSchema.__absinthe_pipeline_modifiers__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/schema.ex:366: Absinthe.Schema.apply_modifiers/2
  (absinthe 1.7.6) lib/absinthe/schema.ex:383: Absinthe.Schema.__after_compile__/2
  (elixir 1.17.0-rc.1) src/elixir_module.erl:461: anonymous fn/6 in :elixir_module.expand_callback/6
  (elixir 1.17.0-rc.1) src/elixir_module.erl:460: :elixir_module.expand_callback/6
  (stdlib 6.0) lists.erl:2146: :lists.foldl/3

warning: using map.field notation (without parentheses) to invoke function IdoWeb.GraphqlSchema.__absinthe_blueprint__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/schema.ex:385: Absinthe.Schema.__after_compile__/2
  (elixir 1.17.0-rc.1) src/elixir_module.erl:461: anonymous fn/6 in :elixir_module.expand_callback/6
  (elixir 1.17.0-rc.1) src/elixir_module.erl:460: :elixir_module.expand_callback/6
  (stdlib 6.0) lists.erl:2146: :lists.foldl/3
  (elixir 1.17.0-rc.1) src/elixir_module.erl:198: :elixir_module.compile/7

warning: using map.field notation (without parentheses) to invoke function Absinthe.Type.BuiltIns.Directives.__absinthe_blueprint__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/phase/schema/directive_imports.ex:36: Absinthe.Phase.Schema.DirectiveImports.do_imports/3
  (absinthe 1.7.6) lib/absinthe/phase/schema/directive_imports.ex:18: Absinthe.Phase.Schema.DirectiveImports.handle_imports/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:16: anonymous fn/3 in Absinthe.Blueprint.Transform.prewalk/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:117: Absinthe.Blueprint.Transform.walk/4
  (elixir 1.17.0-rc.1) lib/enum.ex:1829: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3

warning: using map.field notation (without parentheses) to invoke function Absinthe.Type.BuiltIns.Scalars.__absinthe_blueprint__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/phase/schema/type_imports.ex:38: Absinthe.Phase.Schema.TypeImports.do_imports/3
  (absinthe 1.7.6) lib/absinthe/phase/schema/type_imports.ex:18: Absinthe.Phase.Schema.TypeImports.handle_imports/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:16: anonymous fn/3 in Absinthe.Blueprint.Transform.prewalk/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:117: Absinthe.Blueprint.Transform.walk/4
  (elixir 1.17.0-rc.1) lib/enum.ex:1829: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3

warning: using map.field notation (without parentheses) to invoke function Absinthe.Type.BuiltIns.DeprecatedDirectiveFields.__absinthe_blueprint__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/phase/schema/type_extension_imports.ex:38: Absinthe.Phase.Schema.TypeExtensionImports.do_imports/3
  (absinthe 1.7.6) lib/absinthe/phase/schema/type_extension_imports.ex:18: Absinthe.Phase.Schema.TypeExtensionImports.handle_imports/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:16: anonymous fn/3 in Absinthe.Blueprint.Transform.prewalk/2
  (absinthe 1.7.6) lib/absinthe/blueprint/transform.ex:117: Absinthe.Blueprint.Transform.walk/4
  (elixir 1.17.0-rc.1) lib/enum.ex:1829: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3

warning: using map.field notation (without parentheses) to invoke function Absinthe.Schema.Prototype.__absinthe_directives__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/schema.ex:624: Absinthe.Schema.directives/1
  (absinthe 1.7.6) lib/absinthe/phase/schema/import_prototype_directives.ex:16: Absinthe.Phase.Schema.ImportPrototypeDirectives.run/2
  (absinthe 1.7.6) lib/absinthe/pipeline.ex:408: Absinthe.Pipeline.run_phase/3
  (absinthe 1.7.6) lib/absinthe/schema.ex:386: Absinthe.Schema.__after_compile__/2
  (elixir 1.17.0-rc.1) src/elixir_module.erl:461: anonymous fn/6 in :elixir_module.expand_callback/6

warning: using map.field notation (without parentheses) to invoke function Absinthe.Schema.Prototype.Compiled.__absinthe_directives__() is deprecated, you must add parentheses instead: remote.function()
  (absinthe 1.7.6) lib/absinthe/schema/compiled.ex:27: Absinthe.Schema.Compiled.__absinthe_directives__/1
  (elixir 1.17.0-rc.1) src/elixir_erl_pass.erl:715: :elixir_erl_pass.no_parens_remote/2
  (absinthe 1.7.6) lib/absinthe/schema.ex:624: Absinthe.Schema.directives/1
  (absinthe 1.7.6) lib/absinthe/phase/schema/import_prototype_directives.ex:16: Absinthe.Phase.Schema.ImportPrototypeDirectives.run/2
  (absinthe 1.7.6) lib/absinthe/pipeline.ex:408: Absinthe.Pipeline.run_phase/3

Compilation failed due to warnings while using the --warnings-as-errors option

Has something changed with this behavior?

Thanks!

It is known. There has been discussion about it here:

Thanks, I completely missed that. I’ll mention it in the rc1 thread as well…it’s my only issue with migrating to 1.17.

1 Like

Me too. It is kind of a good thing though.
People who use --warnings-as-errors are usually the kind of people who write good code. By creating an obstacle for these people, it is a rallying call to help with open source contributions. :smiley:

“Is your project failing to deploy because some lib needs a small update? Open the PR yourself!”

Yeah, I like seeing the warnings, but sadly blocking the build is a non-starter for me. My PRs to open source projects often go months without answer, so I’d hate to be blocked from upgrading to the latest Elixir unless I run forks of every dependency that hasn’t updated yet.

2 Likes