MCPcopy Create free account
hub / github.com/F-Stack/f-stack / build_dpdk

Method build_dpdk

dpdk/dts/framework/remote_session/posix_session.py:103–138  ·  view source on GitHub ↗
(
        self,
        env_vars: dict,
        meson_args: MesonArgs,
        remote_dpdk_dir: str | PurePath,
        remote_dpdk_build_dir: str | PurePath,
        rebuild: bool = False,
        timeout: float = SETTINGS.compile_timeout,
    )

Source from the content-addressed store, hash-verified

101 self.send_command(f"ls {expected_dir}", verify=True)
102
103 def build_dpdk(
104 self,
105 env_vars: dict,
106 meson_args: MesonArgs,
107 remote_dpdk_dir: str | PurePath,
108 remote_dpdk_build_dir: str | PurePath,
109 rebuild: bool = False,
110 timeout: float = SETTINGS.compile_timeout,
111 ) -> None:
112 try:
113 if rebuild:
114 # reconfigure, then build
115 self._logger.info("Reconfiguring DPDK build.")
116 self.send_command(
117 f"meson configure {meson_args} {remote_dpdk_build_dir}",
118 timeout,
119 verify=True,
120 env=env_vars,
121 )
122 else:
123 # fresh build - remove target dir first, then build from scratch
124 self._logger.info("Configuring DPDK build from scratch.")
125 self.remove_remote_dir(remote_dpdk_build_dir)
126 self.send_command(
127 f"meson setup {meson_args} {remote_dpdk_dir} {remote_dpdk_build_dir}",
128 timeout,
129 verify=True,
130 env=env_vars,
131 )
132
133 self._logger.info("Building DPDK.")
134 self.send_command(
135 f"ninja -C {remote_dpdk_build_dir}", timeout, verify=True, env=env_vars
136 )
137 except RemoteCommandExecutionError as e:
138 raise DPDKBuildError(f"DPDK build failed when doing '{e.command}'.")
139
140 def get_dpdk_version(self, build_dir: str | PurePath) -> str:
141 out = self.send_command(f"cat {self.join_remote_path(build_dir, 'VERSION')}", verify=True)

Callers

nothing calls this directly

Calls 3

remove_remote_dirMethod · 0.95
DPDKBuildErrorClass · 0.90
send_commandMethod · 0.45

Tested by

no test coverage detected