From d1eceeca7bfd12d4d1236346d7cdcc89b5e949e2 Mon Sep 17 00:00:00 2001 From: paulhsia Date: Thu, 20 Dec 2018 15:44:11 +0800 Subject: [PATCH] crosvm: Split sub-crates into independent workspace Split sub-crates under crosvm root directory into several independent workspaces for adding ebuild files for those crates. data_model and sys_util could only be built by emerge after creating their ebuilds. BUG=chromium:916921 TEST='emerge-eve crosvm' TEST=Run 'cargo build' under crosvm directory Change-Id: I2dddbbb7c7344e643183a5885e867f134b299591 Reviewed-on: https://chromium-review.googlesource.com/1385972 Commit-Ready: Chih-Yang Hsia Tested-by: Chih-Yang Hsia Reviewed-by: Chirantan Ekbote Reviewed-by: Zach Reizner --- Cargo.toml | 19 +++++++++++++++++-- assertions/Cargo.toml | 3 +++ data_model/Cargo.toml | 5 ++++- sync/Cargo.toml | 3 +++ sys_util/Cargo.toml | 12 +++++++++--- sys_util/poll_token_derive/Cargo.toml | 3 +++ syscall_defines/Cargo.toml | 3 +++ 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c8f7473ad2..7ab3b165d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,13 @@ overflow-checks = true [workspace] members = ["9s", "qcow_utils"] +exclude = [ + "assertions", + "data_model", + "sync", + "sys_util", + "syscall_defines", +] [features] plugin = ["plugin_proto", "crosvm_plugin", "protobuf"] @@ -28,7 +35,7 @@ io_jail = { path = "io_jail" } kvm = { path = "kvm" } kvm_sys = { path = "kvm_sys" } msg_socket = { path = "msg_socket" } -sys_util = { path = "sys_util" } +sys_util = "*" usb_util = { path = "usb_util", optional = true } kernel_cmdline = { path = "kernel_cmdline" } kernel_loader = { path = "kernel_loader" } @@ -37,7 +44,7 @@ byteorder = "=1.1.0" net_util = { path = "net_util" } vhost = { path = "vhost" } vm_control = { path = "vm_control" } -data_model = { path = "data_model" } +data_model = "*" qcow = { path = "qcow" } plugin_proto = { path = "plugin_proto", optional = true } crosvm_plugin = { path = "crosvm_plugin", optional = true } @@ -54,4 +61,12 @@ x86_64 = { path = "x86_64" } aarch64 = { path = "aarch64" } [dev-dependencies] +sys_util = "*" + +[patch.crates-io] +assertions = { path = "assertions" } +data_model = { path = "data_model" } +poll_token_derive = { path = "sys_util/poll_token_derive" } +sync = { path = "sync" } sys_util = { path = "sys_util" } +syscall_defines = { path = "syscall_defines" } diff --git a/assertions/Cargo.toml b/assertions/Cargo.toml index 36f9beb5e6..6d40a52159 100644 --- a/assertions/Cargo.toml +++ b/assertions/Cargo.toml @@ -2,3 +2,6 @@ name = "assertions" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["src/**/*", "Cargo.toml"] + +[workspace] diff --git a/data_model/Cargo.toml b/data_model/Cargo.toml index 549d8178e0..1b30aca061 100644 --- a/data_model/Cargo.toml +++ b/data_model/Cargo.toml @@ -2,6 +2,9 @@ name = "data_model" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["src/**/*", "Cargo.toml"] [dependencies] -assertions = { path = "../assertions" } +assertions = "*" + +[workspace] diff --git a/sync/Cargo.toml b/sync/Cargo.toml index d8ce024818..b74e672c7f 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -2,3 +2,6 @@ name = "sync" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["src/**/*", "Cargo.toml"] + +[workspace] diff --git a/sys_util/Cargo.toml b/sys_util/Cargo.toml index e54b4903bf..1f8274fbf2 100644 --- a/sys_util/Cargo.toml +++ b/sys_util/Cargo.toml @@ -2,10 +2,16 @@ name = "sys_util" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["src/**/*", "Cargo.toml"] [dependencies] -data_model = { path = "../data_model" } +data_model = "*" libc = "*" -syscall_defines = { path = "../syscall_defines" } +syscall_defines = "*" +poll_token_derive = "*" +sync = "*" + +[workspace] + +[patch.crates-io] poll_token_derive = { path = "poll_token_derive" } -sync = { path = "../sync" } diff --git a/sys_util/poll_token_derive/Cargo.toml b/sys_util/poll_token_derive/Cargo.toml index 8610ee3410..7e7b424116 100644 --- a/sys_util/poll_token_derive/Cargo.toml +++ b/sys_util/poll_token_derive/Cargo.toml @@ -2,6 +2,7 @@ name = "poll_token_derive" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["*.rs", "Cargo.toml"] [lib] proc-macro = true @@ -11,3 +12,5 @@ path = "poll_token_derive.rs" syn = "0.15" quote = "0.6" proc-macro2 = "0.4" + +[workspace] diff --git a/syscall_defines/Cargo.toml b/syscall_defines/Cargo.toml index bba104e879..8f76523591 100644 --- a/syscall_defines/Cargo.toml +++ b/syscall_defines/Cargo.toml @@ -2,5 +2,8 @@ name = "syscall_defines" version = "0.1.0" authors = ["The Chromium OS Authors"] +include = ["src/**/*", "Cargo.toml"] [dependencies] + +[workspace]