diff --git a/Cargo.lock b/Cargo.lock index b12961a..adc553c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -529,7 +529,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=2d2c8853727929a7b350b3017c9ff86cb2ec8911#2d2c8853727929a7b350b3017c9ff86cb2ec8911" +source = "git+https://github.com/ComlineProject/comline-rust?rev=dd1c29e6560a0ffd7893c59715b31d43b88c585f#dd1c29e6560a0ffd7893c59715b31d43b88c585f" dependencies = [ "comline-codegen", "comline-core", @@ -539,7 +539,7 @@ dependencies = [ [[package]] name = "comline-codegen-typescript" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-typescript?rev=c44b39d68035bd968cec0cd75afb6c6230c4ab76#c44b39d68035bd968cec0cd75afb6c6230c4ab76" +source = "git+https://github.com/ComlineProject/comline-typescript?rev=d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc#d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc" dependencies = [ "comline-codegen", "comline-core", diff --git a/Cargo.toml b/Cargo.toml index 9045adb..c237d11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,8 +59,8 @@ comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = # `comline-codegen`. comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "2d2c8853727929a7b350b3017c9ff86cb2ec8911", optional = true } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "c44b39d68035bd968cec0cd75afb6c6230c4ab76", optional = true } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "dd1c29e6560a0ffd7893c59715b31d43b88c585f", optional = true } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "d377fbf07cf6c0f004e9d5dd4fbd6fa15ea9d0bc", optional = true } # `comline conformance`: the conformance runner (corpus loading, judging, # profile proofs) and its case format, a public spec. Pinned by git rev. comline-runtime-conformance = { git = "https://github.com/ComlineProject/runtime", rev = "8f8c0cb6fb0bc3a734aafbdbbf187fb9da73e00d" } diff --git a/tests/cli/generation.rs b/tests/cli/generation.rs index a1978b5..67e1ea2 100644 --- a/tests/cli/generation.rs +++ b/tests/cli/generation.rs @@ -237,10 +237,12 @@ fn config_idp_wire_format_reaches_the_rust_generator() { .assert() .success(); - let chat = fs::read_to_string(project.join("generated/rust/chat.rs")).unwrap(); + // The package's wire format is defined once, in `connection.rs`; the + // protocol files re-export it. + let connection = fs::read_to_string(project.join("generated/rust/connection.rs")).unwrap(); assert!( - chat.contains("pub type Format = comline_runtime::format::Json;"), - "{chat}" + connection.contains("pub type Format = comline_runtime::format::Json;"), + "{connection}" ); } @@ -256,8 +258,9 @@ fn without_a_wire_key_a_protocol_is_on_a_packed_connection() { .success(); let chat = fs::read_to_string(project.join("generated/rust/chat.rs")).unwrap(); + // `Format` is defined once, in `connection.rs`, and re-exported here. assert!( - chat.contains("pub type Format = comline_runtime::format::Packed;"), + chat.contains("pub use crate::connection::{CONNECTION_IR_HASH, Format};"), "{chat}" ); assert!( @@ -267,6 +270,10 @@ fn without_a_wire_key_a_protocol_is_on_a_packed_connection() { assert!(!chat.contains("JsonRpcFraming"), "{chat}"); // The package's `Services` and `serve`, beside the schemas. let connection = fs::read_to_string(project.join("generated/rust/connection.rs")).unwrap(); + assert!( + connection.contains("pub type Format = comline_runtime::format::Packed;"), + "{connection}" + ); assert!(connection.contains("pub struct Services<"), "{connection}"); } diff --git a/tests/fixtures/generators/Cargo.lock b/tests/fixtures/generators/Cargo.lock index a0ac331..ed44efb 100644 --- a/tests/fixtures/generators/Cargo.lock +++ b/tests/fixtures/generators/Cargo.lock @@ -79,12 +79,12 @@ dependencies = [ [[package]] name = "comline-catalog" version = "0.11.0" -source = "git+https://github.com/ComlineProject/specification?rev=6d39fc363ab3dce9d1c4876b0d414edb375e25e9#6d39fc363ab3dce9d1c4876b0d414edb375e25e9" +source = "git+https://github.com/ComlineProject/specification?rev=16dfe40d835b85b45de07131181339fe3e9f0ccb#16dfe40d835b85b45de07131181339fe3e9f0ccb" [[package]] name = "comline-codegen" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=05771e0679ff514da3ba73a3b0b94643e5262fe5#05771e0679ff514da3ba73a3b0b94643e5262fe5" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-core", "eyre", @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=df91e2e0a416cab594303f11d44a6555a72f891b#df91e2e0a416cab594303f11d44a6555a72f891b" +source = "git+https://github.com/ComlineProject/comline-rust?rev=dd1c29e6560a0ffd7893c59715b31d43b88c585f#dd1c29e6560a0ffd7893c59715b31d43b88c585f" dependencies = [ "comline-codegen", "comline-core", @@ -108,12 +108,13 @@ dependencies = [ [[package]] name = "comline-core" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=868e8310e33df317e3cba4f76b81fbcd8639c1c2#868e8310e33df317e3cba4f76b81fbcd8639c1c2" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" dependencies = [ "blake3", "ciborium", "comline-catalog", "comline-core-stdlib", + "comline-ir-formats", "eyre", "lz4_flex", "semver", @@ -126,12 +127,12 @@ dependencies = [ [[package]] name = "comline-core-stdlib" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=868e8310e33df317e3cba4f76b81fbcd8639c1c2#868e8310e33df317e3cba4f76b81fbcd8639c1c2" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" [[package]] name = "comline-doc-html" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=05771e0679ff514da3ba73a3b0b94643e5262fe5#05771e0679ff514da3ba73a3b0b94643e5262fe5" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-codegen", "eyre", @@ -142,7 +143,7 @@ dependencies = [ [[package]] name = "comline-doc-markdown" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=05771e0679ff514da3ba73a3b0b94643e5262fe5#05771e0679ff514da3ba73a3b0b94643e5262fe5" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-codegen", "eyre", @@ -150,6 +151,16 @@ dependencies = [ "serde_json", ] +[[package]] +name = "comline-ir-formats" +version = "0.0.0" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" +dependencies = [ + "ciborium", + "serde", + "serde_derive", +] + [[package]] name = "comline-test-generators" version = "0.0.0" diff --git a/tests/fixtures/generators/Cargo.toml b/tests/fixtures/generators/Cargo.toml index 1d99eef..da9955a 100644 --- a/tests/fixtures/generators/Cargo.toml +++ b/tests/fixtures/generators/Cargo.toml @@ -12,7 +12,7 @@ publish = false [dependencies] # The same revs the CLI pins, so the real generator's output is comparable # byte for byte with the CLI's built-in one. -comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" } -comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" } -comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "05771e0679ff514da3ba73a3b0b94643e5262fe5" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "df91e2e0a416cab594303f11d44a6555a72f891b" } +comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } +comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } +comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "dd1c29e6560a0ffd7893c59715b31d43b88c585f" }