jelly-beam / rebar3_ex_doc

rebar3 plugin for generating docs with ex_doc
Apache License 2.0
43 stars 13 forks source link

Execute OTP-specific `ex_doc` (from `priv`) #83

Closed paulo-ferraz-oliveira closed 6 months ago

paulo-ferraz-oliveira commented 7 months ago

We add OTP-specific ex_doc binary execution.

⚠️ ~I'm basing this on top of #80, since I wanna benefit from the changes done there, and then do some. When that one's merged GitHub auto-rebases this one.~ (that would've happened if I had committed directly to this repo., which wasn't the case 😄) ⚠️ ~We need to wait until ex_doc is available for OTP 27 (or maybe as a fallback, we can assume Erlang maintains compatibility for at least one version and always try that with a warning?).~

Note

Individual commit messages contain more detail on what was done and part of the motivation for these change.

garazdawi commented 7 months ago

Since the ex_doc built for 26 is guaranteed to work with 27 and 28, there is no need wait for a 27 build to be sure things work with 27.

I imagine the ex_doc team will start producing 27 ex_doc binaries when the final release is done. Otherwise you run the risk of a backward incompatible fix in a release candidate will break the old builds.

paulo-ferraz-oliveira commented 7 months ago

Something's failing with the output generated on OTP 27.0-rc1. @starbelly, ideas? @garazdawi, if you have a little time to spare and this rings a bell, thoughts would be appreciated. Thanks.

Edit: fwiw, results are stuff like

%%% rebar3_ex_doc_SUITE ==> generate_docs_overriding_output_set_in_config: FAILED
%%% rebar3_ex_doc_SUITE ==>
Failure/Error: ?assertMatch({ match , [ << "foo/0 does nothing" >> ] }, re : run ( ModuleDoc , "foo/0 does nothing" , [ { capture , [ 0 ] , binary } ] ))
  expected: = { match , [ << "foo/0 does nothing" >> ] }
       got: nomatch
      line: 239

which seems to indicate (as per the tests' current expectations) something's off in generation. ... later... I think I see it, the expected input is based on new directives and not backward compatible with EDoc. 😄

paulo-ferraz-oliveira commented 7 months ago

f1182e1 fixes compilation and checks on OTP 27: we're expected to use -moduledoc and -doc.

At the same time, I decided to use if to distinguish from OTP releases (I think it's easier to find and handle these when update time comes, than to reason on otp_release).

paulo-ferraz-oliveira commented 7 months ago

I've updated the tests to run, when post-27, all the existing tests plus the same tests with a 27+ variation.

(tests are expected to fail, when using OTP from master, until @garazdawi's branch gets merged, and is used by Bob - that which feeds setup-beam)

paulo-ferraz-oliveira commented 7 months ago

@garazdawi's branch was merged. I'm making CI go again.

paulo-ferraz-oliveira commented 7 months ago

All ✅ Good stuff, Lukas.

starbelly commented 7 months ago

@paulo-ferraz-oliveira Unfortunately, there are conflicts to be resolved now

paulo-ferraz-oliveira commented 6 months ago

No prob. I can get on those.

paulo-ferraz-oliveira commented 6 months ago

I've rebased, and we should now get all ✅

paulo-ferraz-oliveira commented 6 months ago

I think we should be good to go. @starbelly, this might warrant a release, if just for testing with OTP 27 rc without workarounds.

starbelly commented 6 months ago

LGTM!