Fixes for getting package version
Older versions of Python's subprocess do not have capture_output, so just get stdout directly. Also pass the full path to cargo in case it is not on PATH. Test: Run Change-Id: I368e905a93b344bca6635c6ab7a60def809e88d5
This commit is contained in:
@@ -483,8 +483,9 @@ class Crate(object):
|
|||||||
and where the package name does not match the emitted crate_name
|
and where the package name does not match the emitted crate_name
|
||||||
(e.g. [lib.name] is set).
|
(e.g. [lib.name] is set).
|
||||||
"""
|
"""
|
||||||
cargo_metadata = subprocess.run(['cargo', 'metadata', '--no-deps'],
|
cargo_metadata = subprocess.run([self.runner.cargo_path, 'metadata', '--no-deps'],
|
||||||
cwd=os.path.abspath(self.cargo_dir), capture_output=True)
|
cwd=os.path.abspath(self.cargo_dir),
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
if cargo_metadata.returncode:
|
if cargo_metadata.returncode:
|
||||||
self.errors += ('ERROR: unable to get cargo metadata for package version; ' +
|
self.errors += ('ERROR: unable to get cargo metadata for package version; ' +
|
||||||
'return code ' + cargo_metadata.returncode + '\n')
|
'return code ' + cargo_metadata.returncode + '\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user