mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-11 17:19:31 -10:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8213de26b | ||
|
|
e48ac4159f | ||
|
|
bc8e4f3188 | ||
|
|
043ac0d8d9 | ||
|
|
219a8f22b0 | ||
|
|
d1049cff8d | ||
|
|
868acf52a0 | ||
|
|
b97ee11dfb | ||
|
|
3c44b85f13 |
No files matched your search
@@ -121,7 +121,7 @@ jobs:
|
||||
cargo +stable fmt --all -- --check
|
||||
cargo +stable clippy --workspace --all-targets -- -D warnings
|
||||
# The server build (released as horizon-engine): the game without sound or controllers.
|
||||
cargo +stable clippy -p horizon-client --all-targets --no-default-features -- -D warnings
|
||||
cargo +stable clippy -p horizon-client -p horizon-game --all-targets --no-default-features -- -D warnings
|
||||
# Libraries, binaries and integration tests, then doc tests: not the ~275 examples, which clippy above already
|
||||
# type-checks and the parity job builds and runs (they were most of this step's build and link time).
|
||||
# cargo test, not nextest: nextest's process per test reloads each binary's shared tables for every test, and on
|
||||
|
||||
@@ -336,7 +336,7 @@ jobs:
|
||||
set -euo pipefail
|
||||
# After the client is packaged: target/release/horizon-client is rebuilt without the audio and
|
||||
# controllers features, so it needs neither libasound nor libudev (minimal server images lack them).
|
||||
cargo build --release --locked -p horizon-client --no-default-features --bin horizon-client
|
||||
cargo build --release --locked -p horizon-game --no-default-features --bin horizon-client
|
||||
cargo run --locked -p xtask -- package-server target/release/horizon-client "dist/${{ matrix.server_dir }}"
|
||||
folder="dist/${{ matrix.server_dir }}"
|
||||
python3 tools/check_imports.py --server "$folder/horizon-engine" "$folder/horizon-server" "$folder/horizon-prepare"
|
||||
|
||||
@@ -53,7 +53,7 @@ Game workspace (root `Cargo.toml`); `launcher/` and `crates/horizon-telemetry-se
|
||||
|
||||
| Crate | Owns |
|
||||
|---|---|
|
||||
| `horizon-client` | Gameplay library (`src/lib.rs`: `game.rs` + `game/`, `entry.rs`) and thin executable (`src/main.rs`). Also the dedicated server (`--dedicated`). Re-exports `horizon-client-lib` for existing mod paths. |
|
||||
| `horizon-client` | Gameplay library (`src/lib.rs`: `game.rs` + `game/`, `entry.rs`), also the dedicated server (`--dedicated`); `horizon-game` builds its executable. Re-exports `horizon-client-lib` for existing mod paths. |
|
||||
| `horizon-client-lib` | Reusable client systems, `horizon-ctl`, probes and their tests. Its manifest points to the existing sources under `crates/horizon-client/`; the library root is `src/client_lib.rs`. It never depends on gameplay. |
|
||||
| `horizon-items` | Blocks and items below gameplay: `blocks.rs` (block facts), `items.rs`, `item_data.rs` (components), `enchant.rs`, `cooldowns.rs`, `bundle.rs`, `item_nbt.rs`. Re-exported as `horizon_client::items`... |
|
||||
| `horizon-command` | Command parsing (Brigadier): the vanilla tree, argument types, selectors, suggestions, the tree's network form. Re-exported as `horizon_client::command` |
|
||||
@@ -107,7 +107,7 @@ python3 tools/pr_ready.py # the self-check: fmt, clippy -D warn
|
||||
python3 tools/pr_ready.py --quick # same without harnesses
|
||||
cargo test -p horizon-client -p horizon-client-lib --lib --bins --tests # skips the examples (pr_ready does this); `--doc` separately
|
||||
cargo test -p horizon-client-lib --lib mod_content::tests:: -- --ignored # the slow content-root tests, #[ignore]d; pr_ready runs them when mod content, assets, blocks or items change
|
||||
cargo build --profile fast -p horizon-client # optimized, quick to link: use it to play or run lan_e2e
|
||||
cargo build --profile fast -p horizon-game # the game (bin horizon-client), optimized, quick to link: to play or run lan_e2e
|
||||
python3 tools/parity.py --changed origin/main # the harnesses your branch can affect (CI's parity job)
|
||||
python3 tools/parity.py --changed-files paths.txt --list # which harnesses cover these files, without running them
|
||||
python3 tools/parity.py mob_ai sculk # named harnesses
|
||||
@@ -159,9 +159,8 @@ python3 tools/lang_coverage.py --summary # the keys each language still misses
|
||||
`L:` = lib (`crates/horizon-client/src/`, or `crates/horizon-client-render/src/` for the modules that crate holds, under
|
||||
the same `horizon_client::<module>` paths), `G:` = gameplay (`crates/horizon-client/src/game/`), also in the lib in normal builds.
|
||||
Gameplay keeps its `horizon_client::<module>` imports through a self-crate alias. The executable
|
||||
contains only the allocator, mod API marker and a call to `entry::main`. For unit tests, the lib
|
||||
excludes `entry` and `game`, and the executable test target owns `game` so its process-wide test
|
||||
state stays separate from the library tests. This compiles gameplay twice for executable tests.
|
||||
(`crates/horizon-game/src/main.rs`) contains only the allocator, mod API marker and a call to
|
||||
`horizon_game::main()`, which runs `entry::main` with the platform's parts registered.
|
||||
|
||||
| Subsystem | Files |
|
||||
|---|---|
|
||||
@@ -218,7 +217,7 @@ Single player, LAN guests and dedicated servers all run the server code, so a fi
|
||||
Test the server thread when you touch player-facing gameplay:
|
||||
|
||||
```sh
|
||||
cargo run --profile fast -p horizon-client -- --resources .local/horizon-client/26.3 --world T # server thread
|
||||
cargo run --profile fast -p horizon-game -- --resources .local/horizon-client/26.3 --world T # server thread
|
||||
python3 tools/lan_e2e.py --check <name> # host on its server thread, guest is a server client
|
||||
python3 tools/parity.py dedicated_server server_entities server_player_damage
|
||||
```
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ here.
|
||||
|
||||
```sh
|
||||
cargo run --release -p horizon-prepare -- --prepare --server-jar ~/Downloads/server.jar
|
||||
cargo run --release -p horizon-client
|
||||
cargo run --release -p horizon-game
|
||||
```
|
||||
|
||||
- **Launcher:** its own Cargo workspace in `launcher/` (`cd launcher && cargo run`; on NixOS, `nix-shell` first).
|
||||
|
||||
Generated
+3
@@ -1690,8 +1690,11 @@ name = "horizon-game"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"horizon-client",
|
||||
"horizon-core",
|
||||
"horizon-mods",
|
||||
"horizon-threads",
|
||||
"serde_json",
|
||||
"winresource",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -119,7 +119,7 @@ git clone https://github.com/horizon-rust/horizon.git
|
||||
cd horizon
|
||||
cargo run --release -p horizon-prepare -- --prepare --server-jar ~/Downloads/server.jar # needs JDK 25
|
||||
cargo run --release -p horizon-prepare -- sounds # optional: sounds from your launcher install
|
||||
cargo run --release -p horizon-client
|
||||
cargo run --release -p horizon-game
|
||||
```
|
||||
|
||||
Prepared files land in the gitignored `.local/`: never commit or share them. Options, controls and architecture: [the native client guide](docs/native-client.md); all developer docs: [docs/README.md](docs/README.md).
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[package]
|
||||
name = "horizon-client"
|
||||
default-run = "horizon-client"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
@@ -140,18 +139,10 @@ windows-mimalloc = []
|
||||
# Opt-in Windows heap experiment; see docs/windows-allocators.md.
|
||||
windows-segment-heap = []
|
||||
|
||||
[[bin]]
|
||||
name = "horizon-client"
|
||||
path = "src/main.rs"
|
||||
|
||||
[[test]]
|
||||
name = "datapack_biome_sync"
|
||||
path = "tests/datapack_biome_sync.rs"
|
||||
|
||||
[[test]]
|
||||
name = "launch_api"
|
||||
path = "tests/launch_api.rs"
|
||||
|
||||
[[test]]
|
||||
name = "mod_api_hooks"
|
||||
path = "tests/mod_api_hooks.rs"
|
||||
@@ -166,7 +157,8 @@ path = "examples/wind_burst_hook_probe.rs"
|
||||
|
||||
[build-dependencies]
|
||||
horizon-mod-api-gen = { path = "../horizon-mod-api-gen" }
|
||||
# The build script runs on the host, but embeds resources based on the target OS.
|
||||
# The build script runs on the host, but embeds resources based on the target OS (for the
|
||||
# launcher's native-mod game package, which uses this build script).
|
||||
winresource = "0.1"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//! Generates the native mod API, and gives the Windows executable Horizon's icon and its stack
|
||||
//! (`packaging/windows/exe.rs`, shared with the official executable's build script).
|
||||
//! Generates the native mod API. The launcher's native-mod game package (`horizon-native-game`,
|
||||
//! which owns the `horizon-client` executable of a build with native mods) runs this build script
|
||||
//! too: there it also gives the Windows executable Horizon's icon and its stack
|
||||
//! (`packaging/windows/exe.rs`). horizon-client itself has no executable (horizon-game's).
|
||||
#[path = "../../packaging/windows/exe.rs"]
|
||||
mod windows_exe;
|
||||
|
||||
@@ -21,5 +23,7 @@ fn main() {
|
||||
if !staged.is_empty() {
|
||||
println!("cargo:rustc-env=HORIZON_MIXIN_MODS={}", staged.join(","));
|
||||
}
|
||||
windows_exe::resources("horizon-client");
|
||||
if std::env::var("CARGO_PKG_NAME").as_deref() != Ok("horizon-client") {
|
||||
windows_exe::resources("horizon-client");
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,48 @@
|
||||
[package]
|
||||
name = "horizon-game"
|
||||
default-run = "horizon-client"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
rust-version.workspace = true
|
||||
description = "The game as the platform runs it: the engine's entry with the platform's parts registered, for an executable to start (docs/layers.md)"
|
||||
description = "The game as the platform runs it: the engine's entry with the platform's parts registered, for an executable to start, and this repository's plain executable (docs/layers.md)"
|
||||
|
||||
# This repository's plain executable: the platform's game with no Horizon part (`cargo run -p
|
||||
# horizon-game`, the harnesses, horizon-ctl launch, horizon-plain, the server build). The official
|
||||
# executable is horizon-official's.
|
||||
[[bin]]
|
||||
name = "horizon-client"
|
||||
path = "src/main.rs"
|
||||
|
||||
[[test]]
|
||||
name = "launch_api"
|
||||
path = "tests/launch_api.rs"
|
||||
|
||||
[features]
|
||||
# The same features as horizon-client's, which they turn on (its Cargo.toml says what each does).
|
||||
default = ["audio", "controllers", "horizon-extras"]
|
||||
audio = ["horizon-client/audio"]
|
||||
controllers = ["horizon-client/controllers"]
|
||||
horizon-extras = ["horizon-client/horizon-extras"]
|
||||
friends = ["horizon-client/friends"]
|
||||
rng-trace = ["horizon-client/rng-trace"]
|
||||
system-allocator = ["horizon-client/system-allocator"]
|
||||
alloc-census = ["horizon-client/alloc-census", "horizon-threads/alloc-census"]
|
||||
windows-mimalloc = ["horizon-client/windows-mimalloc"]
|
||||
windows-segment-heap = ["horizon-client/windows-segment-heap"]
|
||||
|
||||
[dependencies]
|
||||
horizon-client = { path = "../horizon-client" }
|
||||
horizon-client = { path = "../horizon-client", default-features = false }
|
||||
horizon-threads = { path = "../horizon-threads" }
|
||||
horizon-mods = { path = "../horizon-mods", default-features = false, features = ["index"] }
|
||||
|
||||
[dev-dependencies]
|
||||
horizon-core = { path = "../horizon-core" }
|
||||
serde_json = "1"
|
||||
|
||||
[build-dependencies]
|
||||
# The build script runs on the host, but embeds resources based on the target OS.
|
||||
winresource = "0.1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -0,0 +1,8 @@
|
||||
//! Gives the Windows executable Horizon's icon and its stack, as horizon-official's
|
||||
//! (`packaging/windows/exe.rs`).
|
||||
#[path = "../../packaging/windows/exe.rs"]
|
||||
mod windows_exe;
|
||||
|
||||
fn main() {
|
||||
windows_exe::resources("horizon-client");
|
||||
}
|
||||
@@ -33,3 +33,9 @@ pub const MOD_API_LEVEL: [u8; horizon_mods::api_level::MARK.len()] = horizon_mod
|
||||
pub fn main() {
|
||||
horizon_client::entry::main();
|
||||
}
|
||||
|
||||
/// [`main`] with native mods' hooks: the launcher's generated executable for a build with native
|
||||
/// mods calls it, so that build runs with the platform's parts too.
|
||||
pub fn main_with(mods: horizon_client::mod_api::Mods) {
|
||||
horizon_client::entry::main_with(mods);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//! Horizon: native Rust client for Minecraft Java Edition 26.3 gameplay.
|
||||
//! This repository's plain executable: the platform's game with no Horizon part (docs/layers.md).
|
||||
//! The official executable is horizon-official's.
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
#[cfg(not(any(feature = "system-allocator", feature = "alloc-census")))]
|
||||
@@ -11,9 +12,9 @@ static ALLOCATOR: horizon_threads::CensusAllocator = horizon_threads::CensusAllo
|
||||
/// The mod API level this game serves, kept in the program for the launcher
|
||||
/// to read without running it (`horizon_mods::api_level::MARK`). `main`
|
||||
/// reads it, so the linker keeps it.
|
||||
static MOD_API_LEVEL: [u8; 27] = horizon_mods::api_level::MARK;
|
||||
static MOD_API_LEVEL: [u8; horizon_game::MOD_API_LEVEL.len()] = horizon_game::MOD_API_LEVEL;
|
||||
|
||||
fn main() {
|
||||
std::hint::black_box(&MOD_API_LEVEL);
|
||||
horizon_client::entry::main();
|
||||
horizon_game::main();
|
||||
}
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
//! The official game: the platform's game (`horizon-game`) with Horizon's own in-game parts
|
||||
//! plugged in through the platform's hooks (docs/layers.md, "How a Horizon crate plugs in").
|
||||
//! The release builds ship its executable under the game's name, `horizon-client`
|
||||
//! (`game-build.yml`); horizon-client keeps its own plain executable.
|
||||
//! (`game-build.yml`); horizon-game holds this repository's plain executable.
|
||||
//!
|
||||
//! Each Horizon crate that runs in the game gives a `&'static` value implementing
|
||||
//! `horizon_platform::hooks::Hooks`, and [`register`] adds it. Nothing here depends on an engine
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ ones in this version.
|
||||
flagged, and nothing happens with the anticheat off.
|
||||
|
||||
```sh
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
python3 tools/anticheat_e2e.py --bin-dir target/fast
|
||||
python3 tools/server_bench.py --servers horizon --bots 60 --behaviour walk --anticheat # its cost
|
||||
|
||||
@@ -20,7 +20,7 @@ Checks: a bare name is a harness (`python3 tools/parity.py <name>`, script `tool
|
||||
|
||||
For the full set of harnesses a file can affect, ask the runner:
|
||||
`printf '%s\n' <paths> > /tmp/p.txt && python3 tools/parity.py --changed-files /tmp/p.txt --list`.
|
||||
Client probes are built with `-p horizon-client-lib`; the game with `-p horizon-client`.
|
||||
Client probes are built with `-p horizon-client-lib`; the game with `-p horizon-game`.
|
||||
Because the probe library does not compile gameplay, its dep-info does not include `game.rs`
|
||||
or `game/`. Exact harness counts still depend on refreshed records and reachability; use the
|
||||
command above to inspect the selection rather than relying on historical counts.
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ The report is the [benchmark report format](benchmark-report.md): startup to the
|
||||
|
||||
## Reproduce it
|
||||
|
||||
You need Horizon built (`cargo build --release -p horizon-client -p horizon-client-lib --bins`) and its resources prepared from your own copy of 26.3 (which also provides `.local/minecraft/26.3`, the vanilla client the driver starts), Java 25 with `javac`, and Python 3.10 or newer.
|
||||
You need Horizon built (`cargo build --release -p horizon-game -p horizon-client-lib --bins`) and its resources prepared from your own copy of 26.3 (which also provides `.local/minecraft/26.3`, the vanilla client the driver starts), Java 25 with `javac`, and Python 3.10 or newer.
|
||||
|
||||
```sh
|
||||
python3 tools/perf_bench.py --game horizon --label horizon-mine
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ It only measures. It does not change the build.
|
||||
|
||||
## What it measures
|
||||
|
||||
Every build is the one a developer runs, `cargo build --locked -p horizon-client --profile <profile> --timings`
|
||||
Every build is the one a developer runs, `cargo build --locked -p horizon-game --profile <profile> --timings`
|
||||
(the game and `horizon-ctl`), in a target folder of its own.
|
||||
|
||||
- **Cold:** a build from an empty target folder, for the `dev` and `fast` profiles. Its timings page gives the
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ Optimizations are not extras; they are part of the game in every build.
|
||||
## Building without Horizon's extras
|
||||
|
||||
```sh
|
||||
cargo build --release -p horizon-client --no-default-features --features audio,controllers
|
||||
cargo build --release -p horizon-game --no-default-features --features audio,controllers
|
||||
```
|
||||
|
||||
Best effort: CI builds and tests the default only. The server build (`--no-default-features`,
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ It runs only in frames drawn flat (Metal past `flat::MIN_SECTIONS` sections in v
|
||||
`tools/graphics_bench.py` opens a fresh creative world (seed 1234) on a virtual screen and flies the camera along four fixed 192-block paths, over a village, a forest, the ocean and a mountain, at render distances 8, 16 and 32, one game per distance. Each flight takes 12 seconds and reports average FPS, 1% lows, frame-time percentiles, CPU time per frame (frame time minus waits for the GPU, the display and the limiter), the split of that CPU time (world update, ticks, frame preparation, renderer) for all frames and for the slowest 1%, and GPU time per frame from timestamp queries.
|
||||
|
||||
```sh
|
||||
cargo build --release -p horizon-client -p horizon-client-lib --bins
|
||||
cargo build --release -p horizon-game -p horizon-client-lib --bins
|
||||
python3 tools/graphics_bench.py --label mine # lavapipe on vscreen: CPU-side numbers
|
||||
python3 tools/graphics_bench.py --label mine-gpu --offscreen # the desktop's RTX 4080
|
||||
python3 tools/graphics_bench.py --compare baseline-4080 mine-gpu # markdown table
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ for Windows includes it), else against the SHA-256 GitHub publishes, and never a
|
||||
- a `game-files` folder for the files you prepare, kept across updates.
|
||||
|
||||
Options: `--version vX.Y.Z`, `--dir FOLDER`, `--bin FOLDER` (Windows: `-Version`, `-Dir`). Other systems,
|
||||
such as Linux on ARM, build from source: `cargo build --release -p horizon-client --bin horizon-client -p
|
||||
such as Linux on ARM, build from source: `cargo build --release -p horizon-game --bin horizon-client -p
|
||||
horizon-server` and keep both programs in one folder.
|
||||
|
||||
On Nix and NixOS, the repository's flake builds `horizon-server` from source: [nix.md](nix.md).
|
||||
|
||||
+2
-2
@@ -224,7 +224,7 @@ that. horizon-plain becomes a plain build of this repository.
|
||||
the official game build in CI, plugged in through the platform's hooks. Players never compile them: a native
|
||||
mod is source the launcher compiles per instance, so it is not the way. The official executable is a thin
|
||||
binary crate in the Horizon repository that links the platform and the Horizon crates; this repository keeps
|
||||
its own plain executable. The game runs the same without them.
|
||||
its own plain executable, `horizon-game`'s `horizon-client`. The game runs the same without them.
|
||||
4. Every Horizon address is in `horizon-addresses`, which moves with the layer.
|
||||
5. The launcher is Horizon's: it moves too. It installs the game from this repository's releases and adds the
|
||||
Horizon layer to it.
|
||||
@@ -257,7 +257,7 @@ The seam's points 1-3 above, as they work today (layer plan M5).
|
||||
|---|---|---|
|
||||
| `horizon-hooks` | engine | The `Hooks` trait, `register`, and the engine's dispatch (`horizon_hooks::engine`) |
|
||||
| `horizon-platform` | platform | `horizon_platform::hooks`: `Hooks`, `Started`, `register`, without the dispatch |
|
||||
| `horizon-game` | platform | The game for an executable to start: `horizon_game::main()`, the allocator, the mod API mark. The platform's own parts register here as they leave the engine (M6) |
|
||||
| `horizon-game` | platform | The game for an executable to start: `horizon_game::main()`, the allocator, the mod API mark. The platform's own parts register here as they leave the engine (M6). Its `horizon-client` executable is this repository's plain game, with no Horizon part: `cargo run -p horizon-game`, the harnesses, `horizon-ctl launch`, the server build and horizon-plain run it |
|
||||
| `horizon-official` | Horizon | The official executable: `register()` adds the Horizon crates' hooks, then it runs `horizon_game::main()` |
|
||||
|
||||
A Horizon crate that runs in the game:
|
||||
|
||||
@@ -116,10 +116,10 @@ verified, it is reused and the named files aren't read. Two things no such launc
|
||||
```sh
|
||||
cargo run --release -p horizon-prepare -- --prepare --server-jar ~/Downloads/server.jar
|
||||
cargo run --release -p horizon-prepare -- sounds
|
||||
cargo run --release -p horizon-client -- --render-distance 12
|
||||
cargo run --release -p horizon-game -- --render-distance 12
|
||||
```
|
||||
|
||||
Development builds that link quickly: `cargo build --profile fast -p horizon-client`.
|
||||
Development builds that link quickly: `cargo build --profile fast -p horizon-game`.
|
||||
|
||||
`HORIZON_OCCLUSION_PROFILE=1` enables detailed entity-occlusion phase and bounds-scan timings
|
||||
in `horizon-ctl stats` and `bench`. The normal benchmark keeps these CPU-clock reads disabled;
|
||||
@@ -174,7 +174,7 @@ The native Rust adapter recognizes 26.2, 26.1.x, 1.21.11, 1.21.9/1.21.10,
|
||||
the adapter. The client still needs its prepared **26.3** resources.
|
||||
|
||||
```sh
|
||||
HORIZON_OLDER_SERVERS=1 cargo run --profile fast -p horizon-client -- --server 127.0.0.1:25565
|
||||
HORIZON_OLDER_SERVERS=1 cargo run --profile fast -p horizon-game -- --server 127.0.0.1:25565
|
||||
```
|
||||
|
||||
In PowerShell, set `$env:HORIZON_OLDER_SERVERS = '1'`, then run the same Cargo
|
||||
@@ -289,7 +289,7 @@ local socket; under control, losing window focus does not pause the game or
|
||||
release held keys, so a script can play while you use other windows.
|
||||
|
||||
```sh
|
||||
cargo build --release -p horizon-client -p horizon-client-lib --bins
|
||||
cargo build --release -p horizon-game -p horizon-client-lib --bins
|
||||
C=target/release/horizon-ctl
|
||||
$C launch --world Survival --seed 5 --wait # start the game, open or create the world, wait for it
|
||||
$C state # player, world, screen, crosshair target
|
||||
@@ -449,7 +449,7 @@ To play on another machine without Rust, JDK or prepared resources,
|
||||
package a release build where they exist:
|
||||
|
||||
```sh
|
||||
cargo build --release -p horizon-client
|
||||
cargo build --release -p horizon-game
|
||||
python3 tools/package_native_client.py --out ~/builds/horizon
|
||||
```
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ On a Linux machine with the vanilla data prepared (`python3 tools/lab.py prepare
|
||||
# Pumpkin: your own build, run as a black box (GPL-3.0: don't read or copy its source into Horizon)
|
||||
git clone https://github.com/Pumpkin-MC/Pumpkin && cd Pumpkin && git checkout 55cb804cc && cargo build --release && cd -
|
||||
# Horizon
|
||||
cargo build --release -p horizon-client --bin horizon-client
|
||||
cargo build --release -p horizon-game --bin horizon-client
|
||||
cargo build --release -p horizon-server -p horizon-bots
|
||||
# The comparison: 0, 20, 60 and 100 bots, three rounds, the servers alternated
|
||||
taskset -c 0-3 python3 tools/server_bench.py --servers horizon,pumpkin --pumpkin Pumpkin/target/release/pumpkin \
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ controllers, no Play with Friends: the `friends` feature; nor Discord presence o
|
||||
only the official executable has), which links neither `libasound.so.2` nor `libudev.so.1`. `release.yml` builds it after the
|
||||
client archive (`xtask package-server`) and fails if `tools/check_imports.py --server` finds either library;
|
||||
CI lints the same build. `horizon-server` runs `horizon-engine` when it is beside it or on the PATH, else
|
||||
`horizon-client`. Build it yourself with `cargo build --release -p horizon-client --no-default-features`
|
||||
`horizon-client`. Build it yourself with `cargo build --release -p horizon-game --no-default-features`
|
||||
and copy `target/release/horizon-client` as `horizon-engine`. macOS and Windows have no such libraries to
|
||||
avoid, so they keep the one archive.
|
||||
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ with. The coin is a fresh random key from the system, never the world's random.
|
||||
|
||||
A native mod is built into the game it runs in ([native-mods.md](native-mods.md)). For the server: the source of the
|
||||
release the server runs, `horizon-mixins apply` with the `smp` bundle, then the server build
|
||||
(`cargo build --release --no-default-features -p horizon-client`), and `horizon-server`'s `[engine] path` set to
|
||||
(`cargo build --release --no-default-features -p horizon-game`), and `horizon-server`'s `[engine] path` set to
|
||||
the result. When to deploy it on the official server is the owners' decision; the mod's README holds the exact
|
||||
commands.
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ mimalloc. No frame-rate improvement is guaranteed.
|
||||
|
||||
```sh
|
||||
# Current mimalloc baseline, then add Segment Heap. Keep the same profile.
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client --features windows-segment-heap
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client --features windows-segment-heap
|
||||
# Older commands still build, but these repeat the two variants above.
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client --features windows-mimalloc
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client --features windows-segment-heap,windows-mimalloc
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client --features windows-mimalloc
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client --features windows-segment-heap,windows-mimalloc
|
||||
```
|
||||
|
||||
Copy each executable to a separate experiment directory before building the next
|
||||
|
||||
@@ -17,7 +17,7 @@ the Java exporters used by the game.
|
||||
```powershell
|
||||
rustup target add aarch64-pc-windows-msvc
|
||||
cargo build --release --locked --target aarch64-pc-windows-msvc `
|
||||
-p horizon-client -p horizon-client-lib --bin horizon-client --bin horizon-ctl `
|
||||
-p horizon-game -p horizon-client-lib --bin horizon-client --bin horizon-ctl `
|
||||
-p horizon-prepare --bin horizon-prepare -p horizon-server --bin horizon-server
|
||||
```
|
||||
|
||||
|
||||
@@ -83,6 +83,13 @@ pub(super) fn has_official(stage: &Path) -> bool {
|
||||
stage.join("crates/horizon-official/Cargo.toml").is_file()
|
||||
}
|
||||
|
||||
/// Whether the revision's platform game starts native mods (`horizon_game::main_with`): the
|
||||
/// generated executable then runs through it, with the platform's parts (pack formats...).
|
||||
fn has_game_main_with(stage: &Path) -> bool {
|
||||
fs::read_to_string(stage.join("crates/horizon-game/src/lib.rs"))
|
||||
.is_ok_and(|lib| lib.contains("pub fn main_with("))
|
||||
}
|
||||
|
||||
/// The package the game build compiles: the generated executable when trait mods need one, else
|
||||
/// the game the release ships for `target` (the server build is horizon-client's, without
|
||||
/// Horizon's parts, as `game-build.yml`'s).
|
||||
@@ -137,7 +144,7 @@ fn names_mods(stage: &Path) -> bool {
|
||||
/// The generated executable's `main`: the trait mods of bundles `ids`, in that order, named by
|
||||
/// those ids when `named`; with Horizon's own parts registered when `official` (the revision has
|
||||
/// `horizon-official`, and the build is the game's, not the server's: its `official` feature).
|
||||
fn main_rs(ids: &[&str], named: bool, official: bool) -> String {
|
||||
fn main_rs(ids: &[&str], named: bool, official: bool, platform: bool) -> String {
|
||||
let entries = (0..ids.len())
|
||||
.map(|i| format!(" mod_{i}::hooks(),\n"))
|
||||
.collect::<String>();
|
||||
@@ -151,6 +158,11 @@ fn main_rs(ids: &[&str], named: bool, official: bool) -> String {
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let run = if platform {
|
||||
"horizon_game::main_with"
|
||||
} else {
|
||||
"horizon_client::entry::main_with"
|
||||
};
|
||||
// Mirrors crates/horizon-official/src/main.rs, with trait mods passed to main_with.
|
||||
format!(
|
||||
r#"//! Generated by the launcher.
|
||||
@@ -165,7 +177,7 @@ fn main() {{
|
||||
std::hint::black_box(&MOD_API_LEVEL);
|
||||
let mods: horizon_client::mod_api::Mods = vec![
|
||||
{entries} ].into();
|
||||
{naming}{official} horizon_client::entry::main_with(mods);
|
||||
{naming}{official} {run}(mods);
|
||||
}}
|
||||
"#
|
||||
)
|
||||
@@ -301,6 +313,15 @@ pub(super) fn stage(
|
||||
{
|
||||
client.insert("default-features".into(), false.into());
|
||||
}
|
||||
// The platform's game, which starts the mods with the platform's parts; its features are
|
||||
// horizon-client's, chosen through horizon-client above.
|
||||
let platform = has_game_main_with(stage);
|
||||
if platform {
|
||||
let mut dep = toml::Table::new();
|
||||
dep.insert("path".into(), "../horizon-game".into());
|
||||
dep.insert("default-features".into(), false.into());
|
||||
deps.insert("horizon-game".into(), toml::Value::Table(dep));
|
||||
}
|
||||
// The official game's parts, for the game build only (the `official` feature, a default one).
|
||||
let official = has_official(stage);
|
||||
if official {
|
||||
@@ -431,7 +452,7 @@ pub(super) fn stage(
|
||||
let ids: Vec<_> = mods.iter().map(|(_, bundle)| bundle.id.as_str()).collect();
|
||||
fs::write(
|
||||
game.join("src/main.rs"),
|
||||
main_rs(&ids, names_mods(stage), official),
|
||||
main_rs(&ids, names_mods(stage), official, platform),
|
||||
)
|
||||
.map_err(|e| e.to_string())?;
|
||||
let root = stage.join("Cargo.toml");
|
||||
@@ -505,12 +526,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn generated_main_uses_the_games_allocator() {
|
||||
let game = include_str!("../../../crates/horizon-client/src/main.rs");
|
||||
let game = include_str!("../../../crates/horizon-game/src/main.rs");
|
||||
let allocator = game
|
||||
.lines()
|
||||
.find(|line| line.starts_with("static ALLOCATOR:"))
|
||||
.unwrap();
|
||||
let generated = main_rs(&[], false, false);
|
||||
let generated = main_rs(&[], false, false, false);
|
||||
assert!(generated.lines().any(|line| line == allocator));
|
||||
}
|
||||
|
||||
@@ -518,7 +539,7 @@ mod tests {
|
||||
fn generated_main_keeps_mod_order() {
|
||||
let ids = ["base", "extra"];
|
||||
for count in 0..=2 {
|
||||
let text = main_rs(&ids[..count], false, false);
|
||||
let text = main_rs(&ids[..count], false, false, false);
|
||||
assert!(text.contains("entry::main_with(mods)"));
|
||||
assert_eq!(text.matches("::hooks()").count(), count);
|
||||
assert!(!text.contains("name_mods"));
|
||||
@@ -529,7 +550,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
// A revision that names its mods gets the ids in the same order, before main_with.
|
||||
let named = main_rs(&ids, true, false);
|
||||
let named = main_rs(&ids, true, false, false);
|
||||
let naming = named
|
||||
.find(r#"mod_api::name_mods(&["base", "extra"]);"#)
|
||||
.unwrap();
|
||||
@@ -666,6 +687,36 @@ mod tests {
|
||||
}
|
||||
|
||||
/// A staged workspace with horizon-client, as `stage` expects it.
|
||||
#[test]
|
||||
fn a_revision_with_the_platforms_main_with_starts_the_mods_through_it() {
|
||||
let dir = fixture("[mod]\nid = 'example'\nversion = '1'\n[api]\npath = 'engine'\n");
|
||||
let stage_dir = workspace(&dir);
|
||||
let resolution = super::super::dependencies::Resolution { order: vec![0] };
|
||||
let main = || fs::read_to_string(stage_dir.join(GAME).join("src/main.rs")).unwrap();
|
||||
let game = || read(&stage_dir.join(GAME).join("Cargo.toml")).unwrap();
|
||||
// Before horizon-game had it: the engine's entry, as that revision's release ran.
|
||||
let bundle = super::super::bundle(&dir, None).unwrap();
|
||||
stage(&stage_dir, &[bundle], &[vec![]], &resolution).unwrap();
|
||||
assert!(main().contains(" horizon_client::entry::main_with(mods);"));
|
||||
assert!(game()["dependencies"].get("horizon-game").is_none());
|
||||
fs::create_dir_all(stage_dir.join("crates/horizon-game/src")).unwrap();
|
||||
fs::write(
|
||||
stage_dir.join("crates/horizon-game/src/lib.rs"),
|
||||
"pub fn main_with(mods: horizon_client::mod_api::Mods) {}\n",
|
||||
)
|
||||
.unwrap();
|
||||
let bundle = super::super::bundle(&dir, None).unwrap();
|
||||
stage(&stage_dir, &[bundle], &[vec![]], &resolution).unwrap();
|
||||
assert!(main().contains(" horizon_game::main_with(mods);"));
|
||||
assert!(!main().contains("entry::main_with"));
|
||||
let game = game();
|
||||
let platform = &game["dependencies"]["horizon-game"];
|
||||
assert_eq!(platform["path"].as_str(), Some("../horizon-game"));
|
||||
// A server build's `--no-default-features` still reaches the game through horizon-client.
|
||||
assert_eq!(platform["default-features"].as_bool(), Some(false));
|
||||
fs::remove_dir_all(dir).unwrap();
|
||||
}
|
||||
|
||||
fn workspace(dir: &Path) -> std::path::PathBuf {
|
||||
let stage_dir = dir.join("workspace");
|
||||
fs::create_dir_all(stage_dir.join("crates/horizon-client")).unwrap();
|
||||
|
||||
@@ -16,7 +16,7 @@ FROM rust:1-slim-bookworm AS build
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
# The server build of the game (no sound, no controllers: it needs neither ALSA nor udev) as horizon-engine.
|
||||
RUN cargo build --release --locked -p horizon-client --no-default-features --bin horizon-client \
|
||||
RUN cargo build --release --locked -p horizon-game --no-default-features --bin horizon-client \
|
||||
&& cargo build --release --locked -p horizon-server --bin horizon-server \
|
||||
&& mkdir /out && cp target/release/horizon-client /out/horizon-engine && cp target/release/horizon-server /out/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Windows executables' resources, shared by the build scripts of the game's executables
|
||||
//! (`crates/horizon-client/build.rs`, `crates/horizon-official/build.rs`, which include it with
|
||||
//! (`crates/horizon-game/build.rs`, `crates/horizon-official/build.rs`, which include it with
|
||||
//! `#[path]`). Embeds Horizon's icon (`packaging/icons/horizon.ico`) as icon resource 1: Explorer
|
||||
//! and the task bar show it, and the window takes it as its icon. The optional Segment Heap
|
||||
//! manifest (`crates/horizon-client/windows-segment-heap.manifest`, the package's
|
||||
|
||||
@@ -285,7 +285,7 @@ class RunTests(unittest.TestCase):
|
||||
self.report("--profiles", "dev,fast", "--crates", "horizon-items", "--jobs", "3")
|
||||
for call in self.builds():
|
||||
args = call["args"]
|
||||
self.assertEqual(args[:5], ["build", "--locked", "-p", "horizon-client", "--profile"])
|
||||
self.assertEqual(args[:5], ["build", "--locked", "-p", "horizon-game", "--profile"])
|
||||
self.assertIn(args[5], ["dev", "fast"])
|
||||
self.assertIn("--timings", args)
|
||||
self.assertEqual(args[args.index("--jobs") + 1], "3")
|
||||
|
||||
@@ -112,8 +112,7 @@ class PrReadyTests(unittest.TestCase):
|
||||
"examples/probe/main.rs", "tests/lan_bot.rs"]:
|
||||
self.assertEqual(pr_ready.touched_crates({f"crates/horizon-client/{path}"}, packages),
|
||||
["horizon-client-lib"])
|
||||
for path in ["src/lib.rs", "src/main.rs", "src/entry.rs", "src/game.rs", "src/game/combat.rs",
|
||||
"tests/launch_api.rs", "Cargo.toml", "build.rs"]:
|
||||
for path in ["src/lib.rs", "src/entry.rs", "src/game.rs", "src/game/combat.rs", "Cargo.toml", "build.rs"]:
|
||||
self.assertEqual(pr_ready.touched_crates({f"crates/horizon-client/{path}"}, packages),
|
||||
["horizon-client"])
|
||||
|
||||
|
||||
@@ -1158,7 +1158,7 @@ def main():
|
||||
if args.bin_dir:
|
||||
bins = Path(args.bin_dir).resolve()
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bins'],
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bins'],
|
||||
cwd=ROOT, check=True)
|
||||
meta = json.loads(subprocess.run(['cargo', 'metadata', '--format-version', '1', '--no-deps'], cwd=ROOT,
|
||||
capture_output=True, text=True, check=True).stdout)
|
||||
|
||||
@@ -34,7 +34,7 @@ Checks:
|
||||
|
||||
Each server runs in a fresh folder with fresh HORIZON_HOME and XDG folders (lab.game_env), on a free port,
|
||||
in a flat world (creative unless the check says otherwise: the bots fly). Build first:
|
||||
cargo build --profile fast -p horizon-client -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
cargo build --profile fast -p horizon-game -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -96,7 +96,7 @@ def main():
|
||||
client, ctl_path = bindir / 'horizon-client', bindir / 'horizon-ctl'
|
||||
for binary in (client, ctl_path):
|
||||
if not binary.exists():
|
||||
raise Failed(f'{binary} is missing; build it (cargo build --profile fast -p horizon-client '
|
||||
raise Failed(f'{binary} is missing; build it (cargo build --profile fast -p horizon-game '
|
||||
'-p horizon-client-lib --bins) or pass --bin-dir')
|
||||
resources = Path(args.resources).resolve()
|
||||
if not resources.exists():
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
python3 tools/build_times.py run --profiles dev --only incremental --crates horizon-items
|
||||
python3 tools/build_times.py compare before.json after.json
|
||||
|
||||
`run` builds the game (`cargo build --locked -p horizon-client --profile P --timings`) and writes a JSON
|
||||
`run` builds the game (`cargo build --locked -p horizon-game --profile P --timings`) and writes a JSON
|
||||
report and a Markdown table under .local/build-times/reports/:
|
||||
|
||||
- cold: a build from an empty target folder of its own (never target/), per profile. The timings page of
|
||||
@@ -51,7 +51,7 @@ ROOT = lab.ROOT
|
||||
REPORT_FORMAT, REPORT_VERSION = "horizon-build-times", 1
|
||||
WORK = Path(".local") / "build-times"
|
||||
MARKER = ".horizon-build-times"
|
||||
PACKAGE = "horizon-client"
|
||||
PACKAGE = "horizon-game"
|
||||
PROFILES = ["dev", "fast"]
|
||||
# The files an edit goes to by default: large, often changed, and each in a different layer. horizon-client's
|
||||
# game.rs belongs to the game binary, the others to libraries the binary links. Any other crate in the
|
||||
|
||||
@@ -170,7 +170,7 @@ def main():
|
||||
return
|
||||
ctl = Path(args.build).resolve() / "horizon-ctl"
|
||||
if not ctl.exists():
|
||||
sys.exit(f"{ctl} missing: cargo build --release -p horizon-client -p horizon-client-lib --bins")
|
||||
sys.exit(f"{ctl} missing: cargo build --release -p horizon-game -p horizon-client-lib --bins")
|
||||
cwd = ROOT / ".local/graphics-bench"
|
||||
shutil.rmtree(cwd / "saves" / WORLD, ignore_errors=True)
|
||||
cwd.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
+1
-1
@@ -7364,7 +7364,7 @@ def main():
|
||||
if args.bin_dir:
|
||||
bins = Path(args.bin_dir).resolve()
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib',
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib',
|
||||
'--bin', 'horizon-client', '--bin', 'horizon-ctl'],
|
||||
cwd=ROOT, check=True)
|
||||
meta = json.loads(subprocess.run(['cargo', 'metadata', '--format-version', '1', '--no-deps'], cwd=ROOT,
|
||||
|
||||
@@ -42,7 +42,7 @@ def close(g):
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib',
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib',
|
||||
'--bin', 'horizon-client', '--bin', 'horizon-ctl', '--example', 'old_world_fixture'], cwd=lan.ROOT, check=True)
|
||||
meta = json.loads(subprocess.run(['cargo', 'metadata', '--format-version', '1', '--no-deps'], cwd=lan.ROOT,
|
||||
capture_output=True, text=True, check=True).stdout)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
tarball for one of your own Linux or macOS machines. The resources are Mojang
|
||||
assets: keep the archive in ignored .local/ and never publish or commit it.
|
||||
|
||||
cargo build --release -p horizon-client -p horizon-client-lib --bins
|
||||
cargo build --release -p horizon-game -p horizon-client-lib --bins
|
||||
python3 tools/package_native_client.py
|
||||
"""
|
||||
import argparse
|
||||
@@ -88,7 +88,7 @@ def main():
|
||||
cwd=ROOT, check=True, capture_output=True, text=True).stdout)
|
||||
args.binary = Path(metadata['target_directory']) / 'release/horizon-client'
|
||||
if not args.binary.is_file():
|
||||
raise SystemExit(f'missing {args.binary}: run cargo build --release -p horizon-client')
|
||||
raise SystemExit(f'missing {args.binary}: run cargo build --release -p horizon-game')
|
||||
if not (args.resources / 'horizon-resources.json').is_file():
|
||||
raise SystemExit(f'missing prepared resources in {args.resources}: run horizon-prepare --prepare (cargo run --release -p horizon-prepare -- --prepare)')
|
||||
if not (args.resources / 'assets/minecraft/sounds.json').is_file():
|
||||
|
||||
@@ -66,7 +66,7 @@ Cases:
|
||||
it, and Undo shows once the pack is picked.
|
||||
- extras_shell_edges: on Extras, which has no page list, down from the search field lands on the first row, not Done;
|
||||
a row the right stick leaves mostly hidden scrolls back into view when A presses it, and A changes it.
|
||||
Needs built fast binaries (`cargo build --profile fast -p horizon-client -p horizon-client-lib --bins`)
|
||||
Needs built fast binaries (`cargo build --profile fast -p horizon-game -p horizon-client-lib --bins`)
|
||||
and prepared resources in .local/horizon-client/26.3. Exit status 0 when every case passes.
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -16,7 +16,7 @@ Cases:
|
||||
- gameplay_drop: Q in play throws one and Ctrl+Q the rest; the pad's drop button tapped and held must too.
|
||||
- screenshot: key.screenshot bound to the pad takes a screenshot as F2 does.
|
||||
|
||||
Needs built fast binaries (`cargo build --profile fast -p horizon-client -p horizon-client-lib --bins`)
|
||||
Needs built fast binaries (`cargo build --profile fast -p horizon-game -p horizon-client-lib --bins`)
|
||||
and prepared resources in .local/horizon-client/26.3. Exit status 0 when every case matches.
|
||||
"""
|
||||
import argparse
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ def touched_crates(paths, packages):
|
||||
if "horizon-client-lib" in packages and path.startswith("crates/horizon-client/"):
|
||||
relative = path.removeprefix("crates/horizon-client/")
|
||||
gameplay = relative in {"Cargo.toml", "build.rs", "windows-segment-heap.manifest",
|
||||
"src/lib.rs", "src/main.rs", "src/entry.rs", "src/game.rs", "tests/launch_api.rs"} \
|
||||
"src/lib.rs", "src/entry.rs", "src/game.rs"} \
|
||||
or relative.startswith("src/game/")
|
||||
crates.add("horizon-client" if gameplay else "horizon-client-lib")
|
||||
continue
|
||||
@@ -288,7 +288,7 @@ def parity_summary(output):
|
||||
# CI's verify job (.github/workflows/ci.yml): clippy over the whole workspace, and over the server build (the game
|
||||
# without sound or controllers).
|
||||
CI_CLIPPY = "cargo clippy --workspace --all-targets --locked -- -D warnings"
|
||||
CI_CLIPPY_SERVER = "cargo clippy -p horizon-client --all-targets --locked --no-default-features -- -D warnings"
|
||||
CI_CLIPPY_SERVER = "cargo clippy -p horizon-client -p horizon-game --all-targets --locked --no-default-features -- -D warnings"
|
||||
|
||||
|
||||
# CI installs the current stable each run (rustup toolchain install stable), and Rust ships one every six weeks
|
||||
|
||||
@@ -73,7 +73,7 @@ def main():
|
||||
if args.bin_dir:
|
||||
binary = Path(args.bin_dir) / 'horizon-client'
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'],
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'],
|
||||
cwd=ROOT, check=True)
|
||||
binary = Path(lab.cargo_target()) / 'fast' / 'horizon-client'
|
||||
port = lab.free_port()
|
||||
|
||||
@@ -19,7 +19,7 @@ console` attaches through a pipe, runs two commands and shows what they log.
|
||||
|
||||
Everything runs in a fresh temporary folder with fresh HORIZON_HOME and XDG folders and no audio. Logs go
|
||||
to --out. Build first:
|
||||
cargo build --profile fast -p horizon-client -p horizon-client-lib --bins -p horizon-bots -p horizon-server
|
||||
cargo build --profile fast -p horizon-game -p horizon-client-lib --bins -p horizon-bots -p horizon-server
|
||||
"""
|
||||
import argparse
|
||||
import http.client
|
||||
|
||||
@@ -25,7 +25,7 @@ than 10 % apart isn't a fair comparison of its tick times.
|
||||
|
||||
The vanilla side runs the pinned server jar from tools/lab.py prepare (your own copy). It needs Java 25. The
|
||||
Horizon side runs target/release/horizon-server with the engine beside it; build both first:
|
||||
cargo build --release -p horizon-client --bin horizon-client -p horizon-server -p horizon-bots
|
||||
cargo build --release -p horizon-game --bin horizon-client -p horizon-server -p horizon-bots
|
||||
|
||||
Two more Java servers, both dev-only downloads into .local/server-bench/jars (never committed or shipped):
|
||||
- `paper`: Paper's newest build for the pinned version, from PaperMC's download API, checked against the
|
||||
|
||||
@@ -10,7 +10,7 @@ are taken. A bot that sends it moves at once.
|
||||
|
||||
horizon-bots stand in for the clients (`--no-loaded`). The server runs in a fresh folder with fresh
|
||||
HORIZON_HOME and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -11,7 +11,7 @@ threw it.
|
||||
|
||||
horizon-bots stand in for the client (`--click`). The server runs in a fresh folder with fresh HORIZON_HOME
|
||||
and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -13,7 +13,7 @@ disconnects the player.
|
||||
|
||||
horizon-bots stand in for the clients (`--give`). The server runs in a fresh folder with fresh HORIZON_HOME
|
||||
and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
+1
-1
@@ -512,7 +512,7 @@ def main():
|
||||
if args.bin_dir:
|
||||
bins = Path(args.bin_dir).resolve()
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bins'],
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bins'],
|
||||
cwd=ROOT, check=True)
|
||||
bins = ROOT / 'target/fast'
|
||||
out = Path(args.out)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
horizon-bots stand in for the clients (`--brand`). Each server runs in a fresh folder with fresh HORIZON_HOME
|
||||
and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -11,7 +11,7 @@ A real Horizon client (horizon-ctl, offscreen) with LOD Distance 32 joins a dedi
|
||||
|
||||
Each server and game runs in fresh folders with fresh HORIZON_HOME and XDG folders (lab.game_env), on a free
|
||||
port. Build first:
|
||||
cargo build --profile fast -p horizon-client -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
cargo build --profile fast -p horizon-game -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
|
||||
@@ -16,7 +16,7 @@ ops.json); at level 2 the admins' commands must do nothing.
|
||||
|
||||
The game and the server run with fresh HORIZON_HOME, launcher and XDG folders and without audio. Logs go to --out.
|
||||
Build first:
|
||||
cargo build --profile fast -p horizon-client -p horizon-client-lib --bins
|
||||
cargo build --profile fast -p horizon-game -p horizon-client-lib --bins
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -16,7 +16,7 @@ A survival dedicated server in a flat world, a world border 20 blocks wide aroun
|
||||
|
||||
horizon-bots stand in for the clients (`--attack`, `--raw`). The server runs in a fresh folder with fresh
|
||||
HORIZON_HOME and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -22,7 +22,7 @@ ServerboundAttackPacket at its victim twice a second (`--attack`) from:
|
||||
|
||||
A hit shows in the victim's health (SetHealth, in the bots' report). The server runs in a fresh folder with
|
||||
fresh HORIZON_HOME and XDG folders (lab.game_env), on a free port. Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -14,7 +14,7 @@ again as a spectator. Ops, spectating, sees Pat's.
|
||||
|
||||
The server and the games run in fresh folders with fresh HORIZON_HOME and XDG folders (lab.game_env), on a free
|
||||
port. Build first:
|
||||
cargo build --profile fast -p horizon-client -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
cargo build --profile fast -p horizon-game -p horizon-client-lib --bin horizon-client --bin horizon-ctl
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
|
||||
@@ -37,7 +37,7 @@ itself once the player is out, without writing its file again, and C's file hold
|
||||
The engines run in a fresh folder with fresh HORIZON_HOME and XDG folders (lab.game_env), on free ports, with no
|
||||
window. Every request, reply (records shortened) and check goes to --out/steps.json, with both servers' logs.
|
||||
Build first:
|
||||
cargo build --profile fast -p horizon-client --bin horizon-client
|
||||
cargo build --profile fast -p horizon-game --bin horizon-client
|
||||
cargo build --profile fast -p horizon-bots
|
||||
"""
|
||||
import argparse
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
How it works
|
||||
- `Game(players)` launches P1's game through horizon-ctl (`target/fast/horizon-ctl`, built with
|
||||
`cargo build --profile fast -p horizon-client`) with `HORIZON_SPLIT=players`: the game adds the
|
||||
`cargo build --profile fast -p horizon-game`) with `HORIZON_SPLIT=players`: the game adds the
|
||||
others itself, as P2, P3...
|
||||
- Every player has its own control socket (`c.sock`, `c.sock2`...). `g.ctl(n, words...)` sends one
|
||||
horizon-ctl command to player n (docs/horizon-ctl-commands.md).
|
||||
@@ -1491,7 +1491,7 @@ def main():
|
||||
VERBOSE = args.verbose
|
||||
sys.stdout.reconfigure(line_buffering=True)
|
||||
if not CTL.exists():
|
||||
sys.exit(f'{CTL} is missing: cargo build --profile fast -p horizon-client')
|
||||
sys.exit(f'{CTL} is missing: cargo build --profile fast -p horizon-game')
|
||||
if not (RESOURCES / 'assets').exists():
|
||||
sys.exit(f'no prepared resources in {RESOURCES}')
|
||||
for name in args.only or [n for n in SCENARIOS if n != 'native_pointer']:
|
||||
|
||||
@@ -127,7 +127,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -172,7 +172,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
binary = lab.cargo_target() / 'fast' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
client_binary = args.client_binary.resolve(strict=True) if args.client_binary else binary
|
||||
|
||||
@@ -235,7 +235,7 @@ def main():
|
||||
subprocess.run(['javac', '--release', str(lock['minecraft']['java_major']), '-proc:none', '-nowarn', '-sourcepath',
|
||||
lab.ROOT / 'mods/horizon/src/test/java', '-cp', dependencies, '-d', classes, oracle],
|
||||
cwd=lab.ROOT, check=True, capture_output=True)
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
check=True, capture_output=True)
|
||||
import json
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -221,7 +221,7 @@ def main():
|
||||
'-cp', dependencies, '-d', str(classes), str(java_root / 'dev/horizonlab/parity/VanillaDispenserOracle.java')])
|
||||
d.run(['java', '-Xmx3G', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaDispenserOracle',
|
||||
str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')])
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')})
|
||||
d.run([str(lab.cargo_target() / 'fast/horizon-client'), '--resources', str(resources)], cwd=work,
|
||||
env=lab.game_env(HORIZON_DISPENSE_FIXTURE=f'{work / "cases.jsonl"},{work / "rust.txt"}'))
|
||||
|
||||
@@ -137,7 +137,7 @@ def main():
|
||||
'compile-java')
|
||||
run(['java', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaBoatAuthorityOracle',
|
||||
work / 'inputs.json', work / 'vanilla.json'], 'vanilla')
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], 'compile-rust')
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], 'compile-rust')
|
||||
binary = lab.cargo_target() / 'fast' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
with (work / 'rust.log').open('w') as log, tempfile.TemporaryDirectory(prefix='boat-authority-') as game_dir:
|
||||
run_game([str(binary), '--headless', '--resources', str(args.resources.resolve()), '--game-dir', game_dir], cwd=game_dir,
|
||||
|
||||
@@ -130,7 +130,7 @@ def main():
|
||||
return
|
||||
binary = args.binary
|
||||
if binary is None:
|
||||
run(['cargo', 'build', '-p', 'horizon-client', '--bin', 'horizon-client'], 'compile-rust')
|
||||
run(['cargo', 'build', '-p', 'horizon-game', '--bin', 'horizon-client'], 'compile-rust')
|
||||
binary = lab.cargo_target() / 'debug' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
with tempfile.TemporaryDirectory(prefix='hz-boat-rider-') as scratch:
|
||||
with (work / 'rust.log').open('w', encoding='utf-8') as log:
|
||||
|
||||
@@ -139,7 +139,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -194,7 +194,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -581,7 +581,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], 'compile-rust', cwd=lab.ROOT)
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], 'compile-rust', cwd=lab.ROOT)
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
binary = Path(metadata['target_directory']) / 'fast' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
rust_dir = build / 'rust'
|
||||
|
||||
@@ -122,7 +122,7 @@ def main():
|
||||
'-cp', dependencies, '-d', str(classes), str(java_root / 'dev/horizonlab/parity/VanillaDispenserOracle.java')])
|
||||
d.run(['java', '-Xmx3G', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaDispenserOracle',
|
||||
str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')])
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')})
|
||||
d.run([str(lab.cargo_target() / 'fast/horizon-client'), '--resources', str(resources)], cwd=work,
|
||||
env=lab.game_env(HORIZON_DISPENSE_FIXTURE=f'{work / "cases.jsonl"},{work / "rust.txt"}'))
|
||||
|
||||
@@ -141,7 +141,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -242,7 +242,7 @@ def main():
|
||||
'-cp', dependencies, '-d', str(classes), str(java_root / 'dev/horizonlab/parity/VanillaDispenserOracle.java')])
|
||||
d.run(['java', '-Xmx3G', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaDispenserOracle',
|
||||
str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')])
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')})
|
||||
d.run([str(lab.cargo_target() / 'fast/horizon-client'), '--resources', str(resources)], cwd=work,
|
||||
env=lab.game_env(HORIZON_DISPENSE_FIXTURE=f'{work / "cases.jsonl"},{work / "rust.txt"}'))
|
||||
|
||||
@@ -202,7 +202,7 @@ def signal_saves(build):
|
||||
|
||||
|
||||
def main():
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bin', 'horizon-client', '--bin', 'horizon-ctl'], cwd=lab.ROOT, check=True)
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bin', 'horizon-client', '--bin', 'horizon-ctl'], cwd=lab.ROOT, check=True)
|
||||
build = lab.LOCAL / 'dedicated-crash-save'
|
||||
shutil.rmtree(build, ignore_errors=True)
|
||||
build.mkdir(parents=True)
|
||||
|
||||
@@ -430,7 +430,7 @@ def main():
|
||||
oh.run_logged(['javac', '--release', lock['minecraft']['java_major'], '-proc:none', '-nowarn', '-sourcepath',
|
||||
lab.ROOT / 'mods/horizon/src/test/java', '-cp', dependencies, '-d', classes, oracle],
|
||||
build, 'compile-java')
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], build,
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], build,
|
||||
'compile-rust')
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'],
|
||||
cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -538,7 +538,7 @@ def main():
|
||||
'-cp', dependencies, '-d', str(classes), str(java_root / 'dev/horizonlab/parity/VanillaDispenserOracle.java')])
|
||||
run(['java', '-Xmx3G', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaDispenserOracle',
|
||||
str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')])
|
||||
run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')})
|
||||
executable = lab.cargo_target() / ('fast/horizon-client.exe' if os.name == 'nt' else 'fast/horizon-client')
|
||||
with tempfile.TemporaryDirectory(prefix='game-', dir=work) as game_dir:
|
||||
|
||||
@@ -112,7 +112,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -126,7 +126,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -132,7 +132,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -168,7 +168,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -118,7 +118,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -144,7 +144,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -127,7 +127,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -32,7 +32,7 @@ def main():
|
||||
XDG_DATA_HOME=str(work / "data"),
|
||||
XDG_CONFIG_HOME=str(work / "config"),
|
||||
)
|
||||
subprocess.run(["cargo", "build", "--profile", "fast", "-p", "horizon-client", "--bin", "horizon-client"],
|
||||
subprocess.run(["cargo", "build", "--profile", "fast", "-p", "horizon-game", "--bin", "horizon-client"],
|
||||
cwd=lab.ROOT, env=env, check=True)
|
||||
binary = lab.cargo_target() / "fast" / ("horizon-client.exe" if os.name == "nt" else "horizon-client")
|
||||
subprocess.run([sys.executable, str(lab.ROOT / "tools/test_command_exec_parity.py"),
|
||||
|
||||
@@ -102,7 +102,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -68,7 +68,7 @@ def main():
|
||||
build = lab.LOCAL / NAME
|
||||
build.mkdir(parents=True, exist_ok=True)
|
||||
dependencies = os.pathsep.join(map(str, [jars['server'], *libraries]))
|
||||
subprocess.run(['cargo', 'build', '--release', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
subprocess.run(['cargo', 'build', '--release', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
check=True, capture_output=True)
|
||||
binary = lab.cargo_target() / 'release' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
vanilla_server = ['java', '-Xmx2g', '-Duser.timezone=UTC', '-cp', dependencies, 'net.minecraft.server.Main', 'nogui']
|
||||
|
||||
@@ -68,7 +68,7 @@ SEED = '7'
|
||||
# horizon-mod-api-gen generates Rust from tools/native-hook-fragments/ (BUILT_FROM_TOOLS).
|
||||
NO_BINARY = ('tools/', 'tests/', '.github/')
|
||||
BUILT_FROM_TOOLS = ('tools/native-hook-fragments/',)
|
||||
BUILD = ['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bins']
|
||||
BUILD = ['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bins']
|
||||
# 🤖 Agent: Where the overworld scenes are built, high above seed 7's spawn, so terrain below hardly shows.
|
||||
X, Y, Z = 8, 160, 8
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -66,7 +66,7 @@ def main():
|
||||
subprocess.run(['javac', '--release', str(lock['minecraft']['java_major']), '-proc:none', '-nowarn',
|
||||
'-sourcepath', lab.ROOT / 'mods/horizon/src/test/java', '-cp', dependencies,
|
||||
'-d', classes, oracle], cwd=lab.ROOT, check=True, capture_output=True)
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'],
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'],
|
||||
cwd=lab.ROOT, check=True, capture_output=True)
|
||||
import json
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'],
|
||||
|
||||
@@ -259,7 +259,7 @@ def sides(name, binary=None):
|
||||
lab.ROOT / 'mods/horizon/src/test/java', '-cp', dependencies, '-d', classes, oracle],
|
||||
cwd=lab.ROOT, check=True, capture_output=True)
|
||||
if binary is None:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
check=True, capture_output=True)
|
||||
import json
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'],
|
||||
|
||||
@@ -249,7 +249,7 @@ def main():
|
||||
'-cp', dependencies, '-d', str(classes), str(java_root / 'dev/horizonlab/parity/VanillaDispenserOracle.java')])
|
||||
d.run(['java', '-Xmx3G', '-cp', str(classes) + os.pathsep + dependencies, 'dev.horizonlab.parity.VanillaDispenserOracle',
|
||||
str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')])
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
d.run(['cargo', 'build', '-q', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], cwd=lab.ROOT,
|
||||
env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')})
|
||||
d.run([str(lab.cargo_target() / 'fast/horizon-client'), '--resources', str(resources)], cwd=work,
|
||||
env=lab.game_env(HORIZON_DISPENSE_FIXTURE=f'{work / "cases.jsonl"},{work / "rust.txt"}'))
|
||||
|
||||
@@ -543,7 +543,7 @@ def main():
|
||||
build = lab.LOCAL / NAME
|
||||
shutil.rmtree(build, ignore_errors=True)
|
||||
build.mkdir(parents=True)
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client',
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client',
|
||||
'-p', 'horizon-server', '--bin', 'horizon-server'], build, 'compile-rust')
|
||||
target = lab.cargo_target() / 'fast'
|
||||
work = Path(tempfile.mkdtemp(prefix='hz-management-'))
|
||||
|
||||
@@ -167,7 +167,7 @@ def main():
|
||||
if result.returncode:
|
||||
raise RuntimeError(f'{name}: {result.returncode}; see {out / (name+".log")}')
|
||||
if args.binary is None:
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], 'build', cwd=lab.ROOT)
|
||||
run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], 'build', cwd=lab.ROOT)
|
||||
binary = lab.cargo_target()/'fast'/('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
else:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
|
||||
@@ -62,7 +62,7 @@ def main():
|
||||
if path.is_file()
|
||||
}
|
||||
environment = dict(os.environ, RUSTUP_TOOLCHAIN='stable')
|
||||
subprocess.run(['cargo', 'build', '--locked', '-p', 'horizon-client'],
|
||||
subprocess.run(['cargo', 'build', '--locked', '-p', 'horizon-game'],
|
||||
cwd=lab.ROOT, env=environment, check=True, timeout=3600)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--locked', '--no-deps', '--format-version', '1'],
|
||||
|
||||
@@ -43,7 +43,7 @@ def main():
|
||||
binary = args.binary
|
||||
if binary is None:
|
||||
with (work / 'build.log').open('w', encoding='utf-8') as log:
|
||||
subprocess.run(['cargo', 'build', '-p', 'horizon-client', '--bin', 'horizon-client'],
|
||||
subprocess.run(['cargo', 'build', '-p', 'horizon-game', '--bin', 'horizon-client'],
|
||||
cwd=lab.ROOT, stdout=log, stderr=subprocess.STDOUT, check=True, timeout=1800)
|
||||
binary = lab.cargo_target() / 'debug' / ('horizon-client.exe' if os.name == 'nt' else 'horizon-client')
|
||||
with tempfile.TemporaryDirectory(prefix='hz-native-particles-') as scratch:
|
||||
|
||||
@@ -355,7 +355,7 @@ def main():
|
||||
build.mkdir(parents=True, exist_ok=True)
|
||||
report = build / 'report.json'
|
||||
report.unlink(missing_ok=True)
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client', '--bin', 'horizon-client'], build,
|
||||
oh.run_logged(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game', '--bin', 'horizon-client'], build,
|
||||
'compile-rust')
|
||||
metadata = json.loads(subprocess.check_output(['cargo', 'metadata', '--no-deps', '--format-version', '1'],
|
||||
cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -132,7 +132,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -175,7 +175,7 @@ def main():
|
||||
if args.binary:
|
||||
binary = args.binary.resolve(strict=True)
|
||||
else:
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-client',
|
||||
subprocess.run(['cargo', 'build', '--profile', 'fast', '-p', 'horizon-game',
|
||||
'--bin', 'horizon-client'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--no-deps', '--format-version', '1'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -80,7 +80,7 @@ def check_thrown(host, guest, out):
|
||||
|
||||
|
||||
def main():
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib',
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib',
|
||||
'--bin', 'horizon-client', '--bin', 'horizon-ctl'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--format-version', '1', '--no-deps'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -11,7 +11,7 @@ import lan_e2e as lan
|
||||
|
||||
|
||||
def main():
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib',
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib',
|
||||
'--bin', 'horizon-client', '--bin', 'horizon-ctl'], cwd=lab.ROOT, check=True)
|
||||
metadata = json.loads(subprocess.check_output(
|
||||
['cargo', 'metadata', '--format-version', '1', '--no-deps'], cwd=lab.ROOT, text=True))
|
||||
|
||||
@@ -44,7 +44,7 @@ def main():
|
||||
args = parser.parse_args()
|
||||
bin_dir = Path(args.bin_dir).resolve() if args.bin_dir else None
|
||||
if bin_dir is None:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bins'], cwd=ROOT, check=True)
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bins'], cwd=ROOT, check=True)
|
||||
bin_dir = ROOT / os.environ.get('CARGO_TARGET_DIR', 'target') / 'fast'
|
||||
shutil.rmtree(RUN, ignore_errors=True)
|
||||
RUN.mkdir(parents=True)
|
||||
|
||||
@@ -665,7 +665,7 @@ def main():
|
||||
else:
|
||||
bin_dir = Path(args.bin_dir).resolve() if args.bin_dir else None
|
||||
if bin_dir is None:
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-client', '-p', 'horizon-client-lib', '--bins'], cwd=ROOT, check=True)
|
||||
subprocess.run(['cargo', 'build', '--locked', '--profile', 'fast', '-p', 'horizon-game', '-p', 'horizon-client-lib', '--bins'], cwd=ROOT, check=True)
|
||||
bin_dir = ROOT / os.environ.get('CARGO_TARGET_DIR', 'target') / 'fast'
|
||||
h = horizon_resave(v0, RUN / 'h', bin_dir)
|
||||
print('comparing', v0, 'with', h)
|
||||
|
||||
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user