Skip to content
Open
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
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
ignore:
# Bincode is unmaintained and considered complete (sans CVE fixes). v3
# exists but is effectively an empty crate. For context, see:
# https://crates.io/crates/bincode/3.0.0
- dependency-name: bincode
update-types: ["version-update:semver-major"]
groups:
cargo:
patterns:
Expand Down
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/brioche-packed-userland-exec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition.workspace = true
rust-version.workspace = true

[dependencies]
bincode = "2.0.0-rc.3"
brioche-pack = { workspace = true }
brioche-resources = { path = "../brioche-resources" }
bstr = "1.12.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/brioche-packed-userland-exec/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ fn error_summary(error: &PackedError) -> &'static str {
brioche_pack::ExtractPackError::MalformedMarker => {
"malformed marker at the end of the packed program"
}
brioche_pack::ExtractPackError::InvalidPack(_) => "failed to parse pack: bincode error",
brioche_pack::ExtractPackError::InvalidPack(_) => "failed to deserialize pack data",
brioche_pack::ExtractPackError::TryFromIntError(_) => "integer conversion error",
},
PackedError::PackResourceDirError(error) => match error {
Expand Down
2 changes: 1 addition & 1 deletion crates/brioche-packer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ color-eyre = "0.6.5"
eyre = "0.6.12"
globset = "0.4.18"
goblin = "0.10.4"
runnable-core = { path = "../runnable-core" }
runnable-core = { path = "../runnable-core", features = ["schema"] }
schemars = "1.2.0"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.149" }
Expand Down
9 changes: 6 additions & 3 deletions crates/runnable-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ version = "0.1.0"
edition.workspace = true
rust-version.workspace = true

[features]
default = []
schema = ["dep:schemars", "serde_with/schemars_1"]

[dependencies]
bincode = "2.0.0-rc.3"
brioche-resources = { path = "../brioche-resources" }
bstr = "1.12.1"
schemars = "1.2.0"
schemars = { version = "1.2.0", optional = true }
serde = { version = "1.0.228", features = ["derive"] }
serde_with = { version = "3.16.1", features = ["schemars_1"] }
serde_with = "3.16.1"
thiserror = "2.0.17"
tick-encoding = "0.1.3"

Expand Down
1 change: 1 addition & 0 deletions crates/runnable-core/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ where
}
}

#[cfg(feature = "schema")]
impl<T> serde_with::schemars_1::JsonSchemaAs<T> for TickEncoded {
fn schema_name() -> Cow<'static, str> {
"TickEncoded".into()
Expand Down
75 changes: 14 additions & 61 deletions crates/runnable-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ pub mod encoding;
pub const FORMAT: &str = "application/vnd.brioche.runnable-v0.1.0+json";

#[serde_with::serde_as]
#[derive(
Debug,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct Runnable {
pub command: Template,
Expand All @@ -33,14 +27,8 @@ pub struct Runnable {
pub source: Option<RunnableSource>,
}

#[derive(
Debug,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum ArgValue {
Expand All @@ -52,15 +40,8 @@ pub enum ArgValue {
}

#[serde_with::serde_as]
#[derive(
Debug,
Clone,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum EnvValue {
Expand Down Expand Up @@ -89,16 +70,8 @@ pub enum EnvValue {
}

#[serde_with::serde_as]
#[derive(
Debug,
Clone,
Default,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct Template {
pub components: Vec<TemplateComponent>,
Expand Down Expand Up @@ -163,15 +136,8 @@ impl Template {
}

#[serde_with::serde_as]
#[derive(
Debug,
Clone,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum TemplateComponent {
Expand All @@ -192,29 +158,16 @@ pub enum TemplateComponent {
},
}
#[serde_with::serde_as]
#[derive(
Debug,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RunnableSource {
pub path: RunnablePath,
}

#[serde_with::serde_as]
#[derive(
Debug,
Clone,
serde::Serialize,
serde::Deserialize,
schemars::JsonSchema,
bincode::Encode,
bincode::Decode,
)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum RunnablePath {
Expand Down