Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more ten_rust_cargo_clean targets #281

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
go env -w GOFLAGS="-buildvcs=false" && \
go1.20.12 download && \
rustup default nightly && \
tgn gen linux arm64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_tests=false ten_enable_libwebsockets=false ten_enable_clean_build=true && \
tgn gen linux arm64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_tests=false ten_enable_libwebsockets=false ten_enable_cargo_clean=true && \
tgn build linux arm64 ${{ matrix.build_type }} && \
tree -I 'gen|obj' out \
"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
echo $PATH
go env -w GOFLAGS="-buildvcs=false"
rustup default nightly
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=false log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_enable_package_manager=false ten_rust_enable_gen_cargo_config=false ten_enable_clean_build=true
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=false log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_enable_package_manager=false ten_rust_enable_gen_cargo_config=false ten_enable_cargo_clean=true
tgn build linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
go env -w GOFLAGS="-buildvcs=false"
go1.20.12 download
rustup default nightly
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_clean_build=true
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_cargo_clean=true
tgn build linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
fi
export PATH=$(pwd)/core/ten_gn:$PATH
echo $PATH
tgn gen mac arm64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_clean_build=true
tgn gen mac arm64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_cargo_clean=true
tgn build mac arm64 ${{ matrix.build_type }}
tree -I 'gen|obj' out

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Build
run: |
$ENV:PATH += ";$PWD/core/ten_gn"
tgn gen win x64 ${{ matrix.build_type }} -- vs_version=2022 log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_clean_build=true
tgn gen win x64 ${{ matrix.build_type }} -- vs_version=2022 log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false ten_rust_enable_gen_cargo_config=false ten_enable_cargo_clean=true
tgn build win x64 ${{ matrix.build_type }}

- name: Run Tests (ten_utils_unit_test)
Expand Down
5 changes: 3 additions & 2 deletions build/common/rust/rust.gni
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import("//build/options.gni")
import("//build/ten_rust/options.gni")

template("rust_target") {
assert(defined(invoker.project_path), "project_file is not defined")
assert(defined(invoker.project_path), "project_path is not defined")
assert(defined(invoker.target_path), "target_path is not defined")
assert(defined(invoker.output_name), "output_name is not defined")

_target_name = target_name
target_path = target_gen_dir
target_path = invoker.target_path

action("${_target_name}") {
script = "//build/common/rust/rust.py"
Expand Down
2 changes: 1 addition & 1 deletion build/options.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ declare_args() {

ten_enable_package_manager = true

ten_enable_clean_build = false
ten_enable_cargo_clean = false
}
25 changes: 21 additions & 4 deletions core/src/ten_manager/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ copy("ten_manager_test_data") {

if (ten_enable_package_manager) {
if (ten_package_manager_enable_tests) {
rust_test("tman_test") {
rust_test("tman_test_cargo_build") {
project_path = "//core/src/ten_manager"
integration_test_output_name = "integration_test"

Expand All @@ -38,7 +38,7 @@ if (ten_enable_package_manager) {
# executable will be the normal executable, not the test case executable.
# Therefore, it's necessary to separate the `target-dir` for these two
# `cargo build` commands to avoid interfering with each other.
target_path = "${root_gen_dir}/core/src/tman_test"
target_path = "${target_gen_dir}/tman_test"

test_output_dir = "${root_out_dir}/tests/standalone/ten_manager"

Expand All @@ -48,6 +48,21 @@ if (ten_enable_package_manager) {
"//third_party/clingo",
]
}

rust_clean("tman_test_cargo_clean") {
project_path = "//core/src/ten_manager"
target_path = get_label_info("tman_test", "target_gen_dir")

deps = [ ":tman_test_cargo_build" ]
}

group("tman_test") {
if (ten_enable_cargo_clean) {
deps = [ ":tman_test_cargo_clean" ]
} else {
deps = [ ":tman_test_cargo_build" ]
}
}
}

action("copy_clingo_config_files") {
Expand All @@ -71,6 +86,7 @@ if (ten_enable_package_manager) {
rust_target("tman") {
project_path = "//core/src/ten_manager"
manifest_path = "//core/src/ten_manager/Cargo.toml"
target_path = "${target_gen_dir}/tman"

clingo_lib_folder =
rebase_path("${root_out_dir}/gen/cmake/clingo/install/lib")
Expand Down Expand Up @@ -141,13 +157,14 @@ if (ten_enable_package_manager) {

rust_clean("tman_cargo_clean") {
project_path = "//core/src/ten_manager"
target_path = get_path_info("tman", "gen_dir")
tman_target_gen_dir = get_label_info(":tman", "target_gen_dir")
target_path = "${tman_target_gen_dir}/tman"

deps = [ ":ten_manager_package" ]
}

group("ten_manager") {
if (ten_enable_clean_build) {
if (ten_enable_cargo_clean) {
deps = [ ":tman_cargo_clean" ]
} else {
deps = [ ":ten_manager_package" ]
Expand Down
1 change: 1 addition & 0 deletions core/src/ten_rust/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if (ten_enable_ten_rust) {

rust_target("ten_rust_static_lib") {
project_path = "//core/src/ten_rust"
target_path = "${target_gen_dir}/ten_rust_static_lib"
manifest_path = "//core/src/ten_rust/Cargo.toml"

extra_inputs = [
Expand Down
2 changes: 1 addition & 1 deletion core/ten_gn
Submodule ten_gn updated 0 files
Loading