Skip to content

Commit

Permalink
Merge branch 'master' into andre/substrate-bip39
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva committed Mar 6, 2024
2 parents 08c7ce6 + 475e7a1 commit 06802cf
Show file tree
Hide file tree
Showing 106 changed files with 1,091 additions and 626 deletions.
22 changes: 11 additions & 11 deletions .github/scripts/check-workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def parse_args():

parser.add_argument('workspace_dir', help='The directory to check', metavar='workspace_dir', type=str, nargs=1)
parser.add_argument('--exclude', help='Exclude crate paths from the check', metavar='exclude', type=str, nargs='*', default=[])

args = parser.parse_args()
return (args.workspace_dir[0], args.exclude)

def main(root, exclude):
workspace_crates = get_members(root, exclude)
all_crates = get_crates(root, exclude)
print(f'📦 Found {len(all_crates)} crates in total')

check_duplicates(workspace_crates)
check_missing(workspace_crates, all_crates)
check_links(all_crates)
Expand All @@ -48,14 +48,14 @@ def get_members(workspace_dir, exclude):

if not 'members' in root_manifest['workspace']:
return []

members = []
for member in root_manifest['workspace']['members']:
if member in exclude:
print(f'❌ Excluded member should not appear in the workspace {member}')
sys.exit(1)
members.append(member)

return members

# List all members of the workspace.
Expand All @@ -74,20 +74,20 @@ def get_crates(workspace_dir, exclude_crates) -> dict:
with open(path, "r") as f:
content = f.read()
manifest = toml.loads(content)

if 'workspace' in manifest:
if root != workspace_dir:
print("⏩ Excluded recursive workspace at %s" % path)
continue

# Cut off the root path and the trailing /Cargo.toml.
path = path[len(workspace_dir)+1:-11]
name = manifest['package']['name']
if path in exclude_crates:
print("⏩ Excluded crate %s at %s" % (name, path))
continue
crates[name] = (path, manifest)

return crates

# Check that there are no duplicate entries in the workspace.
Expand Down Expand Up @@ -138,23 +138,23 @@ def check_deps(deps):
if not 'path' in deps[dep]:
broken.append((name, dep_name, "crate must be linked via `path`"))
return

def check_crate(deps):
to_checks = ['dependencies', 'dev-dependencies', 'build-dependencies']

for to_check in to_checks:
if to_check in deps:
check_deps(deps[to_check])

# There could possibly target dependant deps:
if 'target' in manifest:
# Target dependant deps can only have one level of nesting:
for _, target in manifest['target'].items():
check_crate(target)

check_crate(manifest)



links.sort()
broken.sort()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ jobs:
shopt -s globstar
npx @paritytech/license-scanner scan \
--ensure-licenses ${{ env.LICENSES }} \
--exclude ./substrate/bin/node-template \
-- ./substrate/**/*.rs
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ build-runtimes-polkavm:
- .common-refs
- .run-immediately
script:
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p minimal-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p minimal-template-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p westend-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p rococo-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p polkadot-test-runtime
Expand Down
195 changes: 100 additions & 95 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 06802cf

Please sign in to comment.