Skip to content

Commit 83af0e5

Browse files
committed
Initial commit from template
0 parents  commit 83af0e5

Some content is hidden

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

51 files changed

+9411
-0
lines changed

.cargo/config_fast_builds.toml

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Copy this file to `config.toml` to speed up your builds.
2+
#
3+
# # Faster linker
4+
#
5+
# One of the slowest aspects of compiling large Rust programs is the linking time. This file configures an
6+
# alternate linker that may improve build times. When choosing a new linker, you have two options:
7+
#
8+
# ## LLD
9+
#
10+
# LLD is a linker from the LLVM project that supports Linux, Windows, MacOS, and WASM. It has the greatest
11+
# platform support and the easiest installation process. It is enabled by default in this file for Linux
12+
# and Windows. On MacOS, the default linker yields higher performance than LLD and is used instead.
13+
#
14+
# To install, please scroll to the corresponding table for your target (eg. `[target.x86_64-pc-windows-msvc]`
15+
# for Windows) and follow the steps under `LLD linker`.
16+
#
17+
# For more information, please see LLD's website at <https://lld.llvm.org>.
18+
#
19+
# ## Mold
20+
#
21+
# Mold is a newer linker written by one of the authors of LLD. It boasts even greater performance, specifically
22+
# through its high parallelism, though it only supports Linux.
23+
#
24+
# Mold is disabled by default in this file. If you wish to enable it, follow the installation instructions for
25+
# your corresponding target, disable LLD by commenting out its `-Clink-arg=...` line, and enable Mold by
26+
# *uncommenting* its `-Clink-arg=...` line.
27+
#
28+
# There is a fork of Mold named Sold that supports MacOS, but it is unmaintained and is about the same speed as
29+
# the default ld64 linker. For this reason, it is not included in this file.
30+
#
31+
# For more information, please see Mold's repository at <https://github.com/rui314/mold>.
32+
#
33+
# # Nightly configuration
34+
#
35+
# Be warned that the following features require nightly Rust, which is expiremental and may contain bugs. If you
36+
# are having issues, skip this section and use stable Rust instead.
37+
#
38+
# There are a few unstable features that can improve performance. To use them, first install nightly Rust
39+
# through Rustup:
40+
#
41+
# ```
42+
# rustup toolchain install nightly
43+
# ```
44+
#
45+
# Finally, uncomment the lines under the `Nightly` heading for your corresponding target table (eg.
46+
# `[target.x86_64-unknown-linux-gnu]` for Linux) to enable the following features:
47+
#
48+
# ## `share-generics`
49+
#
50+
# Usually rustc builds each crate separately, then combines them all together at the end. `share-generics` forces
51+
# crates to share monomorphized generic code, so they do not duplicate work.
52+
#
53+
# In other words, instead of crate 1 generating `Foo<String>` and crate 2 generating `Foo<String>` separately,
54+
# only one crate generates `Foo<String>` and the other adds on to the pre-exiting work.
55+
#
56+
# Note that you may have some issues with this flag on Windows. If compiling fails due to the 65k symbol limit,
57+
# you may have to disable this setting. For more information and possible solutions to this error, see
58+
# <https://github.com/bevyengine/bevy/issues/1110>.
59+
#
60+
# ## `threads`
61+
#
62+
# This option enables rustc's parallel frontend, which improves performance when parsing, type checking, borrow
63+
# checking, and more. We currently set `threads=0`, which defaults to the amount of cores in your CPU.
64+
#
65+
# For more information, see the blog post at <https://blog.rust-lang.org/2023/11/09/parallel-rustc.html>.
66+
67+
[target.x86_64-unknown-linux-gnu]
68+
linker = "clang"
69+
rustflags = [
70+
# LLD linker
71+
#
72+
# You may need to install it:
73+
#
74+
# - Ubuntu: `sudo apt-get install lld clang`
75+
# - Fedora: `sudo dnf install lld clang`
76+
# - Arch: `sudo pacman -S lld clang`
77+
"-Clink-arg=-fuse-ld=lld",
78+
79+
# Mold linker
80+
#
81+
# You may need to install it:
82+
#
83+
# - Ubuntu: `sudo apt-get install mold clang`
84+
# - Fedora: `sudo dnf install mold clang`
85+
# - Arch: `sudo pacman -S mold clang`
86+
# "-Clink-arg=-fuse-ld=/usr/bin/mold",
87+
88+
# Nightly
89+
# "-Zshare-generics=y",
90+
# "-Zthreads=0",
91+
]
92+
93+
[target.x86_64-apple-darwin]
94+
rustflags = [
95+
# LLD linker
96+
#
97+
# The default ld64 linker is faster, you should continue using it instead.
98+
#
99+
# You may need to install it:
100+
#
101+
# Brew: `brew install llvm`
102+
# Manually: <https://lld.llvm.org/MachO/index.html>
103+
# "-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
104+
105+
# Nightly
106+
# "-Zshare-generics=y",
107+
# "-Zthreads=0",
108+
]
109+
110+
[target.aarch64-apple-darwin]
111+
rustflags = [
112+
# LLD linker
113+
#
114+
# The default ld64 linker is faster, you should continue using it instead.
115+
#
116+
# You may need to install it:
117+
#
118+
# Brew: `brew install llvm`
119+
# Manually: <https://lld.llvm.org/MachO/index.html>
120+
# "-Clink-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
121+
122+
# Nightly
123+
# "-Zshare-generics=y",
124+
# "-Zthreads=0",
125+
]
126+
127+
[target.x86_64-pc-windows-msvc]
128+
# LLD linker
129+
#
130+
# You may need to install it:
131+
#
132+
# ```
133+
# cargo install -f cargo-binutils
134+
# rustup component add llvm-tools
135+
# ```
136+
linker = "rust-lld.exe"
137+
rustdocflags = ["-Clinker=rust-lld.exe"]
138+
rustflags = [
139+
# Nightly
140+
# "-Zshare-generics=n", # This needs to be off if you use dynamic linking on Windows.
141+
# "-Zthreads=0",
142+
]
143+
144+
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
145+
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
146+
# [profile.dev]
147+
# debug = 1

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.github/workflows/ci.yaml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUSTFLAGS: --deny warnings
12+
RUSTDOCFLAGS: --deny warnings
13+
14+
jobs:
15+
# Check formatting.
16+
format:
17+
name: Format
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install Rust toolchain
25+
uses: dtolnay/rust-toolchain@nightly
26+
with:
27+
components: rustfmt
28+
29+
- name: Check formatting
30+
run: cargo fmt --all -- --check
31+
32+
# Run Clippy lints.
33+
clippy:
34+
name: Clippy
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 30
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
41+
- name: Install Rust toolchain
42+
uses: dtolnay/rust-toolchain@stable
43+
with:
44+
components: clippy
45+
46+
- name: Install dependencies
47+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
48+
49+
- name: Populate target directory from cache
50+
uses: Leafwing-Studios/cargo-cache@v2
51+
52+
- name: Run Clippy lints
53+
run: cargo clippy --workspace --all-features --all-targets -- --deny warnings
54+
55+
# Check documentation.
56+
doc:
57+
name: Docs
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 30
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
64+
- name: Install Rust toolchain
65+
uses: dtolnay/rust-toolchain@stable
66+
67+
- name: Install dependencies
68+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
69+
70+
- name: Populate target directory from cache
71+
uses: Leafwing-Studios/cargo-cache@v2
72+
73+
- name: Check documentation
74+
run: cargo doc --workspace --all-features --document-private-items --no-deps
75+
76+
# Run tests.
77+
test:
78+
name: Tests
79+
runs-on: ubuntu-latest
80+
timeout-minutes: 30
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
85+
- name: Install Rust toolchain
86+
uses: dtolnay/rust-toolchain@stable
87+
88+
- name: Install dependencies
89+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
90+
91+
- name: Populate target directory from cache
92+
uses: Leafwing-Studios/cargo-cache@v2
93+
94+
- name: Run tests
95+
run: |
96+
cargo test --workspace --all-features --all-targets
97+
# TODO: Workaround for https://github.com/rust-lang/cargo/issues/6669
98+
cargo test --workspace --all-features --doc

0 commit comments

Comments
 (0)