Skip to content

Commit 83265ee

Browse files
committed
tooling: Remove VTD dependency from cloe and cloe-plugin-vtd
Only require what you really need. It should not be required to have the VTD distribution around if you want to start it in another container for example.
1 parent 711cc92 commit 83265ee

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ doxygen:
7474
smoketest:
7575
# Call this target with WITH_VTD=1 to include VTD binding tests.
7676
$(call print_header, "Running smoke tests...")
77-
@${CLOE_LAUNCH} clean -P conanfile.py
77+
@${CLOE_LAUNCH} clean -P conantest.py
7878
@\time -f "\nTotal smoketest time (real) = %e sec" bats tests
7979

8080
purge-all:

conanfile.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Cloe(ConanFile):
2222
"with_engine": True,
2323
}
2424
generators = "cmake"
25-
no_copy_source = False
25+
no_copy_source = True
2626

2727
_cmake = None
2828

@@ -49,7 +49,6 @@ def requirements(self):
4949
]
5050
if self.options.with_vtd:
5151
requires.append("cloe-plugin-vtd")
52-
self.requires("osi-sensor/1.0.0-vtd2.2@cloe/stable")
5352

5453
if self.options.with_engine:
5554
requires.append("cloe-engine")

conantest.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from pathlib import Path
2+
from conans import ConanFile, tools
3+
4+
5+
class CloeTest(ConanFile):
6+
name = "cloe-test"
7+
settings = "os", "compiler", "build_type", "arch"
8+
options = {
9+
"with_vtd": [True, False],
10+
}
11+
default_options = {
12+
"with_vtd": False,
13+
}
14+
no_copy_source = True
15+
16+
def set_version(self):
17+
version_file = Path(self.recipe_folder) / "VERSION"
18+
if version_file.exists():
19+
self.version = tools.load(version_file).strip()
20+
else:
21+
git = tools.Git(folder=self.recipe_folder)
22+
self.version = git.run("describe --dirty=-dirty")[1:]
23+
24+
def requirements(self):
25+
self.requires(f"cloe/{self.version}@cloe/develop")
26+
if self.options.with_vtd:
27+
self.requires("osi-sensor/1.0.0-vtd2.2@cloe/stable")
28+
self.requires("vtd/2.2.0@cloe-restricted/stable")
29+
30+
def configure(self):
31+
self.options["cloe"].with_vtd = self.options.with_vtd

plugins/vtd/conanfile.py

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class CloeSimulatorVTD(ConanFile):
2828
requires = [
2929
"open-simulation-interface/3.2.0@cloe/stable",
3030
"vtd-api/2.2.0@cloe-restricted/stable",
31-
"vtd/2.2.0@cloe-restricted/stable",
3231
]
3332

3433
_cmake = None

tests/setup_bats.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export exit_outcome_syskill=250
2929
# CLOE_WRITE_OUTPUT : bool
3030
cloe_engine() {
3131
local cloe_log_level="${CLOE_LOG_LEVEL-debug}"
32-
local cloe_profile_file="${CLOE_PROFILE_FILE-${CLOE_ROOT}/conanfile.py}"
32+
local cloe_profile_file="${CLOE_PROFILE_FILE-${CLOE_ROOT}/conantest.py}"
3333
local cloe_launch_exe=(python3 -m cloe_launch)
3434
local cloe_launch_args=(-vv exec -c -P "${cloe_profile_file}")
3535
local cloe_engine_args=(--no-system-confs --no-system-plugins --level ${cloe_log_level})
@@ -75,7 +75,7 @@ cloe_engine() {
7575

7676
cloe_shell() {
7777
local cloe_log_level="${CLOE_LOG_LEVEL-debug}"
78-
local cloe_profile_file="${CLOE_PROFILE_FILE-${CLOE_ROOT}/conanfile.py}"
78+
local cloe_profile_file="${CLOE_PROFILE_FILE-${CLOE_ROOT}/conantest.py}"
7979
local cloe_launch_exe=(python3 -m cloe_launch)
8080
local cloe_launch_args=(-vv shell -c -P "${cloe_profile_file}")
8181

0 commit comments

Comments
 (0)