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

add check_for_undefined_functions option using xref on release #815

Merged
merged 4 commits into from
Aug 26, 2020

Conversation

tsloughter
Copy link
Member

systools exref feature has no good way of setting the xref library path so I've added our own feature for this. A use can still enable exref if they desire but in docs we will focus on this new option.

It only adds project apps that are in the release (even if they are not listed directly but are a dependency of another project app listed in the relx release applications list) and sets the library path to only include applications in the release.

This is important for helping catch when a user forgets to include an application in the release that is used -- like forgetting to add a runtime dependency to .app.src .

Question I want considered before we merge this: Should it be on by default?

I'm learning towards making it on by default.

Future work that should be done:

  • Option to include non-OTP dependencies in the analysis. Main reason to always leave out OTP apps is stuff like sasl that has calls applications it doesn't depend on (the tools app).
  • Option to exclude specific apps or warnings from the analysis. Example of the need for this is if the user wants to use the future "all dependencies" option and have a dep like elli that calls ssl but doesn't depend on it since the user doesn't have to use the ssl feature.
  • Update the systools exref feature to make this being in relx no longer needed.

@tsloughter tsloughter requested review from ferd and lrascao August 26, 2020 14:06
Copy link
Collaborator

@ferd ferd left a comment

Choose a reason for hiding this comment

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

Since this seems to be checking by default I say we turn it on by default in the main branch, update master on rebar3, see if the integration tests we have blow up or work, and use that as a proxy for bad releases and whether things are worth fixing or not.

We can always revert the default before cutting a major release?

link := boolean() | undefined}.
link := boolean() | undefined,

is_project_app := boolean()}.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we go for an app_type kind of deal where it could be project_app, dep, checkout, etc.?
I figure here there are more things like whether it's an OTP library and whatnot and I'm not sure that project_app is always the clearest determining value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good point, can include system in there for otp libs.

src/rlx_assemble.erl Outdated Show resolved Hide resolved
Co-authored-by: Fred Hebert <mononcqc@ferd.ca>
@tsloughter
Copy link
Member Author

Since this seems to be checking by default

We aren't checking by default. It is default set to false.

@ferd
Copy link
Collaborator

ferd commented Aug 26, 2020

Since this seems to be checking by default

We aren't checking by default. It is default set to false.

Yeah sorry, I meant "since this seems to be checking only undefines by default". I feel that's generally safe and good, and for a good while regretted not having it as a default in Dialyzer. I feel it's safer / less annoying to see for releases than dialyzer all of a sudden too.

@tsloughter tsloughter merged commit 96182ed into erlware:master Aug 26, 2020
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.

3 participants