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

Bump Elixir and Erlang versions used for development #76

Merged
merged 3 commits into from
Nov 7, 2024
Merged

Conversation

takasehideki
Copy link
Contributor

@takasehideki takasehideki commented Nov 6, 2024

In this PR, I'd like to suggest that Elixir and Erlang versions shall be bumped for development.
These are implicitly specified in .tool-version.

  • Elixir: 1.15.7-otp-26 -> 1.17.3-otp-27
  • Erlang/OTP: 26.1.2 -> 27.1.2

These are the latest versions that can be installed asdf at this time. Of course, keeping them fresh is preferable, but I think reviewing them at the proper timing is sufficient.

Also, I have added these version numbers (along with Rust) clearly in README.

@takasehideki
Copy link
Contributor Author

During mix compile, toml caused the following warning.

==> toml
Compiling 10 files (.ex)
     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 264 │   defp handle_token(lexer, original, doc, type, skip, _data, lines) when type in '-_' do
     │                                                                                  ~
     │
     └─ lib/decoder.ex:264:82

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 371 │       {:ok, {type, _skip, _data, _lines}} when type in '-+' ->
     │                                                        ~
     │
     └─ lib/decoder.ex:371:56

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 419 │           {:ok, {:alpha, _, <<c::utf8>>, _}} when c in 'eE' ->
     │                                                        ~
     │
     └─ lib/decoder.ex:419:56

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 474 │       {:ok, {:alpha, _, <<c::utf8>>, _}} when c in 'eE' ->
     │                                                    ~
     │
     └─ lib/decoder.ex:474:52

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 514 │       {:ok, {sign, _, _, _}} when sign in '-+' and last == ?e ->
     │                                           ~
     │
     └─ lib/decoder.ex:514:43

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 518 │       {:ok, {:alpha, _, <<c::utf8>>, _}} when c in 'eE' and signal == ?. ->
     │                                                    ~
     │
     └─ lib/decoder.ex:518:52

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 522 │       {:ok, {?_, skip, _, lines}} when last not in '_e.' ->
     │                                                    ~
     │
     └─ lib/decoder.ex:522:52

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 538 │       {:ok, {type, skip, data, lines}} when last in 'e.' ->
     │                                                     ~
     │
     └─ lib/decoder.ex:538:53

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 542 │       {:ok, {_type, skip, _data, lines} = token} when last not in '_e.' ->
     │                                                                   ~
     │
     └─ lib/decoder.ex:542:67

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 682 │         {:ok, {sign, _, _, _}} when sign in '-+' ->
     │                                             ~
     │
     └─ lib/decoder.ex:682:45

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 796 │       {:ok, {sign, _, _, _}} when sign in '-+' ->
     │                                           ~
     │
     └─ lib/decoder.ex:796:43

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 916 │         {:ok, {type, skip, _, lines}} when type in '-_' ->
     │                                                    ~
     │
     └─ lib/decoder.ex:916:52

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 954 │               {:ok, {type, _, _, _}} when type in '-_' ->
     │                                                   ~
     │
     └─ lib/decoder.ex:954:51

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 969 │       {:ok, {type, _, _, _}} when type in '-_' ->
     │                                           ~
     │
     └─ lib/decoder.ex:969:43

     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
     │
 983 │           {:ok, {type, _, _, _}} when type in '-_' ->
     │                                               ~
     │
     └─ lib/decoder.ex:983:47

Generated toml app

This has already been suggested and fixed in bitwalker/toml-elixir#40 . However, toml-elixir development seems to have stalled for 2 years,,,
In conclusion, we can ignore this warning.

@takasehideki
Copy link
Contributor Author

mix test caused the following warning (and failed in GHA CI because of using the --warnings-as-errors).

Running ExUnit with seed: 520576, max_cases: 20

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/zenohex/nif_test.exs: Zenohex.NifTest."test subscriber subscriber_recv_timeout/1"/1

...............................................................
Finished in 27.0 seconds (0.00s async, 27.0s sync)
19 doctests, 44 tests, 0 failures

The reason is the below. From Erlang/OTP 27+, it is now recommended to explicitly write +0.0 or -0.0 (since these floating point values are internally different).
https://erlangforums.com/t/in-erlang-otp-27-0-0-will-no-longer-be-exactly-equal-to-0-0/2586

So I added b45426f to fix this.
Also, I have already checked that this change does not affect mix test with the previous version (Elixir 1.15.7-otp-26 and Erlang/OTP 26.1.2).

@takasehideki
Copy link
Contributor Author

Umm,,, mix test --cover failed,,, Coverage is clearly declining, for example Zenohex.Config is at 0%.
https://github.com/biyooon-ex/zenohex/actions/runs/11697005860/job/32575217597
https://github.com/biyooon-ex/zenohex/actions/runs/11677169096/job/32514623108

@pojiro Do you know what happened??

@takasehideki
Copy link
Contributor Author

takasehideki commented Nov 6, 2024

Is this the information we should focus on??
https://elixirforum.com/t/elixir-v1-17-0-released/64151/2
elixir-lang/elixir#13761

@pojiro
Copy link
Contributor

pojiro commented Nov 6, 2024

@takasehideki

Umm,,, mix test --cover failed,,, Coverage is clearly declining, for example Zenohex.Config is at 0%.

I also think elixir-lang/elixir#13761 causes this.
We can work around this by decrease the threshold value until the release of Elixir version which includes the fix.

@takasehideki
Copy link
Contributor Author

takasehideki commented Nov 6, 2024

@pojiro You are right!! I confirmed mix test with asdf install elixir main (its commit/fix has been taken) worked fine. We expect this will probably be taken in Elixir v1.7.4.
For now, I decided that we will change the threshold setting and leave the Issue as a reminder.

@takasehideki
Copy link
Contributor Author

takasehideki commented Nov 6, 2024

CI finally worked fine!! 🎉
Added memo to #77

@takasehideki takasehideki requested a review from s-hosoai November 6, 2024 09:24
@takasehideki
Copy link
Contributor Author

@s-hosoai @pojiro could you give me your comments and/or reviews about my suggestion; bump Elixir to 1.17.3-otp-27 and Erlang/OTP 27.1.2 for development use.

@pojiro
Copy link
Contributor

pojiro commented Nov 6, 2024

@takasehideki LGTM

@takasehideki
Copy link
Contributor Author

OK, going to merge!
@s-hosoai feel free to let me know if you have any concerns.

@takasehideki takasehideki merged commit 838abfd into main Nov 7, 2024
4 checks passed
@takasehideki takasehideki deleted the bump_ee branch November 7, 2024 03:42
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

Successfully merging this pull request may close these issues.

2 participants