# The workspace: four crates, one version, one lockfile, and the second # feature resolver, under which a feature enabled for a build dependency, a # procedural macro or a development dependency stays where it was enabled # and is not unified into the library that ships. The four members are the # calendar, the identifier it generates, and the two instruments that look # at it. [workspace] resolver = "2" members = [ "crates/loic", "crates/loid", "crates/loic-cli", "crates/loic-gui", ] # Everything a member inherits with `.workspace = true`: the version, stated # here and in one other place, below; the authorship; the repository; and # the license file, read from the workspace root. A member that restated # any of these would be a second source of truth, and the calendar has no # use for a second source of anything. [workspace.package] version = "1.0.0" authors = ["The Loic Calendar Consortium"] repository = "https://git.lo.sh/lo/loic" license-file = "LICENSE" # The core crate's dependency specification, stated here, once. Members # depend on it with `loic.workspace = true`, so a version bump is one edit # here and one above, and cannot drift between the crate that defines the # number and the crates that require it. The path serves the workspace; the # version serves the registry, which receives no paths and must be told a # number it can find. [workspace.dependencies] loic = { path = "crates/loic", version = "1.0.0" } # The release profile: every optimisation the compiler offers, thin # link-time optimisation across the crate graph, a single codegen unit so # that nothing is left un-inlined for want of visibility, symbols stripped # from the binary, and `panic = "abort"`. The last matters to the oracle, # whose panic hook prints its sermon and exits before the abort could ever # run: the abort is there for the panic no hook expected, and is never # reached by the ones that were. [profile.release] opt-level = 3 lto = "thin" codegen-units = 1 strip = "symbols" panic = "abort" # Every dependency compiled at the highest optimisation level too, stated # rather than assumed. The 512-bit arithmetic that `now()` runs on lives in # `bnum`, not in this workspace, and its speed is decided here. [profile.release.package."*"] opt-level = 3 # The development profile, lightly optimised: a test suite that draws twenty # thousand entropy defaults to measure the collapse rate should not have to # do so through unoptimised 512-bit arithmetic, and a debug build that # nobody has the patience to run is a debug build that finds nothing. [profile.dev] opt-level = 1 # The benchmark profile restates the release profile's three optimisation # choices, so that a number measured under `cargo bench` describes the code # that ships and not some gentler relative of it. A benchmark of the wrong # binary is a fact about nothing. [profile.bench] opt-level = 3 lto = "thin" codegen-units = 1