From e4ec073f07d66b530681ead7b946a3fd7d43d8bf Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 3 Jul 2023 22:00:39 -0400 Subject: [PATCH] cargo-component: unstable-2023-06-20 -> unstable-2023-06-22 Diff: https://github.com/bytecodealliance/cargo-component/compare/277728b729577540fdd5977a59a4e51c061c6fcb...bd98521c6e13640593ad676d8b6f1e64054755d4 --- .../tools/rust/cargo-component/Cargo.lock | 160 +++++++++++++++--- .../tools/rust/cargo-component/default.nix | 25 ++- .../cargo-component/update-registry.patch | 93 ---------- 3 files changed, 145 insertions(+), 133 deletions(-) delete mode 100644 pkgs/development/tools/rust/cargo-component/update-registry.patch diff --git a/pkgs/development/tools/rust/cargo-component/Cargo.lock b/pkgs/development/tools/rust/cargo-component/Cargo.lock index 24f1c085882d..1f9f3cad4c14 100644 --- a/pkgs/development/tools/rust/cargo-component/Cargo.lock +++ b/pkgs/development/tools/rust/cargo-component/Cargo.lock @@ -350,6 +350,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + [[package]] name = "bitflags" version = "1.3.2" @@ -2419,6 +2425,38 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +[[package]] +name = "logos" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn 2.0.18", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + [[package]] name = "matchit" version = "0.7.0" @@ -2460,6 +2498,29 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miette" +version = "5.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "mime" version = "0.3.17" @@ -3142,6 +3203,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-reflect" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000e1e05ebf7b26e1eba298e66fe4eee6eb19c567d0ffb35e0dd34231cdac4c8" +dependencies = [ + "logos", + "miette", + "once_cell", + "prost", + "prost-types", +] + [[package]] name = "prost-types" version = "0.11.9" @@ -3151,6 +3225,33 @@ dependencies = [ "prost", ] +[[package]] +name = "protox" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24022a7eb88547eaba87a1db7954c9c4cb4a143565c4e8f2b7f3e76eed63db2d" +dependencies = [ + "bytes", + "miette", + "prost", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", +] + +[[package]] +name = "protox-parse" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a2a651fa4466e67df6c967df5d7fc6cbffac89afc7b834f97ec49846c9c11" +dependencies = [ + "logos", + "miette", + "prost-types", + "thiserror", +] + [[package]] name = "pulldown-cmark" version = "0.8.0" @@ -3247,7 +3348,7 @@ checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick 1.0.2", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -3256,6 +3357,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.7.2" @@ -3493,15 +3600,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_bytes" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.164" @@ -4258,7 +4356,7 @@ dependencies = [ [[package]] name = "warg-api" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "serde", "serde_with", @@ -4270,7 +4368,7 @@ dependencies = [ [[package]] name = "warg-client" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "anyhow", "async-trait", @@ -4303,13 +4401,14 @@ dependencies = [ [[package]] name = "warg-crypto" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "anyhow", "base64 0.21.2", "digest", "hex", "leb128", + "once_cell", "p256", "rand_core", "secrecy", @@ -4320,26 +4419,41 @@ dependencies = [ ] [[package]] -name = "warg-protocol" +name = "warg-protobuf" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "anyhow", - "base64 0.21.2", - "hex", - "indexmap", "pbjson", "pbjson-build", "pbjson-types", "prost", "prost-build", "prost-types", + "protox", "regex", + "serde", + "warg-crypto", +] + +[[package]] +name = "warg-protocol" +version = "0.1.0" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" +dependencies = [ + "anyhow", + "base64 0.21.2", + "hex", + "indexmap", + "pbjson-types", + "prost", + "prost-types", "semver", "serde", "serde_with", "thiserror", "warg-crypto", + "warg-protobuf", "warg-transparency", "wasmparser", ] @@ -4347,7 +4461,7 @@ dependencies = [ [[package]] name = "warg-server" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "anyhow", "axum", @@ -4375,20 +4489,16 @@ dependencies = [ [[package]] name = "warg-transparency" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" +source = "git+https://github.com/bytecodealliance/registry#c308e35e8d2b5fefb6c936427a935f38314b804a" dependencies = [ "anyhow", - "pbjson", "pbjson-build", - "pbjson-types", "prost", "prost-build", - "prost-types", "regex", - "serde", - "serde_bytes", "thiserror", "warg-crypto", + "warg-protobuf", ] [[package]] diff --git a/pkgs/development/tools/rust/cargo-component/default.nix b/pkgs/development/tools/rust/cargo-component/default.nix index 93da4c0d05ea..fa22f6ac95b2 100644 --- a/pkgs/development/tools/rust/cargo-component/default.nix +++ b/pkgs/development/tools/rust/cargo-component/default.nix @@ -4,7 +4,6 @@ , fetchpatch , curl , pkg-config -, protobuf , libgit2 , openssl , zlib @@ -14,40 +13,36 @@ rustPlatform.buildRustPackage { pname = "cargo-component"; - version = "unstable-2023-06-20"; + version = "unstable-2023-06-22"; src = fetchFromGitHub { owner = "bytecodealliance"; repo = "cargo-component"; - rev = "277728b729577540fdd5977a59a4e51c061c6fcb"; - hash = "sha256-Uu+S4TRbtei78ZNkYNkwHiIot0L7fUODJgd5xDjw8rg="; + rev = "bd98521c6e13640593ad676d8b6f1e64054755d4"; + hash = "sha256-5r3g158Ujdbpb0NZI1DIu3TGpc3G9XDmXg+mq+/Dayc="; }; cargoLock = { lockFile = ./Cargo.lock; outputHashes = { - "warg-api-0.1.0" = "sha256-GYmHrGCmEMYCi8S+hd0CuBxkwF4BM1B9pJ1TOGCqHuk="; + "warg-api-0.1.0" = "sha256-M1hbgWqibbq7upfvNarcqAM0fbWL8Z7y+pWpBfVqxiI="; }; }; patches = [ - # update dependencies to make it work when dependencies are vendored - # https://github.com/bytecodealliance/registry/pull/138 - ./update-registry.patch - - # fix build when it is not in a git repository - # https://github.com/bytecodealliance/cargo-component/pull/92 + # update warg dependencies to make cargo-component work when dependencies + # are vendored, since the fix has already been merged in warg + # https://github.com/bytecodealliance/cargo-component/pull/93 (fetchpatch { - name = "export-wasi-adapter-version-even-if-git-fails.patch"; - url = "https://github.com/bytecodealliance/cargo-component/commit/9b2517fe2c4dbb1077a8785fd79c677ad1b7fc6b.patch"; - hash = "sha256-nY8ltBb8H7zkE2JLhXJiBOMwTM8CVvkXTSHTUyMqamo="; + name = "update-warg-dependencies.patch"; + url = "https://github.com/bytecodealliance/cargo-component/commit/dac67f9eb465efaf11f445bc949bd87f7039a472.patch"; + hash = "sha256-tFJtQJtHAmw4xZ9ADLyQn9+QRxHU1iZZbfXGYaPajg8="; }) ]; nativeBuildInputs = [ curl pkg-config - protobuf ]; buildInputs = [ diff --git a/pkgs/development/tools/rust/cargo-component/update-registry.patch b/pkgs/development/tools/rust/cargo-component/update-registry.patch deleted file mode 100644 index 54f7402d59cc..000000000000 --- a/pkgs/development/tools/rust/cargo-component/update-registry.patch +++ /dev/null @@ -1,93 +0,0 @@ ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -4258,7 +4258,7 @@ dependencies = [ - [[package]] - name = "warg-api" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "serde", - "serde_with", -@@ -4270,7 +4270,7 @@ dependencies = [ - [[package]] - name = "warg-client" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "anyhow", - "async-trait", -@@ -4303,7 +4303,7 @@ dependencies = [ - [[package]] - name = "warg-crypto" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "anyhow", - "base64 0.21.2", -@@ -4322,7 +4322,7 @@ dependencies = [ - [[package]] - name = "warg-protocol" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "anyhow", - "base64 0.21.2", -@@ -4347,7 +4347,7 @@ dependencies = [ - [[package]] - name = "warg-server" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "anyhow", - "axum", -@@ -4355,7 +4355,6 @@ dependencies = [ - "clap", - "futures", - "indexmap", -- "reqwest", - "serde", - "tempfile", - "thiserror", -@@ -4365,6 +4364,7 @@ dependencies = [ - "tower-http", - "tracing", - "tracing-subscriber", -+ "url", - "warg-api", - "warg-crypto", - "warg-protocol", -@@ -4375,7 +4375,7 @@ dependencies = [ - [[package]] - name = "warg-transparency" - version = "0.1.0" --source = "git+https://github.com/bytecodealliance/registry#f0e45fc765e24e7bb6671f568ee4d3f80a723689" -+source = "git+https://github.com/bytecodealliance/registry?rev=a19e85a48f806599e3709332aa102623a0084277#a19e85a48f806599e3709332aa102623a0084277" - dependencies = [ - "anyhow", - "pbjson", ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -9,9 +9,9 @@ cargo = "0.71.0" - cargo-util = "0.2.4" - clap = { version = "4.3.3", features = ["derive"] } - toml_edit = { version = "0.19.10", features = ["serde"] } --warg-protocol = { git = "https://github.com/bytecodealliance/registry" } --warg-crypto = { git = "https://github.com/bytecodealliance/registry" } --warg-client = { git = "https://github.com/bytecodealliance/registry" } -+warg-protocol = { git = "https://github.com/bytecodealliance/registry", rev = "a19e85a48f806599e3709332aa102623a0084277" } -+warg-crypto = { git = "https://github.com/bytecodealliance/registry", rev = "a19e85a48f806599e3709332aa102623a0084277" } -+warg-client = { git = "https://github.com/bytecodealliance/registry", rev = "a19e85a48f806599e3709332aa102623a0084277" } - wit-bindgen-core = "0.7.0" - wit-bindgen-rust = "0.7.0" - wit-bindgen-rust-lib = "0.7.0" -@@ -47,4 +47,4 @@ default = ["pretty_env_logger"] - assert_cmd = "2.0.11" - predicates = "3.0.3" - wasmparser = "0.107.0" --warg-server = { git = "https://github.com/bytecodealliance/registry" } -+warg-server = { git = "https://github.com/bytecodealliance/registry", rev = "a19e85a48f806599e3709332aa102623a0084277" }