summaryrefslogtreecommitdiff
path: root/server/Cargo.toml
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-01-29 00:34:30 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-01-29 00:34:30 +0100
commit05b674190f26e2a58cc7b7288586c031552d50f3 (patch)
tree452035e852a7012061c9424a9dc0f56fcad129ee /server/Cargo.toml
parent145b93302cbb7cb090c90fd07ed4ebabf742e453 (diff)
Add git-server to docker-compose
To make a githook that can run on alpine images (using musl) they need to be cross-compiled. Then it became apparent that the githook binary was pulling in all the same dependencies as the server was. This is not good, but apparently also not something Rust/Cargo has figured out. RFC:s has been shutdown. workspace might be an option but then I probably need to also add a "code shared by both githook and server" library that both can link. Problem for another day.
Diffstat (limited to 'server/Cargo.toml')
-rw-r--r--server/Cargo.toml25
1 files changed, 18 insertions, 7 deletions
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 5b337e0..64d6796 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -5,24 +5,35 @@ edition = "2021"
default-run = "eyeballs"
[dependencies]
+# Used by all binaries, either because its needed or because the library is small enough I don't care
anyhow = "1.0"
futures = "0.3.31"
-ldap3 = { version = "0.11.5", default-features = false, features = [ "native-tls", "tls", "tls-native", "tokio-native-tls" ] }
pathdiff = "0.2.3"
rmp-serde = "1.3"
-rocket = { version = "0.5.1", features = ["json", "secrets"] }
-rocket_db_pools = { version = "0.2.0", features = ["sqlx_mysql"] }
serde = { version = "1.0", features = ["derive"] }
-sqlx = { version = "0.7.0", default-features = false, features = ["macros", "migrate"] }
time = "0.3.34"
-tokio = { version = "1", features = ["process"] }
-utoipa = { version = "5", features = ["rocket_extras"] }
-utoipa-swagger-ui = { version = "9", features = ["rocket", "vendored"], default-features = false }
+tokio = { version = "1", features = ["full"] }
+
+# Optional dependencies, listed in features
+ldap3 = { version = "0.11.5", default-features = false, features = [ "native-tls", "tls", "tls-native", "tokio-native-tls" ], optional = true }
+rocket = { version = "0.5.1", features = ["json", "secrets"], optional = true }
+rocket_db_pools = { version = "0.2.0", features = ["sqlx_mysql"], optional = true }
+sqlx = { version = "0.7.0", default-features = false, features = ["macros", "migrate"], optional = true }
+utoipa = { version = "5", features = ["rocket_extras"], optional = true }
+utoipa-swagger-ui = { version = "9", features = ["rocket", "vendored"], default-features = false, optional = true }
[dev-dependencies]
stdext = "0.3.3"
testdir = "0.9.3"
+[features]
+build-server = ["ldap3", "rocket", "rocket_db_pools", "sqlx", "utoipa", "utoipa-swagger-ui"]
+
+[[bin]]
+name = "eyeballs"
+path = "src/main.rs"
+required-features = ["build-server"]
+
[[bin]]
name = "eyeballs-githook"
path = "src/githook.rs"