CircleCI-Public / cimg-elixir

The CircleCI Elixir Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/elixir
MIT License
4 stars 16 forks source link

Bug Report: wrong elixir version installed in cimg/elixir v1.16.x and v1.17.x #156

Open lwld opened 2 months ago

lwld commented 2 months ago

Describe the bug

All cimg/elixir images tagged with patch versions of 1.16 and 1.17 contain the wrong elixir version (patch .0 instead of what is tagged):

It seems that the elixir version was never updated when these images were published.

Images tagged with 1.15.8 are still correct, they contain elixir version 1.15.8.

Tested with -erlang-26.2.1 images.

To Reproduce

Minimal sample project that reproduces the issue: https://github.com/Kittysplit/cimg_test The build results on commits show which tag versions are correct and which aren't: https://github.com/Kittysplit/cimg_test/commits/main/

Sample config:

version: 2.1

workflows:
  check:
    jobs:
      - compile

jobs:
  compile:
    docker:
      - image: cimg/elixir:1.17.2-erlang-26.2.1
    steps:
      - checkout
      - run:
          name: "Check elixir version"
          command: elixir --version
      - run:
          name: "Install hex"
          command: mix local.hex --force
      - run:
          name: "Install rebar"
          command: mix local.rebar --force
      - run:
          name: "Get elixir dependencies"
          command: mix deps.get
      - run:
          name: "Build elixir"
          command: mix compile --warnings-as-errors
      - run:
          name: "Run elixir tests"
          command: mix test

The elixir --version step output already shows that it's running the wrong elixir version:

Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:36:8] [ds:36:8:10] [async-threads:1] [jit:ns]

Elixir 1.17.0 (compiled with Erlang/OTP 26)

If it contains an elixir project and the elixir version is fixed including patch version (with elixir: "~> 1.17.2"), mix compile / mix test will fail with ** (Mix) You're trying to run :cimg_test on Elixir v1.17.0 but it has declared in its mix.exs file it supports only Elixir ~> 1.17.2. See sample project linked above to reproduce.

Expected behavior

Images should contain the tagged elixir version, or higher patch version for images tagged with only a minor release (as described in https://github.com/CircleCI-Public/cimg-elixir?tab=readme-ov-file#tagging-scheme)

Workarounds

Screenshots and Build Links

Screenshots:

See elixir version in image container tag during spin up vs elixir --version output:

Screenshot 2024-07-12 at 17 29 32

Error on mix compile:

Screenshot 2024-07-12 at 17 29 44

Additional context none

tomtaylor commented 3 weeks ago

This seems like a pretty big issue - is anyone at CircleCI able to look at this? Thanks! cc: @bjohnso5