Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions tools/fuchsia/gen_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def GenerateManifest(package_dir):
common_prefix = os.path.commonprefix([root, package_dir])
rel_path = os.path.relpath(os.path.join(root, f), common_prefix)
from_package = os.path.abspath(os.path.join(package_dir, rel_path))
assert from_package, 'Failed to create from_package for %s' % os.path.join(root, f)
full_paths.append('%s=%s' % (rel_path, from_package))
parent_dir = os.path.abspath(os.path.join(package_dir, os.pardir))
manifest_file_name = os.path.basename(package_dir) + '.manifest'
Expand Down Expand Up @@ -91,20 +92,12 @@ def main():
]

# Build the package
try:
output = subprocess.check_output(pm_command_base + ['build'])
except subprocess.CalledProcessError as e:
print('The "%s" command failed:' % e.cmd)
print(e.output)
raise
# Use check_output so if anything goes wrong we get the output.
subprocess.check_output(pm_command_base + ['build'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd like to have the script print the contents of the manifest if this command fails.

The error on LUCI is consistent with an empty from_package in the manifest. However, that shouldn't be possible - os.path.abspath should return a nonempty string containing the current working directory path. There might be something else wrong with the manifest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added that


# Archive the package
try:
output = subprocess.check_output(pm_command_base + ['archive'])
except subprocess.CalledProcessError as e:
print('The "%s" command failed:' % e.cmd)
print(e.output)
raise
# Use check_output so if anything goes wrong we get the output.
subprocess.check_output(pm_command_base + ['archive'])

return 0

Expand Down