dashbitco / nimble_options

A tiny library for validating and documenting high-level options. 💽
Apache License 2.0
507 stars 38 forks source link

On elixir 1.17.1, warning: :protocol option is deprecated. Use :protocols instead. #129

Closed sungchulTW closed 4 months ago

sungchulTW commented 4 months ago

Hello.

First of all, thank you for your precious contributions to Elixir community. Because of your efforts, I am enjoying Elixir these days.

While I am evaluating Elixir 1.17.1, I found a deprecated warning as follows.

warning: :protocol option is deprecated. Use :protocols instead. (nimble_options 1.1.1) lib/nimble_options.ex:575: NimbleOptions.validate_value/3 (nimble_options 1.1.1) lib/nimble_options.ex:561: NimbleOptions.validate_option/3 (nimble_options 1.1.1) lib/nimble_options.ex:542: NimbleOptions.reduce_options/2

I don't know the details but I thought it would be nice to report here.

Thank you so much.

josevalim commented 4 months ago

Hi @sungchulTW! I don't think this is a deprecation in NimbleOptions, but maybe a deprecation from a library that is using NimbleOptions, but the stacktrace is not showing all of it.

sungchulTW commented 4 months ago

@josevalim Thank you, José Valim (@josevalim) Right, based on your answer, I think maybe Finch is the right place to report.

Here is the full stack trace.

warning: :protocol option is deprecated. Use :protocols instead.
  (nimble_options 1.1.1) lib/nimble_options.ex:575: NimbleOptions.validate_value/3
  (nimble_options 1.1.1) lib/nimble_options.ex:561: NimbleOptions.validate_option/3
  (nimble_options 1.1.1) lib/nimble_options.ex:542: NimbleOptions.reduce_options/2
  (elixir 1.17.1) lib/enum.ex:4858: Enumerable.List.reduce/3
  (elixir 1.17.1) lib/enum.ex:2585: Enum.reduce_while/3
  (nimble_options 1.1.1) lib/nimble_options.ex:535: NimbleOptions.validate_options/2
  (nimble_options 1.1.1) lib/nimble_options.ex:508: NimbleOptions.validate_options_with_schema_and_path/3
  (finch 0.18.0) lib/finch.ex:232: Finch.cast_pool_opts/1
  (finch 0.18.0) lib/finch.ex:201: anonymous fn/2 in Finch.pool_options!/1
  (stdlib 5.2.3) maps.erl:416: :maps.fold_1/4
  (finch 0.18.0) lib/finch.ex:160: Finch.start_link/1
  (stdlib 5.2.3) supervisor.erl:420: :supervisor.do_start_child_i/3
  (stdlib 5.2.3) supervisor.erl:406: :supervisor.do_start_child/2
  (stdlib 5.2.3) supervisor.erl:390: anonymous fn/3 in :supervisor.start_children/2
  (stdlib 5.2.3) supervisor.erl:1258: :supervisor.children_map/4
  (stdlib 5.2.3) supervisor.erl:350: :supervisor.init_children/2
  (stdlib 5.2.3) gen_server.erl:980: :gen_server.init_it/2
  (stdlib 5.2.3) gen_server.erl:935: :gen_server.init_it/6

P/S: Wow. José answered my issue!!!

whatyouhide commented 4 months ago

@sungchulTW this is not a warning with Elixir 1.17, it's a warning with Finch. It seems like you are using the :protocol option in Finch, which you'll need to replace with :protocols instead. Feel free to move this issue to Finch if it keeps being a problem, but the warning coming from nimble_options here is the expected behavior 🙃 Thanks for reporting!