Commit 2ee6c26d authored by Marc Herbert's avatar Marc Herbert Committed by Anas Nashif
Browse files

west: sign.py: rename new `generated/platf.toml` to `rimage_config.toml`

CMake-based build systems like Zephyr's use separate build directories;
one for each build configuration. Even Zephyr's multi-build system
"sysbuild" (which is not relevant here) uses separate subdirectories.

So there is only one pre-processed, .toml file generated by build
directory and no need to vary its filename based on the platform name or
any other configuration parameter. It can and should keep the same
filename across build directories as zephyr.elf and all other build
artefacts do.

Moreover, when building a collection of configurations (as for instance
`sof/scripts/xtensa-build-zephyr.py` does), keeping all build
directories consistent with each other simplifies installation,
checksumming and any other post-processing.

"Fixes" recent commit 15336045 ("west: sign.py: generate platf.toml
from platf.toml.h with cc -E")

Signed-off-by: default avatarMarc Herbert <marc.herbert@intel.com>
parent fe75bb95
Loading
Loading
Loading
Loading
+4 −5
Changes for scripts/west_commands/sign.py: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ class RimageSigner(Signer):
        preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
        preproc_cmd += ['-imacros',
                        str(pathlib.Path('zephyr') / 'include' / 'generated' / 'autoconf.h')]
        preproc_cmd += ['-o', str(subdir / toml_basename)]
        preproc_cmd += ['-o', str(subdir / 'rimage_config.toml')]
        self.command.inf(quote_sh_list(preproc_cmd))
        subprocess.run(preproc_cmd, check=True, cwd=self.build_dir)

@@ -573,12 +573,11 @@ class RimageSigner(Signer):
                command.die(f"Cannot have both {toml_basename + '.h'} and {toml_basename} in {conf_dir}")

            if (conf_dir / (toml_basename + '.h')).exists():
                toml_subdir = pathlib.Path('zephyr') / 'misc' / 'generated'
                self.preprocess_toml(conf_dir, toml_basename, toml_subdir)
                toml_dir = b / toml_subdir
                generated_subdir = pathlib.Path('zephyr') / 'misc' / 'generated'
                self.preprocess_toml(conf_dir, toml_basename, generated_subdir)
                extra_ri_args += ['-c', str(b / generated_subdir / 'rimage_config.toml')]
            else:
                toml_dir = conf_dir

                extra_ri_args += ['-c', str(toml_dir / toml_basename)]

        # Warning: while not officially supported (yet?), the rimage --option that is last