Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh install gets quite a few warnings and deprecations #28

Open
alastair-measures opened this issue Mar 2, 2021 · 0 comments
Open

Comments

@alastair-measures
Copy link

alastair-measures commented Mar 2, 2021

Greetings, really impressed with the concept of "Veil" and trying it out as a relatively new person to Phoenix and Elixir. Using Phoenix 1.5.8 and Elixir 1.11.3/ Erlang/OTP 23 sitting in an docker container on Alpine.

Maybe these warnings and deprecations should be disregarded, however I am raising this out of uncertainty. Would like to be more confident before building Veil in to the core of my project.

Using the instructions and all good until mix veil.add which produced more feedback than anticipated:

~/qimp $ mix veil.add
==> jumper
Compiling 1 file (.ex)
Generated jumper app
==> gen_state_machine
Compiling 3 files (.ex)
Generated gen_state_machine app
==> unsafe
Compiling 3 files (.ex)
Generated unsafe app
===> Fetching rebar3_hex v6.10.3
===> Downloaded package, caching at /apps/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.10.3.tar
===> Fetching hex_core v0.7.1
===> Downloaded package, caching at /apps/.cache/rebar3/hex/hexpm/packages/hex_core-0.7.1.tar
===> Fetching verl v1.0.2
===> Downloaded package, caching at /apps/.cache/rebar3/hex/hexpm/packages/verl-1.0.2.tar
===> Compiling verl
===> Compiling hex_core
===> Compiling rebar3_hex
===> Rebar3 detected a lock file from a newer version. It will be loaded in compatibility mode, but important information may be missing or lost. It is recommended to upgrade Rebar3.
===> Compiling sleeplocks
==> gen_stage
Compiling 10 files (.ex)
Generated gen_stage app
==> eternal
Compiling 5 files (.ex)
Generated eternal app
==> cachex
Compiling 54 files (.ex)
warning: unknown compiler variable "__" (expected one of __MODULE__, __ENV__, __DIR__, __CALLER__, __STACKTRACE__)
  lib/cachex/router.ex:238: Cachex.Router.configure_remote/4

warning: Unsafe.Generator.__before_compile__/1 defined in application :unsafe is used by the current application but the current application does not depend on :unsafe. To fix this, you must do one of:

  1. If :unsafe is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :unsafe is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :unsafe, you may optionally skip this warning by adding [xref: [exclude: [Unsafe.Generator]]] to your "def project" in mix.exs

  lib/cachex.ex:1: Cachex

warning: Unsafe.Generator.__using__/1 defined in application :unsafe is used by the current application but the current application does not depend on :unsafe. To fix this, you must do one of:

  1. If :unsafe is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :unsafe is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :unsafe, you may optionally skip this warning by adding [xref: [exclude: [Unsafe.Generator]]] to your "def project" in mix.exs

  lib/cachex.ex:36: Cachex

warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/cachex/services/incubator.ex:37: Cachex.Services.Incubator.spec/2

warning: Supervisor.Spec.worker/3 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/cachex/services/informant.ex:148: Cachex.Services.Informant.spec/1

warning: Supervisor.Spec.supervise/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/cachex.ex:363: Cachex.init/1

warning: Supervisor.Spec.supervisor/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
Found at 6 locations:
  lib/cachex/services.ex:33: Cachex.Services.app_spec/0
  lib/cachex/services.ex:34: Cachex.Services.app_spec/0
  lib/cachex/services.ex:102: Cachex.Services.incubator_spec/1
  lib/cachex/services.ex:110: Cachex.Services.informant_spec/1
  lib/cachex/services.ex:132: Cachex.Services.limit_spec/1
  lib/cachex/services.ex:153: Cachex.Services.table_spec/1

warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
Found at 3 locations:
  lib/cachex/services.ex:94: Cachex.Services.courier_spec/1
  lib/cachex/services.ex:119: Cachex.Services.janitor_spec/1
  lib/cachex/services.ex:143: Cachex.Services.locksmith_spec/1

warning: Supervisor.Spec.supervisor/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/cachex/services/overseer.ex:47: Cachex.Services.Overseer.start_link/0

warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/cachex/services/overseer.ex:46: Cachex.Services.Overseer.start_link/0

Generated cachex app
==> crontab
Compiling 7 files (.ex)
Generated crontab app
==> libring
Compiling 5 files (.ex)
Generated libring app
==> swarm
Compiling 1 file (.erl)
Compiling 10 files (.ex)
warning: System.stacktrace/0 is deprecated, use __STACKTRACE__ instead
  lib/swarm/tracker/tracker.ex:828

warning: System.stacktrace/0 is deprecated, use __STACKTRACE__ instead
  lib/swarm/tracker/tracker.ex:1314

warning: System.stacktrace/0 is deprecated, use __STACKTRACE__ instead
  lib/swarm/tracker/tracker.ex:1408

warning: Supervisor.Spec.supervise/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/swarm/app.ex:16: Swarm.App.init/1

warning: Supervisor.Spec.supervisor/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/swarm/app.ex:11: Swarm.App.init/1

warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
Found at 2 locations:
  lib/swarm/app.ex:12: Swarm.App.init/1
  lib/swarm/app.ex:13: Swarm.App.init/1

Generated swarm app
==> quantum
Compiling 38 files (.ex)
warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/quantum/date_library/calendar.ex:1

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/quantum/date_library/timex.ex:1

warning: Quantum.DateLibrary.Timex.tz_to_utc!/2 is undefined (module Quantum.DateLibrary.Timex is not available or is yet to be defined)
  lib/quantum/date_library.ex:40: Quantum.DateLibrary.to_utc!/2

warning: Quantum.DateLibrary.Timex.utc_to_tz!/2 is undefined (module Quantum.DateLibrary.Timex is not available or is yet to be defined)
  lib/quantum/date_library.ex:47: Quantum.DateLibrary.to_tz!/2

Generated quantum app
==> swoosh
Compiling 32 files (.ex)
Generated swoosh app
==> phoenix_swoosh
Compiling 1 file (.ex)
warning: Phoenix.View.render_to_string/3 defined in application :phoenix is used by the current application but the current application does not depend on :phoenix. To fix this, you must do one of:

  1. If :phoenix is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :phoenix is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :phoenix, you may optionally skip this warning by adding [xref: [exclude: [Phoenix.View]]] to your "def project" in mix.exs

  lib/phoenix_swoosh.ex:159: Phoenix.Swoosh.do_render_body/4

Generated phoenix_swoosh app
==> veil
Compiling 6 files (.ex)
warning: Mix.Phoenix.inflect/1 defined in application :phoenix is used by the current application but the current application does not depend on :phoenix. To fix this, you must do one of:

  1. If :phoenix is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :phoenix is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :phoenix, you may optionally skip this warning by adding [xref: [exclude: [Mix.Phoenix]]] to your "def project" in mix.exs

  lib/mix/tasks/veil/add.ex:56: Mix.Tasks.Veil.Add.config_names/1

warning: Mix.Phoenix.otp_app/0 defined in application :phoenix is used by the current application but the current application does not depend on :phoenix. To fix this, you must do one of:

  1. If :phoenix is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :phoenix is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :phoenix, you may optionally skip this warning by adding [xref: [exclude: [Mix.Phoenix]]] to your "def project" in mix.exs

  lib/mix/tasks/veil/add.ex:54: Mix.Tasks.Veil.Add.config_names/1

warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
Found at 2 locations:
  lib/veil.ex:13: Veil.start/2
  lib/veil.ex:14: Veil.start/2

Generated veil app
==> qimp

Adding Veil to your project...

