Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Enable Cranelift for debug builds, improving iterative compile times
[unstable]
codegen-backend = true

[profile.dev]
codegen-backend = "cranelift"

[build]
rustflags = ["--cfg", "tokio_unstable"]

# Windows has stack overflows when calling from Tauri, so we increase the default stack size used by the compiler
[target.'cfg(windows)']
rustflags = ["-C", "link-args=/STACK:16777220", "--cfg", "tokio_unstable"]
rustflags = ["--cfg", "tokio_unstable", "-C", "link-args=/STACK:16777220"]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld"

[build]
rustflags = ["--cfg", "tokio_unstable"]
5 changes: 5 additions & 0 deletions .github/workflows/turbo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
FORCE_COLOR: 3
# Make cargo nextest successfully ignore projects without tests
NEXTEST_NO_TESTS: pass
# Fail on warnings in CI
# (but don't do this in the root `Cargo.toml`,
# since we don't want warnings to become errors
# while developing)
RUSTFLAGS: -Dwarnings

steps:
- name: 📥 Check out code
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ todo = "warn"
unnested_or_patterns = "warn"
wildcard_dependencies = "warn"

[workspace.lints.rust]
# Turn warnings into errors by default
warnings = "deny"

[patch.crates-io]
wry = { git = "https://github.com/modrinth/wry", rev = "f2ce0b0" }

Expand Down
2 changes: 1 addition & 1 deletion apps/labrinth/src/database/models/version_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ mod tests {

#[test]
fn test_version_sorting() {
let versions = vec![
let versions = [
get_version(4, None, months_ago(6)),
get_version(3, None, months_ago(7)),
get_version(2, Some(1), months_ago(6)),
Expand Down
6 changes: 0 additions & 6 deletions apps/labrinth/src/routes/v2/version_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ pub struct InitialVersionData {
pub ordering: Option<i32>,
}

#[derive(Serialize, Deserialize, Clone)]
struct InitialFileData {
#[serde(default = "HashMap::new")]
pub file_types: HashMap<String, Option<FileType>>,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how this wasn't triggering a dead code warning before, but apparently this is unused. On standard codegen this doesn't emit a warning. On cranelift this does.

// under `/api/v1/version`
#[post("version")]
pub async fn version_create(
Expand Down
11 changes: 4 additions & 7 deletions packages/app-lib/src/state/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,14 @@ impl CacheValue {
}
}

#[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Copy, Clone)]
#[derive(
Deserialize, Serialize, PartialEq, Eq, Debug, Copy, Clone, Default,
)]
#[serde(rename_all = "snake_case")]
pub enum CacheBehaviour {
/// Serve expired data. If fetch fails / launcher is offline, errors are ignored
/// and expired data is served
#[default]
StaleWhileRevalidateSkipOffline,
// Serve expired data, revalidate in background
StaleWhileRevalidate,
Expand All @@ -533,12 +536,6 @@ pub enum CacheBehaviour {
Bypass,
}

impl Default for CacheBehaviour {
fn default() -> Self {
Self::StaleWhileRevalidateSkipOffline
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also don't know how this wasn't caught on main CI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is most likely explained due to the usage of different Rust versions. Nightly's Clippy is ahead of stable when it comes to new lints (and regressions).

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CachedEntry {
id: String,
Expand Down
9 changes: 8 additions & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
[toolchain]
channel = "1.89.0"
channel = "nightly-2025-09-18"
profile = "default"
components = [
"rust-analyzer",
# use cranelift in debug builds to improve compile times
# also see `.cargo/config.toml`
"rustc-codegen-cranelift-preview"
]