Merge pull request #239040 from figsoda/cargo-component
This commit is contained in:
+4955
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
{ lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, curl
|
||||
, pkg-config
|
||||
, protobuf
|
||||
, libgit2
|
||||
, openssl
|
||||
, zlib
|
||||
, stdenv
|
||||
, darwin
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "cargo-component";
|
||||
version = "unstable-2023-06-20";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bytecodealliance";
|
||||
repo = "cargo-component";
|
||||
rev = "277728b729577540fdd5977a59a4e51c061c6fcb";
|
||||
hash = "sha256-Uu+S4TRbtei78ZNkYNkwHiIot0L7fUODJgd5xDjw8rg=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
outputHashes = {
|
||||
"warg-api-0.1.0" = "sha256-GYmHrGCmEMYCi8S+hd0CuBxkwF4BM1B9pJ1TOGCqHuk=";
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
(fetchpatch {
|
||||
name = "export-wasi-adapter-version-even-if-git-fails.patch";
|
||||
url = "https://github.com/bytecodealliance/cargo-component/commit/9b2517fe2c4dbb1077a8785fd79c677ad1b7fc6b.patch";
|
||||
hash = "sha256-nY8ltBb8H7zkE2JLhXJiBOMwTM8CVvkXTSHTUyMqamo=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
curl
|
||||
pkg-config
|
||||
protobuf
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
curl
|
||||
libgit2
|
||||
openssl
|
||||
zlib
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
|
||||
darwin.apple_sdk.frameworks.CoreFoundation
|
||||
];
|
||||
|
||||
# requires the wasm32-wasi target
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A Cargo subcommand for creating WebAssembly components based on the component model proposal";
|
||||
homepage = "https://github.com/bytecodealliance/cargo-component";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ figsoda ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
--- 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" }
|
||||
@@ -16541,6 +16541,7 @@ with pkgs;
|
||||
cargo-clone = callPackage ../development/tools/rust/cargo-clone {
|
||||
inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration;
|
||||
};
|
||||
cargo-component = callPackage ../development/tools/rust/cargo-component { };
|
||||
cargo-criterion = callPackage ../development/tools/rust/cargo-criterion { };
|
||||
cargo-cyclonedx = callPackage ../development/tools/rust/cargo-cyclonedx {
|
||||
inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration CoreFoundation;
|
||||
|
||||
Reference in New Issue
Block a user