Skip to content

Commit c0ccb73

Browse files
authored
Merge branch 'main' into janewang-patch-cookbook
2 parents 185e0ba + 4198835 commit c0ccb73

51 files changed

Lines changed: 2134 additions & 2310 deletions

Some content is hidden

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

.cargo-husky/hooks/pre-commit

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22

33
set -ex
44

5-
cargo fmt --check || (cargo fmt && exit 1)
6-
make generate-full-help-doc
5+
make docs > /dev/null
6+
make fmt > /dev/null
7+
8+
set +x
9+
git diff --exit-code > /dev/null || (echo "\nERROR: Staged files were modified by hooks. Please review and stage the changes." && exit 1)

.cargo-husky/hooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ cargo clippy --all -- -Dwarnings
1010

1111
cargo build
1212
cargo test --all || (echo "might need to rebuild make build-snapshot" && exit 1)
13-
make generate-full-help-doc
13+
make docs

.github/copilot-instructions.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,27 @@
77
Stellar CLI is a Rust-based command-line tool for interacting with the Stellar network. It's organized as a Cargo workspace with multiple crates and uses both Cargo and Make for build automation.
88

99
### Bootstrap and Build
10+
1011
- Install system dependencies: `sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev build-essential`
1112
- Install Rust toolchain: `rustup update` (Rust 1.89.0+ required)
1213
- Add WebAssembly target: `rustup target add wasm32v1-none`
1314
- Build main CLI: `cargo build --bin stellar` -- takes 45 seconds. NEVER CANCEL.
1415
- Install CLI: `make install` -- takes 3 minutes with potential network timeouts. NEVER CANCEL. Set timeout to 10+ minutes.
1516

1617
### Core Development Commands
18+
1719
- Format code: `make fmt` -- takes 2 seconds
1820
- Run linting: `make check` -- takes 7 minutes. NEVER CANCEL. Set timeout to 15+ minutes.
1921
- Build main CLI only: `cargo build --bin stellar` -- takes 45 seconds. Use this for quick iterations.
2022

2123
### Testing
24+
2225
- Test main soroban-cli library: `cargo test --package soroban-cli --lib` -- takes 52 seconds. NEVER CANCEL.
2326
- Test individual crates: `cargo test --package <crate-name>` -- typically takes 40 seconds per crate.
2427
- **WARNING**: Full test suite via `make test` requires building WebAssembly test fixtures and consumes significant memory and disk space. It may fail with "No space left on device" in constrained environments.
2528

2629
### CLI Usage and Validation
30+
2731
- Test CLI installation: `stellar --version`
2832
- Basic CLI validation: `stellar --help`
2933
- Generate test keys: `stellar keys generate <name>`
@@ -39,6 +43,7 @@ Stellar CLI is a Rust-based command-line tool for interacting with the Stellar n
3943
## Common Tasks
4044

4145
### Repository Structure
46+
4247
```
4348
/home/runner/work/stellar-cli/stellar-cli/
4449
├── cmd/
@@ -55,6 +60,7 @@ Stellar CLI is a Rust-based command-line tool for interacting with the Stellar n
5560
```
5661

5762
### Key Commands Reference
63+
5864
```bash
5965
# Development workflow
6066
cargo build --bin stellar # Quick build (45s)
@@ -74,6 +80,7 @@ stellar keys address test # Test key operations
7480
```
7581

7682
### Build Time Expectations
83+
7784
- **NEVER CANCEL** any build or test command before these timeouts:
7885
- `cargo build --bin stellar`: 2 minutes timeout minimum
7986
- `make install`: 10 minutes timeout (network issues common)
@@ -82,25 +89,30 @@ stellar keys address test # Test key operations
8289
- Core library tests: 5 minutes timeout minimum
8390

8491
### Known Issues
92+
8593
- **Network timeouts**: `make install` frequently encounters network timeouts with crates.io. This is normal in CI environments.
8694
- **Memory constraints**: Full workspace build and test may fail with OOM or "No space left on device" errors in constrained environments.
87-
- **Documentation generation**: `make generate-full-help-doc` may fail due to disk space constraints.
95+
- **Documentation generation**: `make docs` may fail due to disk space constraints.
8896

8997
### Working Around Constraints
98+
9099
- Use `cargo build --bin stellar` instead of full workspace build for development
91100
- Test individual packages with `cargo test --package <name>` instead of full test suite
92101
- Use `cargo install --force --locked --path ./cmd/stellar-cli` as alternative to `make install`
93102

94103
## Critical Warnings
104+
95105
- **NEVER CANCEL builds or tests** before the specified timeout periods
96106
- **Always validate changes** by building and testing the CLI before committing
97107
- **Network issues are common** - retry `make install` if it fails with timeouts
98108
- **Use surgical builds** when possible to avoid memory/disk issues
99109

100110
## CI/CD Integration
111+
101112
The project uses GitHub Actions with workflows in `.github/workflows/`:
113+
102114
- `rust.yml`: Main CI pipeline with formatting, linting, building, and testing
103115
- `e2e.yml`: End-to-end system tests
104116
- `binaries.yml`: Multi-platform binary builds
105117

106-
Always run `make fmt` and `make check` locally before pushing to ensure CI passes.
118+
Always run `make fmt` and `make check` locally before pushing to ensure CI passes.

