Seemingly incremental builds

This commit is contained in:
Daniel Flanagan 2024-08-01 14:02:38 -05:00
parent e5023f897e
commit 0ccbec9e1b
4 changed files with 35 additions and 32 deletions

29
Cargo.lock generated
View file

@ -523,6 +523,25 @@ dependencies = [
"encase_derive_impl",
]
[[package]]
name = "bevy_framepace"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa5f7d858e66d0f4c4fe3e1a678da440037ce383c4c51bff3c1fa06a121ebc0"
dependencies = [
"bevy_app",
"bevy_diagnostic",
"bevy_ecs",
"bevy_log",
"bevy_reflect",
"bevy_render",
"bevy_time",
"bevy_utils",
"bevy_window",
"bevy_winit",
"spin_sleep",
]
[[package]]
name = "bevy_gizmos"
version = "0.14.0"
@ -2014,6 +2033,7 @@ name = "kodotag-rs"
version = "0.1.0"
dependencies = [
"bevy",
"bevy_framepace",
]
[[package]]
@ -3083,6 +3103,15 @@ dependencies = [
"serde",
]
[[package]]
name = "spin_sleep"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "368a978649eaf70006b082e79c832bd72556ac1393eaf564d686e919dca2347f"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "spirv"
version = "0.3.0+sdk-1.3.268.0"

View file

@ -35,6 +35,7 @@ bevy = { version = "0.14.0", default-features = false, features = [
# "bevy_dev_tools", # possibly-useful development tools
# "detailed_trace", # probably useful troubleshooting information during runtime
] }
bevy_framepace = "0.17.1"
[profile.dev]
opt-level = 1

View file

@ -65,16 +65,10 @@
};
};
build = outputs.packages.${pkgs.system}.default;
build-no-crane = outputs.packages.${pkgs.system}.kodotag-no-crane;
});
packages = genPkgs (pkgs: let
rustToolchainFor = p:
p.rust-bin.selectLatestNightlyWith (toolchain:
toolchain.default.override {
extensions = ["rust-src"];
targets = ["x86_64-unknown-linux-gnu"];
});
rustToolchainFor = p: p.rust-bin.stable.latest.default;
rustToolchain = rustToolchainFor pkgs;
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
@ -92,10 +86,6 @@
};
in {
kodotag = craneLib.buildPackage {
# TODO: incremental rust builds with nix would be awesome
pname = "kodotag";
version = "0.1.0";
inherit src;
strictDeps = true;
cargoVendorDir = craneLib.vendorMultipleCargoDeps {
@ -118,9 +108,7 @@
nativeBuildInputs = buildTimeDeps pkgs;
buildInputs = linkTimeDeps pkgs;
hash = pkgs.lib.fakeHash;
# cargoHash = "";
cargoHash = "sha256-d7luBIWHWn2ZpmSnIgpuLXsy1URUIojpPFboMtqa2ps=";
# hash = pkgs.lib.fakeHash;
# a hack to avoid using mold as our linker when building with nix
postUnpack = ''
@ -129,24 +117,7 @@
'';
};
kodotag-no-crane = pkgs.rustPlatform.buildRustPackage {
pname = "kodotag";
version = "0.1.0";
nativeBuildInputs = buildTimeDeps pkgs;
buildInputs = linkTimeDeps pkgs;
src = ./.;
hash = pkgs.lib.fakeHash;
# cargoHash = "";
cargoHash = "sha256-d7luBIWHWn2ZpmSnIgpuLXsy1URUIojpPFboMtqa2ps=";
# a hack to avoid using mold as our linker when building with nix
postUnpack = ''
ls -la
rm -r ./*/.cargo
'';
};
default = outputs.packages.${pkgs.system}.kodotag-no-crane;
default = outputs.packages.${pkgs.system}.kodotag;
});
devShells = genPkgs (pkgs: {

View file

@ -58,6 +58,7 @@ fn main() -> AppExit {
})
.set(ImagePlugin::default_nearest()),
FrameTimeDiagnosticsPlugin,
// bevy_framepace::FramepacePlugin,
));
load_internal_binary_asset!(
@ -105,6 +106,7 @@ fn main() -> AppExit {
.after(player::control)
.after(movement::resolve_velocity),
)
.after(input::process_input)
.in_set(InGameSet),
(main_menu::update).in_set(MainMenuSet),
),