mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
agent/protocols: Stop generate agent proto files in the shellscript
Because the job has been done by build.rs. Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
parent
ca8f1399ca
commit
359f76d209
@ -64,25 +64,6 @@ $GOPATH/src/github.com/kata-containers/kata-containers/src/agent/protocols/proto
|
|||||||
[ $? -eq 0 ] || die "Failed to generate golang file from $1"
|
[ $? -eq 0 ] || die "Failed to generate golang file from $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_rust_sources() {
|
|
||||||
local cmd="protoc --rust_out=./protocols/src/ \
|
|
||||||
--ttrpc_out=./protocols/src/,plugins=ttrpc:./protocols/src/ \
|
|
||||||
--plugin=protoc-gen-ttrpc=`which ttrpc_rust_plugin` \
|
|
||||||
-I $GOPATH/src/github.com/kata-containers/agent/vendor/github.com/gogo/protobuf:$GOPATH/src/github.com/kata-containers/agent/vendor:$GOPATH/src/github.com/gogo/protobuf:$GOPATH/src/github.com/gogo/googleapis:$GOPATH/src:$GOPATH/src/github.com/kata-containers/kata-containers/src/agent/protocols/protos \
|
|
||||||
$GOPATH/src/github.com/kata-containers/kata-containers/src/agent/protocols/protos/$1"
|
|
||||||
|
|
||||||
echo $cmd
|
|
||||||
$cmd
|
|
||||||
[ $? -eq 0 ] || die "Failed to generate rust file from $1"
|
|
||||||
|
|
||||||
if [ "$1" = "oci.proto" ]; then
|
|
||||||
# Need change Box<Self> to ::std::boxed::Box<Self> because there is another struct Box
|
|
||||||
sed 's/fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {/fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<::std::any::Any> {/g' ./protocols/src/oci.rs > ./protocols/src/new_oci.rs
|
|
||||||
sed 's/fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {/fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {/g' ./protocols/src/oci.rs > ./protocols/src/new_oci.rs
|
|
||||||
mv ./protocols/src/new_oci.rs ./protocols/src/oci.rs
|
|
||||||
fi;
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$(basename $(pwd))" != "agent" ]; then
|
if [ "$(basename $(pwd))" != "agent" ]; then
|
||||||
die "Please go to directory of protocols before execute this shell"
|
die "Please go to directory of protocols before execute this shell"
|
||||||
fi
|
fi
|
||||||
@ -118,10 +99,6 @@ if [ "$target" = "all" ]; then
|
|||||||
echo -e "\n [golang] compiling ${f} ..."
|
echo -e "\n [golang] compiling ${f} ..."
|
||||||
generate_go_sources $f
|
generate_go_sources $f
|
||||||
echo -e " [golang] ${f} compiled\n"
|
echo -e " [golang] ${f} compiled\n"
|
||||||
|
|
||||||
echo -e "\n [rust] compiling ${f} ..."
|
|
||||||
generate_rust_sources $f
|
|
||||||
echo -e " [rust] ${f} compiled\n"
|
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# compile individual proto file
|
# compile individual proto file
|
||||||
@ -130,10 +107,6 @@ else
|
|||||||
echo -e "\n [golang] compiling ${target} ..."
|
echo -e "\n [golang] compiling ${target} ..."
|
||||||
generate_go_sources $target
|
generate_go_sources $target
|
||||||
echo -e " [golang] ${target} compiled\n"
|
echo -e " [golang] ${target} compiled\n"
|
||||||
|
|
||||||
echo -e "\n [rust] compiling ${target} ..."
|
|
||||||
generate_rust_sources $target
|
|
||||||
echo -e " [rust] ${target} compiled\n"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi;
|
fi;
|
||||||
|
Loading…
Reference in New Issue
Block a user