diff --git a/.cargo/config_fast_builds.toml b/.cargo/config_fast_builds.toml new file mode 100644 index 00000000..539ff2dc --- /dev/null +++ b/.cargo/config_fast_builds.toml @@ -0,0 +1,180 @@ +# Copy this file to `config.toml` to speed up your builds. +# +# # Faster linker +# +# One of the slowest aspects of compiling large Rust programs is the linking time. This file configures an +# alternate linker that may improve build times. When choosing a new linker, you have two options: +# +# ## LLD +# +# LLD is a linker from the LLVM project that supports Linux, Windows, macOS, and Wasm. It has the greatest +# platform support and the easiest installation process. It is enabled by default in this file for Linux +# and Windows. On macOS, the default linker yields higher performance than LLD and is used instead. +# +# To install, please scroll to the corresponding table for your target (eg. `[target.x86_64-pc-windows-msvc]` +# for Windows) and follow the steps under `LLD linker`. +# +# For more information, please see LLD's website at . +# +# ## Mold +# +# Mold is a newer linker written by one of the authors of LLD. It boasts even greater performance, specifically +# through its high parallelism, though it only supports Linux. +# +# Mold is disabled by default in this file. If you wish to enable it, follow the installation instructions for +# your corresponding target, disable LLD by commenting out its `-Clink-arg=...` line, and enable Mold by +# *uncommenting* its `-Clink-arg=...` line. +# +# There is a fork of Mold named Sold that supports macOS, but it is unmaintained and is about the same speed as +# the default ld64 linker. For this reason, it is not included in this file. +# +# For more information, please see Mold's repository at . +# +# # Nightly configuration +# +# Be warned that the following features require nightly Rust, which is experimental and may contain bugs. If you +# are having issues, skip this section and use stable Rust instead. +# +# There are a few unstable features that can improve performance. To use them, first install nightly Rust +# through Rustup: +# +# ``` +# rustup toolchain install nightly +# ``` +# +# Finally, uncomment the lines under the `Nightly` heading for your corresponding target table (eg. +# `[target.x86_64-unknown-linux-gnu]` for Linux) to enable the following features: +# +# ## `share-generics` +# +# Usually rustc builds each crate separately, then combines them all together at the end. `share-generics` forces +# crates to share monomorphized generic code, so they do not duplicate work. +# +# In other words, instead of crate 1 generating `Foo` and crate 2 generating `Foo` separately, +# only one crate generates `Foo` and the other adds on to the pre-existing work. +# +# Note that you may have some issues with this flag on Windows. If compiling fails due to the 65k symbol limit, +# you may have to disable this setting. For more information and possible solutions to this error, see +# . +# +# ## `threads` +# +# This option enables rustc's parallel frontend, which improves performance when parsing, type checking, borrow +# checking, and more. We currently set `threads=0`, which defaults to the amount of cores in your CPU. +# +# For more information, see the blog post at . + +[target.x86_64-unknown-linux-gnu] +linker = "clang" +rustflags = [ + # LLD linker + # + # You may need to install it: + # + # - Ubuntu: `sudo apt-get install lld clang` + # - Fedora: `sudo dnf install lld clang` + # - Arch: `sudo pacman -S lld clang` + # "-Clink-arg=-fuse-ld=lld", + + # Mold linker + # + # You may need to install it: + # + # - Ubuntu: `sudo apt-get install mold clang` + # - Fedora: `sudo dnf install mold clang` + # - Arch: `sudo pacman -S mold clang` + "-Clink-arg=-fuse-ld=mold", + + # Nightly + "-Zshare-generics=y", + "-Zthreads=0", +] +# Some systems may experience linker performance issues when running doc tests. +# See https://github.com/bevyengine/bevy/issues/12207 for details. +rustdocflags = [ + # LLD linker + # "-Clink-arg=-fuse-ld=lld", + + # Mold linker + "-Clink-arg=-fuse-ld=mold", +] + +[target.x86_64-apple-darwin] +rustflags = [ + # LLD linker + # + # The default ld64 linker is faster, you should continue using it instead. + # + # You may need to install it: + # + # Brew: `brew install llvm` + # Manually: + # "-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld", + + # Nightly + "-Zshare-generics=y", + "-Zthreads=0", +] + +[target.aarch64-apple-darwin] +rustflags = [ + # LLD linker + # + # The default ld64 linker is faster, you should continue using it instead. + # + # You may need to install it: + # + # Brew: `brew install llvm` + # Manually: + # "-Clink-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld", + + # Nightly + "-Zshare-generics=y", + "-Zthreads=0", +] + +[target.x86_64-pc-windows-msvc] +# LLD linker +# +# You may need to install it: +# +# ``` +# cargo install -f cargo-binutils +# rustup component add llvm-tools +# ``` +linker = "rust-lld.exe" +rustdocflags = ["-Clinker=rust-lld.exe"] +rustflags = [ + # Nightly + "-Zshare-generics=n", # This needs to be off if you use dynamic linking on Windows. + "-Zthreads=0", +] + +# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'. +# In most cases the gains are negligible, but if you are on macOS and have slow compile times you should see significant gains. +# [profile.dev] +# debug = 1 + +# Cranelift +[unstable] +codegen-backend = true + +[profile] +incremental = true + +[profile.dev] +codegen-backend = "cranelift" +# If you want to attach a debugger, set this to true +debug = "line-tables-only" + +# Consider compiling deps with cranelift if you want cold-compilation to be faster +[profile.dev.package."*"] +codegen-backend = "cranelift" + +# cranelift is `panic = abort`, so you need to compile with llvm to get `#[should_panic]` working +[profile.test.package."*"] +codegen-backend = "llvm" + +# Disable cranelift for release profile +[profile.release] +codegen-backend = "llvm" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bca19ea7..1b00bb52 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Install dependencies - run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev lld clang - name: Populate target directory from cache uses: Leafwing-Studios/cargo-cache@v2 diff --git a/Cargo.toml b/Cargo.toml index fa713f56..44e44445 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,31 +53,24 @@ bevy_properties_pane = { path = "bevy_editor_panes/bevy_properties_pane" } bevy_scene_tree = { path = "bevy_editor_panes/bevy_scene_tree" } # bevy_widgets -bevy_color_picker = { path = "bevy_widgets/bevy_color_picker" } -bevy_command_palette = { path = "bevy_widgets/bevy_command_palette" } bevy_context_menu = { path = "bevy_widgets/bevy_context_menu" } bevy_i-cant-believe-its-not-bsn = { path = "bevy_widgets/bevy_i-cant-believe-its-not-bsn" } bevy_menu_bar = { path = "bevy_widgets/bevy_menu_bar" } bevy_scroll_box = { path = "bevy_widgets/bevy_scroll_box" } bevy_footer_bar = { path = "bevy_widgets/bevy_footer_bar" } -bevy_toolbar = { path = "bevy_widgets/bevy_toolbar" } -bevy_tooltips = { path = "bevy_widgets/bevy_tooltips" } bevy_text_editing = { path = "bevy_widgets/bevy_text_editing" } bevy_field_forms = { path = "bevy_widgets/bevy_field_forms" } bevy_focus = { path = "bevy_widgets/bevy_focus" } # general crates bevy_editor_core = { path = "crates/bevy_editor_core" } -bevy_asset_preview = { path = "crates/bevy_asset_preview" } bevy_proto_bsn = { path = "crates/bevy_proto_bsn" } bevy_editor = { path = "crates/bevy_editor" } bevy_editor_camera = { path = "crates/bevy_editor_camera" } bevy_editor_launcher = { path = "crates/bevy_editor_launcher" } bevy_editor_settings = { path = "crates/bevy_editor_settings" } bevy_editor_styles = { path = "crates/bevy_editor_styles" } -bevy_localization = { path = "crates/bevy_localization" } bevy_pane_layout = { path = "crates/bevy_pane_layout" } -bevy_transform_gizmos = { path = "crates/bevy_transform_gizmos" } bevy_undo = { path = "crates/bevy_undo" } bevy_infinite_grid = { path = "crates/bevy_infinite_grid" } bevy_editor_cam = { path = "crates/bevy_editor_cam" } diff --git a/bevy_widgets/bevy_color_picker/Cargo.toml b/bevy_widgets/bevy_color_picker/Cargo.toml deleted file mode 100644 index af2fce70..00000000 --- a/bevy_widgets/bevy_color_picker/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "bevy_color_picker" -version = "0.1.0" -edition = "2021" - -[dependencies] -bevy.workspace = true - -[lints] -workspace = true diff --git a/bevy_widgets/bevy_color_picker/src/lib.rs b/bevy_widgets/bevy_color_picker/src/lib.rs deleted file mode 100644 index 6996e526..00000000 --- a/bevy_widgets/bevy_color_picker/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! A color picker widget for Bevy applications. - -/// an add function that adds two numbers -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/bevy_widgets/bevy_command_palette/Cargo.toml b/bevy_widgets/bevy_command_palette/Cargo.toml deleted file mode 100644 index ff5905f2..00000000 --- a/bevy_widgets/bevy_command_palette/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "bevy_command_palette" -version = "0.1.0" -edition = "2021" - -[dependencies] -bevy.workspace = true - -[lints] -workspace = true diff --git a/bevy_widgets/bevy_command_palette/src/lib.rs b/bevy_widgets/bevy_command_palette/src/lib.rs deleted file mode 100644 index b7bda56f..00000000 --- a/bevy_widgets/bevy_command_palette/src/lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -//! A command palette for Bevy applications. -//! -//! This lists a number of commands that can be executed by the user, -//! allowing for quick access to a variety of functionality. -//! -//! Search and keyboard shortcuts will both be supported. - -/// an add function that adds two numbers -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/bevy_widgets/bevy_toolbar/Cargo.toml b/bevy_widgets/bevy_toolbar/Cargo.toml deleted file mode 100644 index 753eab01..00000000 --- a/bevy_widgets/bevy_toolbar/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "bevy_toolbar" -version = "0.1.0" -edition = "2021" - -[dependencies] -bevy.workspace = true - -[lints] -workspace = true diff --git a/bevy_widgets/bevy_toolbar/src/lib.rs b/bevy_widgets/bevy_toolbar/src/lib.rs deleted file mode 100644 index 40a3d0fb..00000000 --- a/bevy_widgets/bevy_toolbar/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! A toolbar widget for Bevy applications. -//! -//! Toolbars are a common UI element in many applications, providing quick access to frequently used commands, -//! and typically display small icons with on-hover tooltips. - -/// an add function that adds two numbers -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/bevy_widgets/bevy_tooltips/Cargo.toml b/bevy_widgets/bevy_tooltips/Cargo.toml deleted file mode 100644 index 3eccb675..00000000 --- a/bevy_widgets/bevy_tooltips/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "bevy_tooltips" -version = "0.1.0" -edition = "2021" - -[dependencies] -bevy.workspace = true - -[lints] -workspace = true diff --git a/bevy_widgets/bevy_tooltips/src/lib.rs b/bevy_widgets/bevy_tooltips/src/lib.rs deleted file mode 100644 index 1b1a68ca..00000000 --- a/bevy_widgets/bevy_tooltips/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! A tooltip system for Bevy applications, providing contextual information on hover. - -/// an add function that adds two numbers -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/crates/bevy_asset_preview/Cargo.toml b/crates/bevy_asset_preview/Cargo.toml deleted file mode 100644 index c2b3ef6f..00000000 --- a/crates/bevy_asset_preview/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "bevy_asset_preview" -version = "0.1.0" -edition = "2021" - -[dependencies] -bevy.workspace = true \ No newline at end of file diff --git a/crates/bevy_asset_preview/src/lib.rs b/crates/bevy_asset_preview/src/lib.rs deleted file mode 100644 index 1a13890e..00000000 --- a/crates/bevy_asset_preview/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -use bevy::prelude::*; - -/// This crate is a work in progress and is not yet ready for use. -/// The intention is to provide a way to load/render/unload assets in the background and provide previews of them in the Bevy Editor. -/// For 2d assets this will be a simple sprite, for 3d assets this will require a quick render of the asset at a low resolution, just enough for a user to be able to tell quickly what it is. -/// This code may be reused for the Bevy Marketplace Viewer to provide previews of assets and plugins. -/// So long as the assets are unchanged, the previews will be cached and will not need to be re-rendered. -/// In theory this can be done passively in the background, and the previews will be ready when the user needs them. -pub struct AssetPreviewPlugin; - -impl Plugin for AssetPreviewPlugin { - fn build(&self, _app: &mut App) {} -} diff --git a/crates/bevy_localization/Cargo.toml b/crates/bevy_localization/Cargo.toml deleted file mode 100644 index d87bba17..00000000 --- a/crates/bevy_localization/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "bevy_localization" -version = "0.1.0" -edition = "2021" - -[dependencies] - -[lints] -workspace = true diff --git a/crates/bevy_localization/src/lib.rs b/crates/bevy_localization/src/lib.rs deleted file mode 100644 index fc729f80..00000000 --- a/crates/bevy_localization/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! A localization framework for Bevy applications, backed by Fluent. - -/// an add function that adds two numbers -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/crates/bevy_transform_gizmos/Cargo.toml b/crates/bevy_transform_gizmos/Cargo.toml deleted file mode 100644 index bd69c07f..00000000 --- a/crates/bevy_transform_gizmos/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "bevy_transform_gizmos" -version = "0.1.0" -edition = "2021" - -[dependencies] - -[lints] -workspace = true diff --git a/crates/bevy_transform_gizmos/src/lib.rs b/crates/bevy_transform_gizmos/src/lib.rs deleted file mode 100644 index d3c9da78..00000000 --- a/crates/bevy_transform_gizmos/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -//! Gizmos used for the user interface to manipulate transforms.