pigweed: Update to new json format (#7658)

Updates oss-fuzz to correctly parse Pigweed's updated CIPD JSON format
to fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44445. Also
restores bloaty to the list of required CIPD packages to allow
post-bootstrap checks to pass.
This commit is contained in:
armandomontanez 2022-05-03 00:04:22 -07:00 committed by GitHub
parent b22a30dbf4
commit 4ce19aa195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -36,7 +36,6 @@ python $SRC/filter_cipd.py \
--excludes \
infra/cmake \
fuchsia/third_party/bazel \
pigweed/third_party/bloaty-embedded \
fuchsia/third_party/clang \
infra/go \
pigweed/third_party/protoc-gen-go \

View File

@ -33,17 +33,21 @@ def main():
args = parser.parse_args()
# Load args.json
prebuilts = []
cipd_json = {}
try:
with open(args.json, 'r') as json_file:
prebuilts = json.load(json_file)
cipd_json = json.load(json_file)
except Exception:
print('Encountered error attempting to load ' + args.json)
raise
packages = cipd_json['packages']
# Filter out args.excludes
for exclude in args.excludes:
prebuilts[:] = [p for p in prebuilts if exclude not in str(p['path'])]
packages[:] = [p for p in packages if exclude not in str(p['path'])]
cipd_json['packages'] = packages
# Rename original CIPD JSON file
try:
@ -55,7 +59,7 @@ def main():
# Save new CIPD JSON file
try:
with open(args.json, 'w') as json_file:
json.dump(prebuilts, json_file, indent=2)
json.dump(cipd_json, json_file, indent=2)
except Exception:
print('Encountered error attempting to write ' + args.json)
raise