Skip to content

Use + instead of a comma to separate mix tasks in port runner#153

Merged
lpil merged 3 commits intolpil:masterfrom
rmoorman:patch-1
Oct 21, 2025
Merged

Use + instead of a comma to separate mix tasks in port runner#153
lpil merged 3 commits intolpil:masterfrom
rmoorman:patch-1

Conversation

@rmoorman
Copy link
Copy Markdown
Contributor

Adjust the cli command building code to use a plus instead of a comma as using commas to separate tasks is deprecated in elixir 1.19.

Closes #152

Adjust the cli command building code to use a plus instead of a comma as
using commas to separate tasks is deprecated in elixir 1.19.

Closes lpil#152
@lpil
Copy link
Copy Markdown
Owner

lpil commented Jun 23, 2025

Are you able to get the docs to generate with latest Erlang and Elixir? I've been having problems which as preventing me from merging and publishing.

@rmoorman
Copy link
Copy Markdown
Contributor Author

Will have a look tonight.

@rmoorman
Copy link
Copy Markdown
Contributor Author

@lpil , mix docs indeed gave a warning on elixir 1.19.0-rc.0 (regardless of otp/erlang version). This has been fixed by adding a missing typespec.

There also was, another problem regarding the OTP 28 related changes for regexes (which I didn't notice until now because I was mainly targeting OTP 27). Anyway, compiled regexes now contain a reference which causes regex compilation results to be not directly comparable.

# This comparison does not work anymore (the ref is different)
iex(1)> ~r"migration_.*" == ~r"migration_.*"
false
# Instead we could match on the regex source
iex(2)> %Regex{source: "migration_.*"} = ~r"migration_.*"
~r/migration_.*/

On elixir 1.19.0-rc.0-otp-28 with erlang 28.0.1 the tests failed because of this as compilation results were being compared, e.g.:

  1) test :exclude contains default Ecto migrations directory by default (MixTestWatch.ConfigTest)
     test/mix_test_watch/config_test.exs:34
     Assertion with in failed
     code:  assert ~r"priv/repo/migrations" in config.exclude
     left:  ~r/priv\/repo\/migrations/
     right: [~r/\.#/, ~r/priv\/repo\/migrations/]
     stacktrace:
       test/mix_test_watch/config_test.exs:36: (test)

or

  3) test new/1 takes :exclude from the env (MixTestWatch.ConfigTest)
     test/mix_test_watch/config_test.exs:21
     Assertion with == failed
     code:  assert config.exclude == [~r"migration_.*"]
     left:  [%Regex{opts: [], re_pattern: {:re_pattern, 0, 0, 0, #Reference<0.2006086746.2454061064.100111>}, source: "migration_.*"}]
     right: [%Regex{opts: [], re_pattern: {:re_pattern, 0, 0, 0, #Reference<0.2006086746.2454061064.100112>}, source: "migration_.*"}]
     stacktrace:
       test/mix_test_watch/config_test.exs:24: (test)

It seems that just amending the tests does the trick, as the compilation result is not compiled into a module attribute (which would cause issues with releases I guess), but is only used at runtime, and in a local development setting. Sadly the aesthetics seem to be a little worse (or the api surface would have to change from regexes to string patterns or functions returning regexes). Anyway, I also included fixes for those tests

Please have a look.

@lpil
Copy link
Copy Markdown
Owner

lpil commented Jun 25, 2025

These changes are unrelated to exdoc, and tests don't get run when publishing a mix package to Hex. Are you sure this resolved the problem for you?

@rmoorman
Copy link
Copy Markdown
Contributor Author

rmoorman commented Jun 25, 2025

I was able to generate the docs with elixir 1.19.0-rc.0-otp-28 and erlang 28.0.1 (vendored through asdf). I was assuming that maybe the warnings interfered with publishing the package (as the warnings showed up when running mix docs on elixir 1.19).

$ mix hex.publish --dry-run
Building mix_test_watch 1.3.0
  Dependencies:
    file_system ~> 0.2 or ~> 1.0 (app: file_system)
  App: mix_test_watch
  Name: mix_test_watch
  Files:
    LICENCE
    README.md
    CHANGELOG.md
    lib
    lib/mix
    lib/mix/tasks
    lib/mix/tasks/test
    lib/mix/tasks/test/watch.ex
    lib/mix_test_watch.ex
    lib/mix_test_watch
    lib/mix_test_watch/runner.ex
    lib/mix_test_watch/config.ex
    lib/mix_test_watch/path.ex
    lib/mix_test_watch/watcher.ex
    lib/mix_test_watch/message_inbox.ex
    lib/mix_test_watch/port_runner
    lib/mix_test_watch/port_runner/port_runner.ex
    priv
    priv/zombie_killer
    mix.exs
  Version: 1.3.0
  Build tools: mix
  Description: Automatically run tests when files change
  Licenses: MIT
  Links: 
    Changelog: https://hexdocs.pm/mix_test_watch/changelog.html
    GitHub: https://github.com/lpil/mix-test.watch
  Elixir: ~> 1.5
Before publishing, please read the Code of Conduct: https://hex.pm/policies/codeofconduct

Publishing package to public repository hexpm.

Proceed? [Yn] 
Building docs...
Generating docs...
View "html" docs at "doc/index.html"
View "epub" docs at "doc/mix test.watch.epub"
Local password: 
Publishing package...
Publishing docs...

Do you get a specific error on your side that I could use to investigate what could be amiss?

@rmoorman
Copy link
Copy Markdown
Contributor Author

rmoorman commented Jul 9, 2025

@lpil , did you have any chance to try building the package again in the meantime? If you encounter any issues, I could try to help investigate.

Copy link
Copy Markdown
Owner

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@lpil lpil merged commit f7a4f0b into lpil:master Oct 21, 2025
@rmoorman rmoorman deleted the patch-1 branch October 21, 2025 16:49
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.

Using commas as separators in "mix do" is deprecated

2 participants