[workspace]
members = [
  "examples/*",
  "homestar-functions/*",
  "homestar-invocation",
  "homestar-runtime",
  "homestar-schemas",
  "homestar-wasm",
  "homestar-workflow",
  "homestar-workspace-hack",
]
default-members = [
  "homestar-invocation",
  "homestar-runtime",
  "homestar-wasm",
  "homestar-workflow",
]
resolver = "2"

[workspace.package]
authors = ["The Fission Authors"]
categories = ["development-tools", "wasm", "web-programming"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/ipvm-wg/homestar"
rust-version = "1.75.0"
version = "0.3.0"

[workspace.dependencies]
anyhow = { version = "1.0", features = ["backtrace"] }
async-trait = "0.1"
atomic_refcell = "0.1"
byte-unit = { version = "4.0", default-features = false }
chrono = { version = "0.4", default-features = false, features = [
  "clock",
  "std",
] }
const_format = "0.2"
enum-assoc = "1.1"
enum-as-inner = "0.6"
faststr = { version = "0.2", default-features = false, features = ["serde"] }
futures = { version = "0.3", default-features = false }
homestar-workspace-hack = "0.1"
humantime = { version = "2.1", default-features = false }
indexmap = { version = "2.2", default-features = false, features = ["serde"] }
itertools = "0.12"
libipld = { version = "0.16", default-features = false, features = [
  "serde-codec",
  "dag-cbor",
  "dag-json",
  "derive",
] }
libsqlite3-sys = { version = "0.27", default-features = false, features = [
  "bundled",
] }
rand = { version = "0.8", default-features = false }
schemars = { version = "0.8", features = ["arrayvec", "url"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0", default-features = false, features = [
  "raw_value",
] }
serde_ipld_dagcbor = { version = "0.4", default-features = false, features = [
  "std",
] }
thiserror = "1.0"
tokio = { version = "1.36", default-features = false, features = [
  "fs",
  "io-util",
  "io-std",
  "macros",
  "rt",
  "rt-multi-thread",
  "signal",
  "sync",
  "tracing",
] }
tracing = { version = "0.1", default-features = false }
ucan = { version = "0.4", default-features = false }
ucan-key-support = "0.1"

[profile.dev.package."*"]
debug-assertions = false

# Speedup build on macOS
# See https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#splitting-debug-information
[profile.dev]
debug-assertions = true
split-debuginfo = "unpacked"

[profile.release]
# compiling with link time optimizations (LTO)
lto = true

[profile.release.package.homestar-invocation]
debug-assertions = false

[profile.release.package.homestar-workflow]
debug-assertions = false

[profile.release.package.homestar-runtime]
# Will slow-down compile, but improve perf on generated code.
codegen-units = 1
debug-assertions = false

[profile.release.package.homestar-wasm]
# match wasmtime
opt-level = 0
debug-assertions = false

# Example: `cargo build -p homestar-functions-test --target wasm32-unknown-unknown --profile release-wasm-fn`
[profile.release-wasm-fn]
inherits = "release"
# Will slow-down compile, but improve perf on generated code.
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z" # 'z' to optimize "aggressively" for size
# Strip debug symbols
# "symbols" issue: https://github.com/rust-lang/rust/issues/93294
strip = "symbols"
# Amount of debug information.
# 0/false: no debug info at all; 1: line tables only; 2/true: full debug info
debug = false
debug-assertions = false

# Using the workspace-hack via this patch directive means that it only applies
# while building within this workspace. If another workspace imports a crate
# from here via a git dependency, it will not have the workspace-hack applied
# to it.
[patch.crates-io.homestar-workspace-hack]
path = "homestar-workspace-hack"