Skip to content

Commit

Permalink
Merge pull request #3565 from mozilla/fix-dependencies-ci; r=mhammond
Browse files Browse the repository at this point in the history
Run CI dependency checks on a Mac, to properly detect iOS-specific dependencies
  • Loading branch information
rfk committed Sep 10, 2020
2 parents 9ce6889 + 0770a36 commit 5046deb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ jobs:
name: Lint Bash scripts with shellcheck
command: sh automation/lint_bash_scripts.sh
Check Rust dependencies:
docker:
- image: circleci/rust:latest
# This check has to be done on a mac, to be able to detect iOS-specific dependencies.
macos:
xcode: "11.7.0"
steps:
- run: sudo apt-get install python3-pip
- install-rust
- setup-rust-toolchain
- checkout
- dependency-checks
Expand Down
11 changes: 9 additions & 2 deletions tools/dependency_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import hashlib
import json
import textwrap
import difflib
import itertools
import collections
from urllib.parse import urlparse, urlunparse
Expand Down Expand Up @@ -1086,7 +1087,13 @@ def pf(string, *args):
print_dependency_summary_markdown(deps, file=output)

if args.check:
output.seek(0)
outlines = output.readlines()
with open(args.check, 'r') as f:
if f.read() != output.getvalue():
checklines = f.readlines()
if outlines != checklines:
raise RuntimeError(
"Dependency details have changed from those in {}".format(args.check))
"Dependency details have changed from those in {}:\n{}".format(
args.check,
"".join(difflib.unified_diff(checklines, outlines))
))

0 comments on commit 5046deb

Please sign in to comment.