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

Unknown type cowboy_router:route_match #115

Closed
paulo-ferraz-oliveira opened this issue Feb 15, 2019 · 22 comments
Closed

Unknown type cowboy_router:route_match #115

paulo-ferraz-oliveira opened this issue Feb 15, 2019 · 22 comments

Comments

@paulo-ferraz-oliveira
Copy link
Collaborator

Hi.

I'm running cowboy_swagger 1.2.3 with cowboy 1.1.2.

Static (dialyzer) analysis shows that cowboy_swagger trails.erl uses type cowboy_router:route_match(), which is not exported from cowboy 1.1.2's cowboy_router.

I don't know what cowboy version cowboy_swagger assumes for -spec().ing purposes, but I supposed (probably wrongly) that 2.x from cowboy_swagger would use 2.x from cowboy, for which the previous would be incompatible.

Would you be open to a support patch for 1.2.3 that fixes that issue?

Thanks.

@elbrujohalcon
Copy link
Member

We sure am. Send that PR our way, @paulo-ferraz-oliveira !! Thank you in advance :)

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I'd require a support branch (in the sense of git-flow, something like support/1.x) from c1258a1, though. Is that possible?

I'll do static analysis on 2.x to see if it suffers from a similar issue.

@elbrujohalcon
Copy link
Member

Let me add you as a collaborator to this repo…

@elbrujohalcon
Copy link
Member

Done! Go ahead and create branches! :)

@paulo-ferraz-oliveira
Copy link
Collaborator Author

👍 thanks.

I'm passing xref and dialyzer on both cowboy_trails and cowboy_swagger for OTP 19.3, 20.3 and 21.2. I (locally) changed rebar.config a bit (in both projects) to have my usual xref and dialyzer options. Will post results here, soon.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Feb 18, 2019

cowboy_trails

  • with rebar3 xref, shows trails_handler: 1 unresolved call (I've never seen this before!),
  • on OTP 21.2, has multiple compile-time warnings, related to cowboy and ranch,
  • does not show other xref warnings,
  • does not show other dialyzer warnings,
  • with the remote rebar.config there's no new information

@elbrujohalcon
Copy link
Member

unresolved call means "there is a dynamic call in there". Likely this one, which is fine since it is a behavior after all.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

unresolved call means "there is a dynamic call in there". Likely this one, which is fine since it is a behavior after all.

But I've had dynamic calls in the past (for behaviours and not only) and I've never seen this warning.

@elbrujohalcon
Copy link
Member

No idea, but that's also the only line of actual code in that module anyway. 🤷‍♂️

@paulo-ferraz-oliveira
Copy link
Collaborator Author

cowboy_swagger

  • has a deprecation warning, related to cowlib,
  • on OTP 21.2, has multiple compile-time warnings, related to cowboy and ranch,
  • does not show other xref warnings,
  • does not show other dialyzer warnings,
  • with the remote rebar.config we get a bunch of unused exports (from xref) but that's fine!

@paulo-ferraz-oliveira
Copy link
Collaborator Author

combo cowboy master / cowboy_swagger master

  • shows no warnings for xref and dialyzer, with OTP 19.3, 20.3 or 20.2 [I'm using 19+ because cowboy 2.x dropped support for 18.x], which means that once I migrate I won't have an issue anymore :D...

... but until I do, I'd like to PR trails (sorry, I though the issue was in cowboy_swagger, since I don't use trails directly).

@elbrujohalcon
Copy link
Member

I'll add you as a collaborator there, as well.

@elbrujohalcon
Copy link
Member

Done! :)

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Feb 18, 2019

I can't seem to be able (403) to push to origin/upstream.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Feb 18, 2019

This is what I'm proposing for support/0.x (for trails): https://github.com/paulo-ferraz-oliveira/cowboy-trails/tree/support/0.x

@paulo-ferraz-oliveira
Copy link
Collaborator Author

No idea, but that's also the only line of actual code in that module anyway. 🤷‍♂️

It's due to xref_warnings. I'd never used it before.

@elbrujohalcon
Copy link
Member

Cool. You should accept your invite at https://github.com/inaka/cowboy-trails/invitations

@elbrujohalcon
Copy link
Member

This changes look good to me, BTW.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

Here's what I'll propose for support/1.x: https://github.com/paulo-ferraz-oliveira/cowboy_swagger/tree/support/1.x

I need a minor rebar.lock update as soon as trails is hex-published, though.

@elbrujohalcon
Copy link
Member

…and now it's published :)

@paulo-ferraz-oliveira
Copy link
Collaborator Author

@elbrujohalcon: do you think we can/should close this thread?

@elbrujohalcon
Copy link
Member

Closing it!

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

2 participants