[PATCH v2 1/6] dts: Remove build target config and list of devices

Juraj Linkeš juraj.linkes at pantheon.tech
Tue Sep 10 13:30:51 CEST 2024


The subject line should be all lowercase (except for abbreviations and 
maybe some other exceptions).

On 5. 7. 2024 19:13, Nicholas Pratte wrote:
> Remove the list of devices from the schema, as these are unuesed.

Typo: unuesed

> Likewise, removed build-target information since these is not currently
> used, and it is unlikely to be used in the future. Adjustments to the
> dts.rst are made to reflect these changes.

> diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py

> @@ -341,28 +325,20 @@ class BuildTargetConfiguration:
>       The configuration used for building DPDK.
>   
>       Attributes:
> -        arch: The target architecture to build for.
> -        os: The target os to build for.
> -        cpu: The target CPU to build for.
>           compiler: The compiler executable to use.
>           compiler_wrapper: This string will be put in front of the compiler when
>               executing the build. Useful for adding wrapper commands, such as ``ccache``.
>           name: The name of the compiler.
>       """
>   
> -    arch: Architecture
> -    os: OS
> -    cpu: CPUType
>       compiler: Compiler
>       compiler_wrapper: str
> -    name: str
>   
>       @classmethod
>       def from_dict(cls, d: BuildTargetConfigDict) -> Self:
>           r"""A convenience method that processes the inputs before creating an instance.
>   
> -        `arch`, `os`, `cpu` and `compiler` are converted to :class:`Enum`\s and
> -        `name` is constructed from `arch`, `os`, `cpu` and `compiler`.
> +        `compiler` is converted to :class:`Enum`\s
>   
>           Args:
>               d: The configuration dictionary.
> @@ -371,12 +347,8 @@ def from_dict(cls, d: BuildTargetConfigDict) -> Self:
>               The build target configuration instance.
>           """
>           return cls(
> -            arch=Architecture(d["arch"]),
> -            os=OS(d["os"]),
> -            cpu=CPUType(d["cpu"]),
>               compiler=Compiler(d["compiler"]),
>               compiler_wrapper=d.get("compiler_wrapper", ""),
> -            name=f"{d['arch']}-{d['os']}-{d['cpu']}-{d['compiler']}",

I think we can still keep this, we can just remove arch, os and cpu 
(there could be multiple build target, each with different compiler 
(gcc, clang, etc.)). If there's a reason to remove this, it should be 
mentioned in the commit message.

>           )
>   
>   
> diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json
> index f02a310bb5..3f7bc2acae 100644
> --- a/dts/framework/config/conf_yaml_schema.json
> +++ b/dts/framework/config/conf_yaml_schema.json
> @@ -6,76 +6,6 @@

>       "ARCH": {
>         "type": "string",
>         "enum": [
> @@ -124,12 +54,6 @@
>               "other"
>             ]
>           },
> -        "os": {
> -          "$ref": "#/definitions/OS"
> -        },
> -        "cpu": {
> -          "$ref": "#/definitions/cpu"
> -        },

Should we also remove arch that's above these two?


> diff --git a/dts/framework/runner.py b/dts/framework/runner.py
> index 6b6f6a05f5..2a1019899a 100644
> --- a/dts/framework/runner.py
> +++ b/dts/framework/runner.py
> @@ -480,7 +480,7 @@ def _run_build_target(
>               test_suites_with_cases: The test suites with test cases to run.
>           """
>           self._logger.set_stage(DtsStage.build_target_setup)
> -        self._logger.info(f"Running build target '{build_target_config.name}'.")
> +        self._logger.info("Running build target.")

If we keep build_target_config.name this should be reverted.

>   
>           try:
>               sut_node.set_up_build_target(build_target_config)

> diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py
> index 2855fe0276..a4511157b7 100644
> --- a/dts/framework/testbed_model/sut_node.py
> +++ b/dts/framework/testbed_model/sut_node.py
> @@ -115,12 +115,7 @@ def remote_dpdk_build_dir(self) -> PurePath:
>           This is the directory where DPDK was built.
>           We assume it was built in a subdirectory of the extracted tarball.
>           """
> -        if self._build_target_config:
> -            return self.main_session.join_remote_path(
> -                self._remote_dpdk_dir, self._build_target_config.name
> -            )
> -        else:
> -            return self.main_session.join_remote_path(self._remote_dpdk_dir, "build")
> +        return self.main_session.join_remote_path(self._remote_dpdk_dir, "build")
>   

Same here, revert if we keep build_target_config.name.





More information about the dev mailing list