Skip to content

Commit 9b0a06e

Browse files
committed
[nrf fromtree] scripts: west: nrfutil: Use build dir to store generated json
Until now the code was using the path to the .hex file to select the directory where the generated JSON file required for nrfutil would be generated. But this has a problem: if the .hex file in a sysbuild project is located in the tree as a precompiled binary, the runner would place a file in there and make the tree dirty. Instead use the build_dir folder which always corresponds (in both sysbuild and regular builds) to the current target build directory. Signed-off-by: Carles Cufi <[email protected]> (cherry picked from commit d6f5aa925832800204d3e0fe0015a924de5323f6)
1 parent c21478a commit 9b0a06e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/west_commands/runners/nrfutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def _append_batch(self, op, json_file):
152152

153153
def _exec_batch(self):
154154
# Use x-append-batch to get the JSON from nrfutil itself
155-
json_file = Path(self.hex_).parent / 'generated_nrfutil_batch.json'
155+
json_file = Path(self.cfg.build_dir) / 'zephyr' / 'generated_nrfutil_batch.json'
156156
json_file.unlink(missing_ok=True)
157157
for op in self._ops:
158158
self._append_batch(op, json_file)

0 commit comments

Comments
 (0)