.github/workflows/binaries.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@ jobs:
111111
name: ${{ env.ARTIFACT_NAME }}
112112
- name: Uncompress Artifact
113113
run: tar xvf ${{ env.ARTIFACT_NAME }}
114+
- shell: powershell
115+
run: winget install --id JRSoftware.InnoSetup --scope machine --silent --accept-package-agreements --accept-source-agreements
116+
- shell: powershell
117+
run: |
118+
$innoPath = "C:\Program Files (x86)\Inno Setup 6"
119+
echo $innoPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
114120
- name: Build Installer
115121
shell: powershell
116122
run: |
117-
$Env:Path += ";C:\Users\$Env:UserName\AppData\Local\Programs\Inno Setup 6"
118123
$Env:STELLAR_CLI_VERSION = "${{ env.VERSION }}"
119124
ISCC.exe installer.iss
120125
mv Output/stellar-installer.exe ${{ env.STELLAR_CLI_INSTALLER }}

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
pull_request:
77

88
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
9+
group:
10+
${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
1011
cancel-in-progress: true
1112

1213
jobs:

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
if: github.event_name != 'push'
4040
uses: stellar/system-test/.github/workflows/test.yml@master
4141
with:
42-
js-stellar-sdk-npm-version: v14.0.0-rc.3
42+
js-stellar-sdk-npm-version: v14.2.0
4343
stellar-cli-ref: ${{ github.ref }}
4444
test-filter: "^TestDappDevelop$/^.*$"
4545
runner: "ubuntu-latest"

.github/workflows/rust.yml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ jobs:
3131
if: always()
3232
needs:
3333
[
34-
fmt,
3534
cargo-deny,
36-
check-generated-full-help-docs,
35+
check,
3736
build-and-test,
3837
build-and-test-macos,
3938
build-and-test-windows,
@@ -42,18 +41,9 @@ jobs:
4241
]
4342
runs-on: ubuntu-latest
4443
steps:
45-
- if:
46-
contains(needs.*.result, 'failure') || contains(needs.*.result,
47-
'cancelled')
44+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
4845
run: exit 1
4946

50-
fmt:
51-
runs-on: ubuntu-latest-8-cores
52-
steps:
53-
- uses: actions/checkout@v5
54-
- run: rustup update
55-
- run: cargo fmt --all --check
56-
5747
cargo-deny:
5848
runs-on: ubuntu-latest
5949
strategy:
@@ -67,15 +57,15 @@ jobs:
6757
with:
6858
command: check ${{ matrix.check }}
6959

70-
check-generated-full-help-docs:
60+
check:
7161
runs-on: ubuntu-latest-8-cores
7262
steps:
7363
- uses: actions/checkout@v5
7464
- uses: stellar/actions/rust-cache@main
75-
- run: rustup update
7665
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
77-
- run: make generate-full-help-doc
78-
- run: git add -N . && git diff HEAD --exit-code
66+
- run: rustup update
67+
- run: npm install
68+
- run: make check
7969

8070
build-and-test:
8171
strategy:
@@ -96,9 +86,7 @@ jobs:
9686
rust-version: ${{ matrix.rust }}
9787

9888
build-and-test-macos:
99-
if:
100-
github.ref == 'refs/heads/main' || startsWith(github.ref,
101-
'refs/heads/release/') || startsWith(github.head_ref, 'release/')
89+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
10290
strategy:
10391
fail-fast: false
10492
matrix:
@@ -117,9 +105,7 @@ jobs:
117105
rust-version: ${{ matrix.rust }}
118106

119107
build-and-test-windows:
120-
if:
121-
github.ref == 'refs/heads/main' || startsWith(github.ref,
122-
'refs/heads/release/') || startsWith(github.head_ref, 'release/')
108+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
123109
strategy:
124110
fail-fast: false
125111
matrix:
@@ -161,23 +147,20 @@ jobs:
161147
- os: ubuntu-latest-8-cores
162148
target: x86_64-unknown-linux-gnu
163149
cargo-hack-feature-options:
164-
--feature-powerset --skip emulator-tests --group-features default
165-
--ignore-unknown-features
150+
--feature-powerset --skip emulator-tests
166151
additional-deb-packages: libudev-dev libdbus-1-dev
167152
# - os: ubuntu-jammy-8-cores-arm64
168153
# target: aarch64-unknown-linux-gnu
169-
# cargo-hack-feature-options: --feature-powerset --skip emulator-tests --group-features default --ignore-unknown-features
154+
# cargo-hack-feature-options: --feature-powerset --skip emulator-tests default
170155
# additional-deb-packages: libudev-dev libssl-dev libdbus-1-dev
171156
- os: macos-13
172157
target: x86_64-apple-darwin
173158
cargo-hack-feature-options:
174-
--feature-powerset --skip emulator-tests --group-features default
175-
--ignore-unknown-features
159+
--feature-powerset --skip emulator-tests
176160
- os: macos-latest
177161
target: aarch64-apple-darwin
178162
cargo-hack-feature-options:
179-
--feature-powerset --skip emulator-tests --group-features default
180-
--ignore-unknown-features
163+
--feature-powerset --skip emulator-tests
181164
# Windows builds notes:
182165
#
183166
# The different features that need testing are split over unique

0 commit comments

Comments
 (0)