[workspace]
members = [
    "linker-diff",
    "linker-layout",
    "linker-trace",
    "linker-utils",
    "wild",
    "libwild",
    "benchmarks/runner",
]
resolver = "2"

[workspace.package]
repository = "https://github.com/davidlattimore/wild"
license = "MIT OR Apache-2.0"
version = "0.8.0"
readme = "README.md"
rust-version = "1.90"
edition = "2024"

# Note, the versions listed here are minimum supported versions and should only be increased when
# (a) there's a new major version which we wouldn't get if we didn't increase our required version
# or (b) we've determined that the minimum version listed here is no longer correct, since we're
# using a feature of the crate that isn't in that version. In the case of (b) we should increase to
# the lowest version that we can support.

[workspace.dependencies]
anyhow = "1.0.97"
ar = "0.9.0"
atomic-take = "1.0.0"
bitflags = "2.4.0"
blake3 = { version = "1.0.0", features = ["rayon"] }
bumpalo-herd = "0.1.2"
bytesize = "2.0.0"
clap = { version = "4.1.0", features = ["derive"] }
colored = "3.0.0"
colosseum = "0.2.2"
crossbeam-queue = "0.3.10"
crossbeam-utils = "0.8.18"
crossbeam-channel = "0.5.15"
derive_more = { version = "2.0.1", features = ["debug"] }
dhat = { version = "0.3.3" }
fallible-iterator = "0.3.0"
flate2 = { version = "1.1.0", features = ["zlib-rs"] }
foldhash = "0.2.0"
gimli = "0.32.0"
git-version = "0.3.9"
glob = "0.3.2"
hashbrown = "0.16.0"
hex = "0.4.0"
iced-x86 = { version = "1.17.0", default-features = false, features = [
    "std",
    "decoder",
    "gas",
] }
indexmap = "2.9.0"
indicatif = "0.18.3"
itertools = "0.14.0"
jobserver = "0.1.30"
leb128 = "0.2.5"
libc = "0.2.171"
memchr = "2.6.0"
memmap2 = "0.9.0"
mimalloc = { version = "0.1", default-features = false }
object = { version = "0.38.1", default-features = false, features = [
    "elf",
    "read_core",
    "std",
    "unaligned",
    "archive",
] }
os_info = "3.0.0"
paste = "1.0.15"
perf-event = "0.4.8"
perfetto-recorder = "0.3.0"
postcard = { version = "1.1.1", features = ["use-std"] }
rayon = "1.5.1"
rstest = "0.26.1"
serde = { version = "1.0.219", features = ["derive"] }
serde-keyvalue = "0.1.0"
sharded-offset-map = "0.2.0"
sharded-vec-writer = "0.4.0"
smallvec = "1.6.1"
strum = { version = "0.27.0", features = ["derive"] }
symbolic-common = "12.0.0"
symbolic-demangle = {version = "12.0.0", default-features = false, features = ["cpp", "rust"]}
tabled = "0.20.0"
tempfile = "3.0.2"
thread_local = "1.1.9"
toml = "0.9.0"
tracing = "0.1.35"
tracing-subscriber = { version = "0.3.16", default-features = false, features = [
    "env-filter",
    "fmt",
    "registry",
] }
uuid = { version = "1.0.0", features = ["v4"] }
wait-timeout = "0.2.0"
wait4 = "0.1.3"
which = "8.0.0"
winnow = { version = "0.7.10", features = ["simd"] }
zerocopy = { version = "0.8.27", features = ["derive"] }
zstd = "0.13.0"

[profile.opt-debug]
inherits = "release"
debug = true

# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
strip = true

# In CI, we disable debug info. This gives us faster builds. It also reduces the size of the target
# directory, allowing us to fit more into cache. The only resulting loss is line numbers in
# backtraces. If we really wanted those, we could set `debug = "line-tables-only"`, however it seems
# unlikely that we'd need line numbers in backtraces all that often, so we don't for now.
[profile.ci]
inherits = "dev"
debug = 0

[workspace.lints.clippy]
# It's not always desirable to use if-let instead of a match, especially if you might later end up
# adding more branches to the match.
single_match = "allow"

# Sure, less arguments is good, but it's a trade-off. Sometimes you have a complex function that
# you'd like to split by extracting part of it out into a new function. That new function might
# have lots of arguments. It might be possible to group some of those arguments together into some
# new struct, but not always. Given the choice between a function that's too large and does too
# much vs a function that has too many arguments, it's sometimes best to pick the latter.
# Especially since that function is generally only ever called from one place and the arguments all
# have distinct types.
too_many_arguments = "allow"

# I might add additional fields later, so why make me remove ..Default::default()?
needless_update = "allow"

# Depending on circumstances, it's often clearer to use an if-else.
bool_to_int_with_if = "allow"

# Possibly at some point we should look into these, but we have quite a lot.
cast_possible_truncation = "allow"

# Might revisit this later.
cast_possible_wrap = "allow"

# Often we do this in conjunction with a call to wrapping_add, so it's fine.
cast_sign_loss = "allow"

# I like initialising things as `Default::default`, since if I change the type of the field, often I
# don't need to change the initialisation.
default_trait_access = "allow"

# If we were writing a library that we expected to get a lot of use and which needed high quality
# docs, this might be important.
doc_markdown = "allow"

# This doesn't seem like a problem to me.
explicit_deref_methods = "allow"

# This just doesn't seem all that important.
ignored_unit_patterns = "allow"

# Doesn't seem like a big issue to me.
items_after_statements = "allow"

# We sometimes have iterators that don't implement the Iterator trait, but instead just have an
# inherent implementation of `next`. This makes navigating the code easier, since all uses of that
# `next` method can easily be found.
iter_not_returning_iterator = "allow"

# Indexing into a vec may panic. That's true, and if it does, that's a bug. The fact that we're
# matching on the element of the vec is irrelevant.
indexing_slicing = "allow"

# Sometimes you have a comment on one arm that doesn't apply to the other arms. Clippy isn't smart
# enough to see that the comment is what is different.
match_same_arms = "allow"

# Documenting all functions that return results seems like a lot of work and there are probably
# other docs that would be higher value to write instead.
missing_errors_doc = "allow"

# Should probably fix this, but not now.
mut_mut = "allow"

# Have observed some false positives with this. Also not 100% sure that it's always more readable.
redundant_closure_for_method_calls = "allow"

# The proposed alternative of using an enum doesn't always apply.
struct_excessive_bools = "allow"

# Could revisit this in future. For now, it doesn't seem at all important.
struct_field_names = "allow"

# It'd probably be good to fix some of these. Although for some it may not necessarily help
# readability.
too_many_lines = "allow"

# Some of our tests do this and there doesn't seem to be much value in changing them.
unreadable_literal = "allow"

trivially_copy_pass_by_ref = "warn"
uninlined_format_args = "warn"
unnecessary_wraps = "warn"
unused_self = "warn"
wildcard_imports = "warn"
manual_assert = "warn"
explicit_iter_loop = "warn"
if_not_else = "warn"
implicit_clone = "warn"
inconsistent_struct_constructor = "warn"
map_unwrap_or = "warn"
match_wildcard_for_single_variants = "warn"
needless_pass_by_value = "warn"
redundant_else = "warn"
semicolon_if_nothing_returned = "warn"
range_plus_one = "warn"
must_use_candidate = "warn"
case_sensitive_file_extension_comparisons = "warn"
cloned_instead_of_copied = "warn"
cast_lossless = "warn"
needless_pass_by_ref_mut = "warn"
