-
Notifications
You must be signed in to change notification settings - Fork 20
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
Split download, prebuild check and build phases #535
Conversation
Codecov Report
@@ Coverage Diff @@
## master #535 +/- ##
==========================================
- Coverage 26.64% 26.63% -0.02%
==========================================
Files 48 48
Lines 4548 4562 +14
==========================================
+ Hits 1212 1215 +3
- Misses 3336 3347 +11
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like your branch is out of sync with the log2timeline repo - please rebase
l2tdevtools/build_helpers/dpkg.py
Outdated
return missing_packages | ||
|
||
def CheckProjectConfiguration(self): | ||
"""Checks if the project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the sentence got cut off here, please fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -54,3 +54,11 @@ def CheckBuildRequired(self, unused_source_helper_object): | |||
bool: True if a build is required, False otherwise. | |||
""" | |||
return True | |||
|
|||
def CheckProjectConfiguration(self): | |||
"""Checks if the project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please complete the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tools/build.py
Outdated
|
||
def _BuildProject(self, download_helper_object, project_definition): | ||
"""Builds a project. | ||
def _BuildProjectForDistribution( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the docstring, and perhaps rename to method to indicate that this also builds projects for which there is no distribution. Could you refactor to make distribution an optional arg, to make this clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do not do an additional refactor in this CL, seeing it already affects a significant part of the code base.
Also your comment sounds to me like ambiguity on the semantics of "distribution" let's have this discussion outside of this CL before making changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is being added in this PR, so I don't know what you mean by "additional refactor". The refactor is happening here, now.
I don't know what you mean about the semantics of distribution - per the docstring this is the "name of the distribution", and is None for every build target except dpkg-source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, per conversation, which was not clear from the initial review comment, reverted the name change of the method
tools/build.py
Outdated
for disabled_package in disabled_projects: | ||
undefined_projects.remove(disabled_package) | ||
|
||
check_configuration = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to misconfigured_builds to be consistent with the other sets here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
tools/build.py
Outdated
missing_build_dependencies.update(dependencies) | ||
|
||
if not project_builder.CheckProjectConfiguration(project_definition): | ||
print('Detected inconsistency in configuration of: {0:s}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this "detected error in configuration of: {0:s}"? I don't know what the configuration is supposed to be consistent with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if that is more clear to you, I can change inconsistency
into error
|
||
logging.info('Processing: {0:s}'.format(project_definition.name)) | ||
print('Failed downloading: {0:s}'.format(project_definition.name)) | ||
failed_downloads.add(project_definition.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why continue here? If a project can't be downloaded, don't we want to abort by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, build.py is supposed to continue with other builds. What happens is the next steps (build prep and build) for that project are skipped instead.
tools/build.py
Outdated
source_helper_object.project_name, | ||
build_helper_object.LOG_FILENAME) | ||
def CheckProjectConfiguration(self, project_definition): | ||
"""Checks if the project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been addressed.
tools/build.py
Outdated
self, build_helper_object, source_helper_object, distribution): | ||
"""Builds a project for a specific distribution. | ||
def CheckBuildDependencies(self, project_definition): | ||
"""Checks if the build dependencies a project are met. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been addressed.
tools/build.py
Outdated
@@ -178,7 +192,29 @@ def Build(self, project_definition): | |||
raise ValueError('Unsupported download URL: {0:s}.'.format( | |||
project_definition.download_url)) | |||
|
|||
return self._BuildProject(download_helper_object, project_definition) | |||
# TODO: implement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been addressed.
tools/build.py
Outdated
|
||
def _BuildProject(self, download_helper_object, project_definition): | ||
"""Builds a project. | ||
def _BuildProjectForDistribution( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is being added in this PR, so I don't know what you mean by "additional refactor". The refactor is happening here, now.
I don't know what you mean about the semantics of distribution - per the docstring this is the "name of the distribution", and is None for every build target except dpkg-source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks your branch has diverged from master - can you rebase please?
Split download, prebuild check and build phases