Skip to content

Commit

Permalink
bugfix (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen3feng authored Mar 2, 2021
1 parent 7040eb9 commit 4709c3b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/blade/build_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def build(self):
self.get_build_dir(),
self.build_script(),
self.build_jobs_num(),
_ALL_COMMAND_TARGETS,
self.__options)
targets='', # FIXME: because not all targets has a targets
options=self.__options)
self._write_build_stamp_fime(start_time, returncode)
if returncode != 0:
console.error('Build failure.')
Expand Down Expand Up @@ -547,7 +547,8 @@ def generate_targets_build_code(self):
code += 'include %s\n' % target_ninja
if k in self.__expanded_command_targets:
command_target_outputs.append(target.get_outputs_goal())
code.append('build %s: phony %s\n' % (_ALL_COMMAND_TARGETS, ' '.join(command_target_outputs)))
# TODO: reland this feature
# code.append('build %s: phony %s\n' % (_ALL_COMMAND_TARGETS, ' '.join(command_target_outputs)))
# code.append('default %s\n' % (_ALL_COMMAND_TARGETS))
return code

Expand Down
3 changes: 2 additions & 1 deletion src/blade/ninja_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def build(build_dir, build_script, jobs_num, targets, options):
cmd.append('-k0')
if console.verbosity_compare(options.verbosity, 'verbose') >= 0:
cmd.append('-v')
cmd.append(targets)
if targets:
cmd.append(targets)
build_start_time = time.time()
ret = _run_ninja_build(cmd, options)
if options.show_builds_slower_than is not None:
Expand Down
13 changes: 7 additions & 6 deletions src/blade/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ def parse_command_line(argv):

def open_zip_file_for_write(filename, compression_level):
"""Open a zip file for writing with specified compression level."""
compression = zipfile.ZIP_STORED if compression_level == "0" else zipfile.ZIP_DEFLATED
if sys.version_info.major == 3 and sys.version_info.minor >= 7:
# pylint: disable=unexpected-keyword-arg
return zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED,
compresslevel=int(compression_level))
return zipfile.ZipFile(filename, 'w', )
compression = zipfile.ZIP_DEFLATED
if sys.version_info.major < 3 or sys.version_info.major == 3 and sys.version_info.minor < 7:
if compression_level == "0":
compression = zipfile.ZIP_STORED
return zipfile.ZipFile(filename, 'w', compression)
# pylint: disable=unexpected-keyword-arg
return zipfile.ZipFile(filename, 'w', compression, compresslevel=int(compression_level))

0 comments on commit 4709c3b

Please sign in to comment.