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

Project handoff to forked version. #1

Merged
merged 33 commits into from
Jun 20, 2024
Merged

Project handoff to forked version. #1

merged 33 commits into from
Jun 20, 2024

Conversation

christhekeele
Copy link
Owner

@christhekeele christhekeele commented Apr 14, 2024

This PR helps carry on @asummers's work on erlex.

Some work is needed to be done to maintain this fork, as it was unmaintained for a while, and I do not have access to the project's old CI and coverage environments.

Typechecking in CI has been prepared, but disabled, as the machinery here I'm stealing from https://github.com/christhekeele/matcha uses dialyxer which depends on this project. Will mess with a pure dialyzer suite later.

Fixes jeremyjh/dialyxir#534.

TODO list

  • Define core branches

    I use latest rather than master on OSS projects, and a release branch pointing to the most recently released version of the code. Core branches should require test suite with linting and full test matrix to pass before merging via branch protection.

  • Fix tags and Changelong

    Some of these were missing or missnamed, and links in the changelog were broken as a result.

  • Get test suite running

    The original project was using CircleCI. Moved to GitHub actions as this is what I'm familiar with. Runs on commits/PRs and does testing + linting stuff on latest OTP+Elixir.

  • Get test coverage reporting

    See: https://coveralls.io/github/christhekeele/erlex

    The original project was using Codecov. Moved to Coveralls as this is what I'm familiar with. Have updated badges et al.

  • Build test matrix against all supported versions

    The old project's CI was running just against a few versions of erl/elixir, a small subset of what it supported, and missing testing for later released versions. Now runs all tests stuff against the full battalion of supported versions on all commits/PRs to core branches.

  • Incorporate open PRs

    Merging in these PRs will allow for a prompt release once hex.pm control is passed on.

  • Set up hex publishing

    Once hex.pm control is passed on, will need to add a new hex key into the repo secrets to allow publishing packages from CI.

  • Pre-release version 0.2.7-handoff with merged PRs for community testing.

    I am confident in the patches I have applied, but want to validate the many changes I made to the mix.exs file to expand the test matrix to all supported versions of erl/elixir before releasing something that might auto-bump in people's projects.

  • Merge this branch and release version 0.2.7 to the community at large.

    I would like to wait for at least a couple of folk other than myself to try out the pre-release, as I am still a little anxious about taking over a package that with 10k daily downloads.

@fhunleth
Copy link

I was just looking into the status of the leex and yecc warning fixes and was really pleased to see that you were taking this on. Thank you!

@alappe
Copy link

alappe commented Jun 4, 2024

@christhekeele Great effort on your side, thanks! I tried it in two projects I am currently working on (v1.16.2) and I didn't notice any issues 🚀

@markolson-powerschool
Copy link

markolson-powerschool commented Jun 4, 2024

mix compile looks clean!

However, updating my deps to use {:erlex, "== 0.2.7-handoff", only: [:dev, :test], runtime: false, allow_pre: true, override: true}, I get this error when running mix dialyzer the first time:

:dialyzer.run error: Analysis failed with error:
Could not scan the following file(s):
  Could not get Core Erlang code for: /Users/me/Code/project/_build/dev/lib/erlex/ebin/Elixir.Erlex.beam

This still happens on a first run after rm -rf _build deps as well. Hopefully it's just something silly with my environment or mix setup, but I thought it'd be worth pointing out just in case..

erlang 26.1.2
elixir 1.6.2

@christhekeele
Copy link
Owner Author

christhekeele commented Jun 5, 2024

@markolson-powerschool (Assuming you meant Elixir v1.16.2, as 1.6.2 is not compatible with OTP 26.1.2)

Interesting, I cannot reproduce... Tried these versions exactly, with the same steps (plus deleting PLT caches, have you tried that?) in both matcha, a phoenix app, and a larger umbrella app.

Hopefully it's just something silly with my environment or mix setup...

This forum thread has some ideas for diagnosing different reasons why this could happen; what ended up ultimately being the problem there was the package was only compiling debug info in MIX_ENV=dev and mix defaults to compiling deps as if they were MIX_ENV=prod. What MIX_ENV are you running under?

Indeed, in this handoff I have set erlex to only compile debug info in dev and test. This is a change in previous behaviour I should probably revert, but first, can you try adding env: :test to your dependency specification to confirm? AKA:

{:erlex, "== 0.2.7-handoff",
  only: [:dev, :test],
  runtime: false,
  allow_pre: true,
  override: true,
  env: :test # <== new parameter
}

You can also install from this repo with ref: "handoff" to see if that fixes.

@christhekeele
Copy link
Owner Author

Also, thank you so much for taking the time to report this @markolson-powerschool! 🙂

@Sinc63
Copy link

Sinc63 commented Jun 14, 2024

I am upgrading a project to 1.16.3 with erlang 26.2.5. I installed 0.2.7-handoff, per the instruction above.

Upgraded:
  erlex 0.2.6 => 0.2.7-handoff
* Updating erlex (Hex package)
erlex is using unknown options: :allow_pre

Is the allow_pre option supposed to do anything?

Ran dialyzer and did not encounter any problems from the tool, just a couple of unneeded skips.
EDIT: OK, maybe there is a problem, although I guess it isn't an erlex problem. On the first pass I got:

Total errors: 97, Skipped: 95, Unnecessary Skips: 2
Unused filters:
{"lib/coherence/controllers/registration_controller_base.ex", :no_return}
{"lib/coherence/controllers/session_controller_base.ex", :no_return}
unused filters present
Halting VM with exit status 1

So I removed two filters from my .dialyzer_ignore.exs:

+  # {"lib/coherence/controllers/registration_controller_base.ex", :no_return},
+  # {"lib/coherence/controllers/session_controller_base.ex", :no_return}

and the second pass gave me:

Total errors: 97, Skipped: 95, Unnecessary Skips: 0
done in 0m13.33s
deps/coherence/lib/coherence/controllers/registration_controller_base.ex:14:no_return
Function delete/2 has no local return.
________________________________________________________________________________
deps/coherence/lib/coherence/controllers/session_controller_base.ex:10:no_return
Function delete/2 has no local return.
________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

So the first time it told me that there were two unnecessary skips, and I now note, reported that there were two errors that weren't skipped but also weren't reported (unless it counts the unused filters), but with those skips removed I now get errors that need those skips. I guess I'll have to keep the "unused skips". :-)

2ND Edit: The skips had been coded with my local path starting with lib, which does exist, but apparently hid the problems in deps, while still appearing unused. (That's clearly a dialyxir problem - it used the filter to suppress the deps warning but still reported the filter as unused.) But I fixed it all by adding the ``deps/coherence` to the front of the filters.
But that's not an erlex problem, so you're good to go.

Thanks for taking over the project. The open source world needs more inheritors.

@christhekeele christhekeele merged commit 4c9c2a5 into latest Jun 20, 2024
54 checks passed
@christhekeele christhekeele deleted the handoff branch June 20, 2024 21:21
@Moosieus
Copy link

Moosieus commented Jun 30, 2024

Came across this looking to reduce the amount of warnings in Lexical, absolutely didn't expect to find this. Thank you for picking up the work here Chris.

I'm sorry to hear about what happened to Andrew, hope he's resting well.

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.

Compiler warnings with Elixir 1.16
8 participants