Skip to content

Commit

Permalink
libs: convert to a cargo workspace
Browse files Browse the repository at this point in the history
Convert libs into a Cargo workspace, so all libraries could share the
build infrastructure.

Fixes kata-containers#3282

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
  • Loading branch information
jiangliu authored and Fupan Li committed Jun 10, 2022
1 parent 575df4d commit 392f1ec
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ STANDARD_TARGETS = build check clean install test vendor

default: all

all: logging-crate-tests build
all: libs-crate-tests build

logging-crate-tests:
make -C src/libs/logging
libs-crate-tests:
make -C src/libs

include utils.mk
include ./tools/packaging/kata-deploy/local-build/Makefile
Expand All @@ -49,7 +49,7 @@ docs-url-alive-check:
binary-tarball \
default \
install-binary-tarball \
logging-crate-tests \
libs-crate-tests \
static-checks \
docs-url-alive-check

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ The table below lists the core parts of the project:
|-|-|-|
| [runtime](src/runtime) | core | Main component run by a container manager and providing a containerd shimv2 runtime implementation. |
| [agent](src/agent) | core | Management process running inside the virtual machine / POD that sets up the container environment. |
| [libraries](src/libs) | core | Library crates shared by multiple Kata Container components or published to [`crates.io`](https://crates.io/index.ht
ml) |
| [documentation](docs) | documentation | Documentation common to all components (such as design and install documentation). |
| [libraries](src/libs) | core | Library crates shared by multiple Kata Container components or published to [`crates.io`](https://crates.io/index.html) |
| [tests](https://github.com/kata-containers/tests) | tests | Excludes unit tests which live with the main code. |
Expand Down
8 changes: 4 additions & 4 deletions src/agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ endef
##TARGET default: build code
default: $(TARGET) show-header

$(TARGET): $(GENERATED_CODE) logging-crate-tests $(TARGET_PATH)
$(TARGET): $(GENERATED_CODE) libs-crate-tests $(TARGET_PATH)

logging-crate-tests:
make -C $(CWD)/../libs/logging
libs-crate-tests:
make -C $(CWD)/../libs

$(TARGET_PATH): show-summary
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES)
Expand Down Expand Up @@ -203,7 +203,7 @@ codecov-html: check_tarpaulin

.PHONY: \
help \
logging-crate-tests \
libs-crate-tests \
optimize \
show-header \
show-summary \
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/tools/agent-ctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ include ../../../utils.mk
.DEFAULT_GOAL := default
default: build

build: logging-crate-tests
build: libs-crate-tests
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE)

logging-crate-tests:
make -C $(CWD)/../../libs/logging
libs-crate-tests:
make -C $(CWD)/../../libs

clean:
cargo clean
Expand All @@ -32,6 +32,6 @@ check: standard_rust_check
check \
clean \
install \
logging-crate-tests \
libs-crate-tests \
test \
vendor
8 changes: 4 additions & 4 deletions src/tools/trace-forwarder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ include ../../../utils.mk
.DEFAULT_GOAL := default
default: build

build: logging-crate-tests
build: libs-crate-tests
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE)

logging-crate-tests:
make -C $(CWD)/../../libs/logging
libs-crate-tests:
make -C $(CWD)/../../libs

clean:
cargo clean
Expand All @@ -32,6 +32,6 @@ check: standard_rust_check
check \
clean \
install \
logging-crate-tests \
libs-crate-tests \
test \
vendor

0 comments on commit 392f1ec

Please sign in to comment.