* amended config/config.exs - Veil config added
* creating lib/qimp/veil/clean.ex
* creating lib/qimp/veil/request.ex
* creating lib/qimp/veil/session.ex
* creating lib/qimp/veil/user.ex
* creating lib/qimp/veil/veil.ex
* creating lib/qimp_web/controllers/veil/fallback_controller.ex
* creating lib/qimp_web/controllers/veil/session_controller.ex
* creating lib/qimp_web/controllers/veil/user_controller.ex
* creating lib/qimp_web/emails/veil/login_email.ex
* creating lib/qimp_web/emails/veil/mailer.ex
* creating lib/qimp_web/plugs/veil/authenticate.ex
* creating lib/qimp_web/plugs/veil/user_id.ex
* creating lib/qimp_web/plugs/veil/user.ex
* creating lib/qimp_web/views/veil/email_view.ex
* creating lib/qimp_web/views/veil/error_view.ex
* creating lib/qimp_web/views/veil/session_view.ex
* creating lib/qimp_web/views/veil/user_view.ex
* creating lib/qimp_web/templates/veil/email/login.html.eex
* creating lib/qimp_web/templates/veil/user/form.html.eex
* creating lib/qimp_web/templates/veil/user/new.html.eex
* creating lib/qimp_web/templates/veil/user/show.html.eex
* creating priv/repo/migrations/20210302115654_add_veil.exs
* skipping lib/qimp_web/templates/layout/app.html.eex - already customised
* amended lib/qimp_web/router.ex - UserId & User plugs added to html pipeline
* amended lib/qimp_web/router.ex - Veil routes added

If your default layout page (`templates/layout/app.html.eex`) was already
modified or replaced, e.g. you see
`* skipping lib/sunrise_web/templates/layout/app.html.eex`
above then you'll need to manually add link markup similar to this:

  <%= if veil_user_id = assigns[:veil_user_id] do %>
    Authenticated as <%= veil_user_id %>
    <a href="<%= session_path(@conn, :delete, @session_unique_id) %>">Sign out</a>
  <% else %>
    <a href="<%= user_path(@conn, :new) %>">Sign in</a>
  <% end %>


Final steps:

Update the Veil configuration in your `config.exs` file to add an API key for your
preferred email service (for more details on the email options, please refer to the
[Swoosh Documentation](https://github.com/swoosh/swoosh)).

  config :veil, QimpWeb.Veil.Mailer,
    adapter: Swoosh.Adapters.Sendgrid,
    api_key: "your-api-key"

Launch your server and open http://localhost:4000/ in your browser.

  mix phx.server
  mix ecto.migrate

If you click the sign-in link in the top right and enter your email address, you'll be
sent an email with a sign-in button. Click this to re-open the website and you'll see
you are now authenticated.

For reference the output of mix deps.get command that preceded this is as follows:

~/qimp $ mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  connection 1.1.0
  cowboy 2.8.0
  cowboy_telemetry 0.3.1
  cowlib 2.9.1
  db_connection 2.3.1
  decimal 2.0.0
  ecto 3.5.8
  ecto_sql 3.5.4
  file_system 0.2.10
  gettext 0.18.2
  jason 1.2.2
  mime 1.5.0
  phoenix 1.5.8
  phoenix_ecto 4.2.1
  phoenix_html 2.14.3
  phoenix_live_dashboard 0.4.0
  phoenix_live_reload 1.3.0
  phoenix_live_view 0.15.4
  phoenix_pubsub 2.0.0
  plug 1.11.0
  plug_cowboy 2.4.1
  plug_crypto 1.2.1
  postgrex 0.15.8
  ranch 1.7.1
  telemetry 0.4.2
  telemetry_metrics 0.6.0
  telemetry_poller 0.5.1
New:
  cachex 3.3.0
  crontab 1.1.10
  eternal 1.2.2
  gen_stage 1.1.0
  gen_state_machine 2.1.0
  jumper 1.0.1
  libring 1.5.0
  phoenix_swoosh 0.2.0
  quantum 2.4.0
  sleeplocks 1.1.1
  swarm 3.4.0
  swoosh 0.25.6
  unsafe 1.0.1
  veil 0.2.0
* Getting veil (Hex package)
* Getting cachex (Hex package)
* Getting phoenix_swoosh (Hex package)
* Getting quantum (Hex package)
* Getting swoosh (Hex package)
* Getting crontab (Hex package)
* Getting gen_stage (Hex package)
* Getting swarm (Hex package)
* Getting gen_state_machine (Hex package)
* Getting libring (Hex package)
* Getting eternal (Hex package)
* Getting jumper (Hex package)
* Getting sleeplocks (Hex package)
* Getting unsafe (Hex package)
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

No branches or pull requests

1 participant