0

I just updated Elixir on my application and I’m trying to use the command mix edeliver build release --branch="$CURRENT_BRANCH" --auto-version=build-date+build-time+git-branch+git-revision to build a release, but it keeps telling me my mix.exs file specifies the previous version of Elixir.

(Partial) content of mix.exs:

  def project do
    [
      app: :project_name,
      version: version(),
      elixir: "~> 1.13.4",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps(),
      preferred_cli_env: [
        vcr: :test,
        "vcr.delete": :test,
        "vcr.check": :test,
        "vcr.show": :test
      ]
    ]
  end

How do I get the build command to work with the new version of Elixir? What else should I be trying/checking?

** (Mix) You're trying to run :project_name on Elixir v1.13.4 but it has declared in its mix.exs file it supports only Elixir ~> 1.8.1

Running cat mix.exs confirms I’ve got the right version in the Mix file in the directory where I’m trying to run the build command. I've restarted my machine as well. I’ve searched my workspace for any additional mix.exs files or any occurrences of 1.8.1, but to no avail.

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
  • I doubt the issue has anything to do with `edeliver`. What’s returned by `elixir --version`? – Aleksei Matiushkin Jun 13 '23 at 12:17
  • @AlekseiMatiushkin The output of `elixir --version` is `Elixir 1.13.4 (compiled with Erlang/OTP 25)` – aethon-luke Jun 13 '23 at 13:30
  • Where `edeliver` builds an app? Can you show the whole output of the `mix edeliver …` command? – Aleksei Matiushkin Jun 13 '23 at 14:58
  • @AlekseiMatiushkin `edeliver` builds the app on a docker container. I've tried deleting the `_build` folder between attempts, but this doesn't work. I have been able to avoid this problem by deleting/recloning the repo every time I change `mix.exs`. It must be some sort of build artifact, but I'm not sure where it's getting stored. – aethon-luke Jun 14 '23 at 14:41

1 Answers1

0

It's not clear which version of edeliver you're running, but it looks like specific versions of edeliver build with specific versions of elixir. According to the Github page, version 1.6 of edeliver builds with elixir 1.8. If you want to build with elixir 1.13, you should try setting edeliver to version 1.9 in your mix.exs:

defp deps do
  [
    ...
    {:edeliver, ">= 1.9.2"},
    ...
  ]
end
kjw0188
  • 3,625
  • 16
  • 28