Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI dependency checks on a Mac, to properly detect iOS-specific dependencies #3565

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
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))
))