Skip to content

Commit f27589f

Browse files
committed
feat: initial public release of goz
0 parents  commit f27589f

74 files changed

Lines changed: 19710 additions & 0 deletions

Some content is hidden

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

.cargo/config.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Static CRT so a shipped gozd.exe/goz.exe does not need vcruntime140.dll on the
2+
# target machine. gozd runs as a Windows service, where a missing DLL surfaces
3+
# as an opaque SCM start failure rather than a useful error.
4+
#
5+
# CAVEAT: cargo takes rustflags from the FIRST matching source only, and the
6+
# RUSTFLAGS env var outranks these target entries. Any job that exports RUSTFLAGS
7+
# (CI does, for `-D warnings`) silently builds WITHOUT crt-static. That is
8+
# harmless today because CI ships no binaries; a future release job must either
9+
# leave RUSTFLAGS unset or carry `-C target-feature=+crt-static` itself.
10+
[target.'cfg(all(target_family = "windows", target_env = "msvc"))']
11+
rustflags = ["-C", "target-feature=+crt-static"]

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Normalize line endings: store everything as LF in the repo, so a checkout on
2+
# any OS is consistent and diffs never churn on CRLF/LF alone. Git still checks
3+
# out with native endings on Windows working copies.
4+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
# A new advisory against a static lockfile arrives without anyone pushing, and
8+
# `dtolnay/rust-toolchain@stable` moves under us between releases. Note GitHub
9+
# disables cron on a repo with 60 days of no activity (it emails first), so
10+
# this buys bounded, not unbounded, coverage.
11+
schedule:
12+
- cron: "0 6 * * 1"
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
RUSTFLAGS: -D warnings
17+
18+
jobs:
19+
test:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest]
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
components: rustfmt, clippy
30+
- uses: Swatinem/rust-cache@v2
31+
32+
- name: Format
33+
run: cargo fmt --all --check
34+
35+
- name: Clippy
36+
run: cargo clippy --workspace --all-targets
37+
38+
# The ubuntu leg is the load-bearing half of the purity contract: goz-core
39+
# is 9.8k of the workspace's 14.3k lines and green here means none of it
40+
# *calls* a Windows API. (Only *calls*: an unused platform dep would still
41+
# link. The declared-dep half is the allowlist below.)
42+
- name: Test
43+
run: cargo test --workspace
44+
45+
# The architecture doc comments in lib.rs are the design record, and
46+
# RUSTFLAGS above does not reach rustdoc, so their intra-doc links rot
47+
# unchecked. --document-private-items because these are internal docs.
48+
- name: Docs
49+
env:
50+
RUSTDOCFLAGS: -D warnings
51+
run: cargo doc --workspace --no-deps --document-private-items
52+
53+
# goz-core's direct deps are a closed set, so assert the set itself: an
54+
# allowlist fails on anything unforeseen, where the denylist this replaces
55+
# named four crates and would have waved through `windows`, `winapi`,
56+
# `libc` and `nix`. `--target all` so the ubuntu leg still sees a
57+
# cfg(windows)-gated entry; `set -euo pipefail` so a cargo failure fails
58+
# the step rather than matching nothing and passing.
59+
#
60+
# The other direction (goz-winfs must not depend on goz-core) is a
61+
# `wrappers` ban in deny.toml, enforced by the `deny` job below.
62+
- name: "goz-core purity: direct deps are the allowed set"
63+
shell: bash
64+
run: |
65+
set -euo pipefail
66+
expected="hashbrown memchr rayon rustc-hash serde serde_json smallvec thiserror unicode-normalization zerocopy"
67+
actual="$(cargo tree -p goz-core --edges normal --target all --depth 1 --prefix none \
68+
| awk 'NF && $1 != "goz-core" { print $1 }' \
69+
| sort -u | tr '\n' ' ' | sed 's/ $//')"
70+
if [ "$actual" != "$expected" ]; then
71+
echo "::error::goz-core direct dependencies changed; keep goz-core pure or update this allowlist deliberately"
72+
echo "expected: $expected"
73+
echo "actual: $actual"
74+
exit 1
75+
fi
76+
77+
# MSRV gate: `rust-version` in Cargo.toml is a promise, so pin exactly that
78+
# toolchain and build. The main `test` job floats on stable, which would let
79+
# the real minimum drift above the advertised one unnoticed. `cargo check`
80+
# (not test) because dev-dependencies need not honor the MSRV.
81+
msrv:
82+
runs-on: windows-latest
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: dtolnay/rust-toolchain@1.94.0
86+
- uses: Swatinem/rust-cache@v2
87+
- run: cargo check --workspace
88+
89+
# Supply-chain gate: enforce the deny.toml policy (licenses, yanked crates,
90+
# advisories, unknown sources). cargo-deny is graph-wide and deny.toml has no
91+
# [targets] filter, so ubuntu covers the Windows-gated deps too.
92+
deny:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: EmbarkStudios/cargo-deny-action@v2
97+
with:
98+
command: check advisories bans licenses sources

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
# Fires only when a version tag is pushed (e.g. `git tag v0.1.1 && git push
4+
# --tags`). Its one job is a guard: the tag must match the version in
5+
# Cargo.toml, so a release can never ship with a mismatched number.
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
11+
jobs:
12+
version-guard:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
# Compare the pushed tag (minus its leading `v`) against the workspace
18+
# version in Cargo.toml. Fail loudly on any mismatch so the fix is to
19+
# bump Cargo.toml (or retag), never to ship the two out of sync.
20+
- name: Tag matches Cargo.toml version
21+
shell: bash
22+
run: |
23+
set -euo pipefail
24+
tag="${GITHUB_REF_NAME#v}"
25+
manifest="$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/')"
26+
echo "tag: $tag"
27+
echo "manifest: $manifest"
28+
if [ "$tag" != "$manifest" ]; then
29+
echo "::error::git tag v$tag does not match Cargo.toml version $manifest; bump Cargo.toml or retag"
30+
exit 1
31+
fi

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
**/*.rs.bk
3+
*.pdb
4+
/proptest-regressions-tmp

0 commit comments

Comments
 (0)