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

Check dependency availability before building #40

Merged
merged 1 commit into from
Jun 21, 2018

Conversation

manveru
Copy link
Contributor

@manveru manveru commented Jun 20, 2018

2018-06-20-110314_650x303_scrot

@manveru manveru self-assigned this Jun 20, 2018
@manveru manveru requested a review from gdotdesign June 20, 2018 09:06
@manveru manveru force-pushed the check-missing-dependencies branch from fd1a4a3 to dbf868f Compare June 20, 2018 09:18
src/builder.cr Outdated
@json = MintJson.parse_current

terminal.measure "#{COG} Ensuring dependencies... " do
json.check_dependencies!(sources)
Copy link
Member

Choose a reason for hiding this comment

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

Passing the sources are not needed since the json knows about it's directory so it's calculable from there, or might not be needed at all (see last comment).

src/macros.cr Outdated
@@ -19,6 +19,16 @@ module Mint
end
end

class Builder
macro build_error(name)
Copy link
Member

Choose a reason for hiding this comment

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

I think it's not used anymore.

src/mint_json.cr Outdated
end

def dependency_exists?(sources : Array(String), name : String)
pattern = /\.mint\/packages\/#{name}\/source/
Copy link
Member

Choose a reason for hiding this comment

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

  • the source directory might not be present for every package since it's configurable via source-directories
  • I think at this point since we don't have a lock file It's enough to check if there is a directory for the package, then the sources are not even needed here
  • once we have a lock file then we can do a more thorough check

@manveru manveru force-pushed the check-missing-dependencies branch from 4b343e5 to d1fec70 Compare June 21, 2018 08:15
@manveru manveru changed the title Make sure dependencies are installed for mint build Check dependency availability before building Jun 21, 2018
@manveru manveru force-pushed the check-missing-dependencies branch from d1fec70 to cdec617 Compare June 21, 2018 08:17
@manveru
Copy link
Contributor Author

manveru commented Jun 21, 2018

@gdotdesign alright, cleaned it up a lot by simply checking the directory. I'd really like to not involve a lot of I/O during these phases, that's why I went with the sources approach, but maybe that can improved in the future as you say.

@manveru manveru merged commit 5729bf0 into mint-lang:master Jun 21, 2018
@manveru manveru deleted the check-missing-dependencies branch June 21, 2018 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants