Skip to content

Commit f527fc9

Browse files
name user-defined types by their module path
1 parent 698e23b commit f527fc9

82 files changed

Lines changed: 6402 additions & 1414 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/workflows/*.lock.yml linguist-generated=true merge=ours

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@
99
### Known limitations
1010

1111
[TODO or N/A]
12+
13+
### SemVer Change
14+
15+
[TODO: Check one. Merge only when confirmed that the main branch is accepting changes for the matching type of release. See the [semver-rules.md](./semver-rules.md).
16+
17+
- [ ] Major (vX._._) - Breaking change to the public API.
18+
- [ ] Minor (v_.Y._) - Additive change to the public API.
19+
- [ ] Patch (v_._.Z) - No change to the public API.

.github/semver-rules.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SemVer classification rules
2+
3+
How to classify a change to the crates published from this repository, based on
4+
the [Cargo SemVer Compatibility reference](https://doc.rust-lang.org/cargo/reference/semver.html).
5+
6+
A change is classified by the highest category any part of it falls into. If any
7+
single change is major, the whole change is major.
8+
9+
## Major (vX._._) — breaking change to the public API
10+
11+
- [Removing, renaming, or moving public items](https://doc.rust-lang.org/cargo/reference/semver.html#item-remove).
12+
- [Changing a trait's item signatures](https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature), or [adding a non-defaulted trait item](https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default).
13+
- [Adding a field, public or private, to a struct whose fields are all public](https://doc.rust-lang.org/cargo/reference/semver.html#struct-add-public-field-when-no-private) and that isn't `non_exhaustive`. Once the struct has one private field, [adding more is minor](https://doc.rust-lang.org/cargo/reference/semver.html#struct-private-fields-with-private).
14+
- [Adding an enum variant](https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new) to an enum that isn't `non_exhaustive`.
15+
- [Adding `non_exhaustive`](https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive).
16+
- [Tightening generic bounds](https://doc.rust-lang.org/cargo/reference/semver.html#generic-bounds-tighten).
17+
- [Changing function arity](https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity).
18+
- [Changing the alignment, layout, or size of a type that was previously well-defined](https://doc.rust-lang.org/cargo/reference/semver.html#type-layout): removing `repr(C)`, `repr(transparent)`, or an enum's `repr(<int>)`, or adding or changing `repr(packed)` or `repr(align)`. A type with the default representation guarantees no layout, so its size changing is not on its own major.
19+
- [Requiring `std` where `no_std` worked](https://doc.rust-lang.org/cargo/reference/semver.html#attr-no-std-to-std).
20+
- [Removing a Cargo feature](https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove).
21+
22+
## Minor (v_.Y._) — additive change to the public API
23+
24+
- [Adding new public items](https://doc.rust-lang.org/cargo/reference/semver.html#item-new).
25+
- [Adding defaulted type parameters](https://doc.rust-lang.org/cargo/reference/semver.html#generic-new-default) or [defaulted trait parameters](https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-default).
26+
- [Loosening generic bounds](https://doc.rust-lang.org/cargo/reference/semver.html#generic-bounds-loosen) or [generalizing to more generic types](https://doc.rust-lang.org/cargo/reference/semver.html#generic-more-generic).
27+
- [Making an `unsafe` function safe](https://doc.rust-lang.org/cargo/reference/semver.html#fn-unsafe-safe).
28+
- [Adding private struct fields when one already exists](https://doc.rust-lang.org/cargo/reference/semver.html#struct-private-fields-with-private).
29+
- [Adding a Cargo feature](https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-add) or [dependency](https://doc.rust-lang.org/cargo/reference/semver.html#cargo-dep-add).
30+
- The [possibly-breaking changes](https://doc.rust-lang.org/cargo/reference/semver.html#possibly-breaking-changes), such as [raising the minimum supported Rust version](https://doc.rust-lang.org/cargo/reference/semver.html#env-new-rust), [adding a defaulted trait item](https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item), or [adding inherent items](https://doc.rust-lang.org/cargo/reference/semver.html#impl-item-new).
31+
32+
## Patch (v_._.Z) — no change to the public API
33+
34+
- Bug fixes that preserve documented behavior.
35+
- Performance improvements.
36+
- Internal refactors and private item changes.
37+
- Documentation, example, test, or CI changes.
38+
- Dependency patch bumps.
39+
40+
## Applying the rules to this repository
41+
42+
The crates in the top level directories are published and are the ones being
43+
classified. The crates under `tests/` are test vectors and are not published.
44+
45+
The public API of the SDK includes the code that the macros in
46+
`soroban-sdk-macros` generate. A change to what `#[contract]`,
47+
`#[contractimpl]`, `#[contracttype]`, or the other macros emit can break
48+
contracts that build against the SDK, or change the contract spec and events a
49+
built contract exposes, even when no Rust item in the SDK itself changes.
50+
`tests-expanded/` holds the generated code for the test vectors, so a diff there
51+
is evidence that the generated API changed, and it is classified by what the
52+
change does to a contract that uses it.
53+
54+
Changes confined to `tests/`, `.github/`, the `Makefile`, or the repository's
55+
documentation are patch.

.github/workflows/rust.yml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
complete:
2424
if: always()
25-
needs: [fmt, check-git-rev-deps, semver-checks, build, test, expand-test-wasms, build-fuzz, docs, readme, migration-docs]
25+
needs: [fmt, check-git-rev-deps, build, test, expand-test-wasms, build-fuzz, docs, readme, migration-docs]
2626
runs-on: ubuntu-slim
2727
steps:
2828
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
@@ -96,41 +96,6 @@ jobs:
9696
- uses: actions/checkout@v3
9797
- uses: stellar/actions/rust-check-git-rev-deps@main
9898

99-
semver-checks:
100-
# Push and merge queue events do not include PR labels, so only check pull request events.
101-
if: "github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip-semver-checks')"
102-
runs-on: ubuntu-latest
103-
steps:
104-
- uses: actions/checkout@v3
105-
- run: rustup update stable
106-
- name: Determine Rust n-2 version since cargo-semver-checks is rarely available for the latest version
107-
id: rust-version
108-
run: |
109-
current_version=$(rustc +stable --version | grep -oE '[0-9]+\.[0-9]+' | head -1)
110-
major=$(echo $current_version | cut -d. -f1)
111-
minor=$(echo $current_version | cut -d. -f2)
112-
prev_minor=$((minor - 2))
113-
prev_version="${major}.${prev_minor}"
114-
echo "Latest stable: $current_version, using n-2: $prev_version"
115-
echo "version=$prev_version" >> $GITHUB_OUTPUT
116-
- name: Install Rust ${{ steps.rust-version.outputs.version }}
117-
run: |
118-
rustup install ${{ steps.rust-version.outputs.version }}
119-
rustup override set ${{ steps.rust-version.outputs.version }}
120-
- name: Verify Rust version
121-
run: |
122-
rustc --version
123-
cargo --version
124-
- uses: stellar/binaries@v55
125-
with:
126-
name: cargo-semver-checks
127-
version: 0.46.0
128-
- run: >
129-
cargo semver-checks
130-
--exclude soroban-meta
131-
--exclude soroban-token-spec
132-
--exclude stellar-asset-spec
133-
13499
build:
135100
needs: setup
136101
strategy:

0 commit comments

Comments
 (0)