Skip to content

Commit e835e1c

Browse files
stevenjbkioshn
andauthored
chore(rust): Make a single workspace and remove all workspace dependecies. (#12)
* chore(rust): Make a single workspace and remove all workspace dependencies. Update rust toolchain. * fix(rust/c509-certificate): Try and fix cargo.toml lint error * fix(rust): Fix clippy.toml missing entry * fix(rust/cbork): Copy cbork crates into builder properly * fix(rust/cbork): Fix package now * fix(rust/cbork): Fix cddl_parser library use statements * fix(rust/cbork): Code format * fix(rust/c509-certificate): Fix wasm library build for c509-certificate * fix(rust/c509-certificate): Remove obsolete Earthfile * feat(rust/hermes-ipfs): Fix doc comment formatting * fix(rust/cbork): Fix cbork abnf parser module name * fix(rust): Fix spelling mistake * fix(rust): Add dev convenience helpers in a Justfile * feat(general): Add command to sort the project spelling words list correctly * fix(general): Fix project dictionary sorting * feat(general): Add justfile for developer convenience and suggested pre-push hook that uses it. * fix(rust/c509-certificate): Remove redundant errors file from cbork crate * fix(rust/cbork): Add target which just exports the cbork executable we built. * fix(rust): Build everything in the workspace, including docs. * fix(rust/c509-certificate): Build js/wasm interop versions of c509 library, and export them. * fix: c509 file name (#13) * fix: move new c509 from cat-voice * fix: revert file * fix: revert file * fix: revert file * fix: format * fix: typo --------- Co-authored-by: Steven Johnson <[email protected]> * fix(general): Make it required that pull requests need Scopes (to support proper auto-generation of changelogs). * fix(rust): Bump rust cat-ci version to release v3.2.00 * fix(rust): Make Cargo.toml more uniform, and refer to the about-to-be tagged version of the repo * fix(rust/cardano-chain-follower): Give the chain follower crate an explicit version. --------- Co-authored-by: bkioshn <[email protected]>
1 parent e8cd7c3 commit e835e1c

File tree

162 files changed

+381
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+381
-1068
lines changed

.config/dictionaries/project.dic

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aarch
2-
abnf
32
ABNF
3+
abnf
44
addrr
55
adminer
66
anypolicy
@@ -21,13 +21,13 @@ bootstrapper
2121
BROTLI
2222
cantopen
2323
cardano
24-
cbor
2524
CBOR
25+
cbor
2626
cbork
2727
cdylib
2828
CEST
29-
chaincode
3029
CHAINCODE
30+
chaincode
3131
chainsync
3232
childs
3333
Chotivichit
@@ -50,18 +50,18 @@ DBSTATUS
5050
dbsync
5151
dcbor
5252
delegators
53-
Dominik
5453
dockerhub
54+
Dominik
5555
dotenv
5656
dotenvy
5757
dotglob
5858
drep
5959
dreps
60-
earthfile
6160
Earthfile
61+
earthfile
6262
encryptor
63-
Eternl
6463
Errno
64+
Eternl
6565
excalidraw
6666
fadvise
6767
fcntl
@@ -119,10 +119,10 @@ localizable
119119
lookaside
120120
maindbname
121121
mapref
122-
Metadatum
123-
metadatum
124122
mdlint
125123
mdns
124+
Metadatum
125+
metadatum
126126
minicbor
127127
miniprotocol
128128
miniprotocols
@@ -181,8 +181,8 @@ reqwest
181181
retriggering
182182
rlib
183183
rulelist
184-
rulename
185184
RULENAME
185+
rulename
186186
runable
187187
rustc
188188
rustdoc
@@ -211,8 +211,8 @@ tacho
211211
testcase
212212
testcov
213213
testdocs
214-
testunit
215214
testplan
215+
testunit
216216
thiserror
217217
timelike
218218
timespec
@@ -228,16 +228,16 @@ unixfs
228228
unlinkat
229229
upnp
230230
userid
231-
UTXO
232231
utimensat
232+
UTXO
233233
vitss
234234
Vkey
235235
vkey
236236
vkeywitness
237237
voteplan
238238
voteplans
239-
wasi
240239
WASI
240+
wasi
241241
wasip
242242
wasip
243243
wasip
@@ -247,7 +247,7 @@ webassembly
247247
webpki
248248
WORKDIR
249249
xprivate
250-
xprv
251250
XPRV
251+
xprv
252252
xpub
253-
yoroi
253+
yoroi

.github/workflows/semantic_pull_request.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
name: Validate PR title
1414
uses: input-output-hk/catalyst-ci/.github/workflows/semantic_pull_request.yml@master
1515
with:
16+
requireScope: true
1617
scopes: |
1718
rust
1819
rust/c509-certificate

Earthfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.1.24 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.1.24 AS cspell-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.00 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.00 AS cspell-ci
55

66
FROM debian:stable-slim
77

@@ -15,6 +15,14 @@ markdown-check-fix:
1515

1616
DO mdlint-ci+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix
1717

18+
# Make sure the project dictionary is properly sorted.
19+
clean-spelling-list:
20+
COPY .config/dictionaries/project.dic project.dic
21+
RUN sort -d -f project.dic > new.dic
22+
IF ! diff -q project.dic new.dic
23+
SAVE ARTIFACT new.dic AS LOCAL .config/dictionaries/project.dic
24+
END
25+
1826
# check-spelling : Check spelling in this repo inside a container.
1927
check-spelling:
2028
DO cspell-ci+CHECK

Justfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# use with https://github.com/casey/just
2+
#
3+
# Developer convenience functions
4+
5+
default:
6+
@just --list --unsorted
7+
8+
# Fix and Check Markdown files
9+
check-markdown:
10+
earthly +markdown-check-fix
11+
12+
# Check Spelling
13+
check-spelling:
14+
earthly +clean-spelling-list
15+
earthly +check-spelling
16+
17+
18+
# Pre Push Checks - intended to be run by a git pre-push hook.
19+
pre-push: check-markdown check-spelling
20+
just rust/pre-push

docs/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.1.21 AS docs-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.00 AS docs-ci
44

55
IMPORT .. AS repo
66

git_hooks/Readme.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sample .git hooks
2+
3+
This directory contains sample git-hooks which can be used to improve the workflow of a developer.
4+
5+
Simply copy these to your .git/hooks folder and make them executable.
6+
7+
They can further be customized by editing them to suit your needs.

git_hooks/pre-push

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
# An example hook script to verify what is about to be pushed. Called by "git
4+
# push" after it has checked the remote status, but before anything has been
5+
# pushed. If this script exits with a non-zero status nothing will be pushed.
6+
#
7+
# This hook is called with the following parameters:
8+
#
9+
# $1 -- Name of the remote to which the push is being done
10+
# $2 -- URL to which the push is being done
11+
#
12+
# If pushing without using a named remote those arguments will be equal.
13+
#
14+
# Information about the commits which are being pushed is supplied as lines to
15+
# the standard input in the form:
16+
#
17+
# <local ref> <local oid> <remote ref> <remote oid>
18+
#
19+
# This Shows how we run basic checks which will fail in CI to speed up development and
20+
# catch things which will fail immediately sooner.
21+
22+
remote="$1"
23+
url="$2"
24+
25+
# Redirect output to stderr.
26+
exec 1>&2
27+
28+
# Check for Noisy CI Issues before Pushing
29+
if ! just pre-push; then
30+
echo >&2 "Found CI Issues, not pushing"
31+
exit 1
32+
fi
33+
34+
exit 0

rust/Cargo.toml

+8-59
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
[workspace]
22
resolver = "2"
3-
members = ["c509-certificate", "cardano-chain-follower", "hermes-ipfs"]
3+
members = [
4+
"c509-certificate",
5+
"cardano-chain-follower",
6+
"hermes-ipfs",
7+
"cbork",
8+
"cbork-abnf-parser",
9+
"cbork-cddl-parser",
10+
]
411

512
[workspace.package]
613
edition = "2021"
7-
version = "0.0.1"
814
authors = ["Steven Johnson <[email protected]>"]
915
homepage = "https://github.com/input-output-hk/catalyst-libs"
1016
repository = "https://github.com/input-output-hk/catalyst-libs"
@@ -45,60 +51,3 @@ string_slice = "deny"
4551
unchecked_duration_subtraction = "deny"
4652
unreachable = "deny"
4753
missing_docs_in_private_items = "deny"
48-
49-
[workspace.dependencies]
50-
pallas = { git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "709acb19c52c6b789279ecc4bc8793b5d8b5abe9", version = "0.25.0" }
51-
pallas-hardano = { git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "709acb19c52c6b789279ecc4bc8793b5d8b5abe9", version = "0.25.0" }
52-
53-
wasmtime = "20.0.2"
54-
rusty_ulid = "2.0.0"
55-
anyhow = "1.0.71"
56-
hex-literal = "0.4.1"
57-
thiserror = "1.0.56"
58-
hex = "0.4.3"
59-
tracing = "0.1.40"
60-
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
61-
criterion = "0.5.1"
62-
libtest-mimic = "0.7.0"
63-
crossbeam-queue = "0.3.11"
64-
bip39 = "2.0.0"
65-
iana-time-zone = "0.1.60"
66-
rand = "0.8.5"
67-
bip32 = "0.5.1"
68-
ed25519-bip32 = "0.4.1"
69-
dashmap = "6.0.1"
70-
once_cell = "1.19.0"
71-
clap = "4.5.3"
72-
build-info = "0.0.37"
73-
build-info-build = "0.0.37"
74-
derive_more = "0.99.17"
75-
chrono = "0.4.35"
76-
chrono-tz = "0.9.0"
77-
saffron = "0.1.0"
78-
tokio = "1.36.0"
79-
libsqlite3-sys = "0.29.0"
80-
stringzilla = "3.8.4"
81-
serial_test = { version = "3.1.1", features = ["file_locks"] }
82-
temp-dir = "0.1.13"
83-
hdf5 = { git = "https://github.com/aldanor/hdf5-rust.git", rev = "694e900972fbf5ffbdd1a2294f57a2cc3a91c994", version = "0.8.1", features = [
84-
"static",
85-
"blosc",
86-
] }
87-
blosc-src = { version = "0.3.0", features = ["lz4", "zlib", "zstd"] }
88-
num_cpus = "1.16.0"
89-
console = "0.15.8"
90-
serde = "1.0"
91-
serde_json = "1.0"
92-
jsonschema = "0.18.0"
93-
hmac = "0.12.1"
94-
pbkdf2 = "0.12.2"
95-
blake2b_simd = "1.0.2"
96-
sha2 = "0.10"
97-
ed25519-dalek = "2.1.1"
98-
x509-cert = "0.2.5"
99-
coset = "0.3.7"
100-
libipld = "0.16.0"
101-
rust-ipfs = "0.11.21"
102-
rustyline-async = "0.4.2"
103-
dirs = "5.0.1"
104-
lipsum = "0.9.1"

rust/Earthfile

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.21 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.00 AS rust-ci
4+
5+
# Use when debugging cat-ci locally.
6+
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci
47

58
# builder : Set up our target toolchains, and copy our files.
69
builder:
710
DO rust-ci+SETUP
811

912
COPY Cargo.toml clippy.toml deny.toml rustfmt.toml .
10-
COPY --dir .cargo .config c509-certificate cardano-chain-follower cbork hermes-ipfs .
13+
COPY --dir .cargo .config c509-certificate cardano-chain-follower \
14+
cbork cbork-abnf-parser cbork-cddl-parser \
15+
hermes-ipfs .
1116

1217
# check : Run basic check.
1318
check:
@@ -21,11 +26,18 @@ build:
2126

2227
DO rust-ci+EXECUTE \
2328
--cmd="/scripts/std_build.py" \
29+
--output="release/[^\./]+" \
2430
--args1="--libs=c509-certificate" \
2531
--args2="--libs=cardano-chain-follower" \
26-
--args3="--libs=cbork" \
27-
--args4="--libs=hermes-ipfs" \
28-
--docs="false"
32+
--args3="--libs=cbork-cddl-parser" \
33+
--args4="--libs=cbork-abnf-parser" \
34+
--args5="--libs=hermes-ipfs" \
35+
--args6="--bins=cbork/cbork" \
36+
--docs="true"
37+
38+
SAVE ARTIFACT target/$TARGETARCH/doc doc
39+
SAVE ARTIFACT target/release/cbork cbork
40+
2941

3042
# local-ci-run: This step simulates the full CI run for local purposes only.
3143
local-ci-run:

rust/Justfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# use with https://github.com/casey/just
2+
#
3+
# Hermes developer convenience functions
4+
5+
# cspell: words prereqs, commitlog, rustls, nocapture
6+
7+
default:
8+
@just --list --unsorted
9+
10+
# Show the dependency tree and all enabled feature flags of every crate.
11+
cargo-tree:
12+
cargo tree -e features,normal,build -f "{p}[{f}]" --workspace --frozen
13+
14+
# Check Dependency licenses and CVE's
15+
license-check:
16+
cargo deny check --exclude-dev
17+
18+
# Format the rust code
19+
code-format:
20+
cargo +nightly fmtfix
21+
cargo +nightly fmtchk
22+
23+
# Lint the rust code
24+
code-lint:
25+
cargo lintfix
26+
cargo lint
27+
28+
# Pre Push Checks
29+
pre-push: code-format code-lint license-check

0 commit comments

Comments
 (0)