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

binary_to_atom/1 breaks compatibility below OTP 23 #552

Open
robertfiko opened this issue Aug 2, 2023 · 4 comments
Open

binary_to_atom/1 breaks compatibility below OTP 23 #552

robertfiko opened this issue Aug 2, 2023 · 4 comments

Comments

@robertfiko
Copy link

In the Readme, it is stated, that Erlang/OTP 21+ is required, but the binary_to_atom/1 was introduced in OTP 23.
I suggest using, the binary_to_atom/2 with the second parameter, as utf8, which is basically how it is done in OTP 23.

https://www.erlang.org/doc/man/erlang.html#binary_to_atom-1

I can do the fix ofc., but wanted to consult with a maintainer.

@zuiderkwast
Copy link
Collaborator

It would be good to have a CI job running on OTP 21.

@erszcz
Copy link
Collaborator

erszcz commented Aug 2, 2023

I think the README should be updated to reflect the current CI. IMO maintenance effort this many versions backwards will be a problem and we've not even caught up with OTP 25, not to mention 26.

That being said, if a simple fix is sufficient in this case, I think a PR would be swiftly merged :)

@robertfiko
Copy link
Author

If that's the only part where compatibility breaks, I would prefer to do this fix, and I would really appreciate compatibility with at least OTP 22.

I will prepare a PR soon.

@zuiderkwast
Copy link
Collaborator

Great. If we want a github CI job for OTP 22, we'd need to install an old rebar3 which supports it. We can copy this rule from the eredis project:

      - name: Install compatible rebar3 version
        if: ${{ startsWith(matrix.otp-version, '20.') || startsWith(matrix.otp-version, '21.') || startsWith(matrix.otp-version, '22.') || startsWith(matrix.otp-version, '23.') || startsWith(matrix.otp-version, '24.')}}
        run: |
          git clone https://github.com/erlang/rebar3.git
          cd rebar3 && git checkout 3.15.2 && ./bootstrap && ./rebar3 local install
          echo "$HOME/.cache/rebar3/bin" >> $GITHUB_PATH

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

3 participants