Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] rimage: Add support for multiple toml file #176

Closed
wants to merge 1 commit into from

Conversation

aiChaoSONG
Copy link

This patch adds support for multiple toml
configuration file.

This patch adds support for multiple toml
configuration file.

Signed-off-by: Chao Song <[email protected]>
@aiChaoSONG aiChaoSONG requested review from kv2019i and lyakh September 4, 2023 07:06
@aiChaoSONG
Copy link
Author

The toml lib we use can not support toml merging, we need to merge multiple files together before parsing. This RFC used a function fmemopen, I am not sure if MSVC toolchain support it. I could also use temp file for merging if fmemopen is not supported.

@aiChaoSONG
Copy link
Author

@kv2019i @lgirdwood refering to thesofproject/sof#7270 and this RFC, could you please comment?

buf[file_size[i]] = '\n';
buf += file_size[i] + 1;
}
return fmemopen(files->buffer, buf_size, mode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this is quite clever approach. "fmemopen()" will potentially hit some compatibility issues, so needs a smoketest on Windows at minimum.

I was actually thinking of something much more low-tech. I.e. "cat a.toml b.toml >$BUILD/rimage.toml" in make rules, and pass generated "rimage.toml" to rimage. But making this in a portable way is not zero effort either, so I guess depends in the end what is the lowest effort way to make this so that it works across platforms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new proposal, see #179, this probably won't work on windows, let's close

@marc-hb
Copy link
Contributor

marc-hb commented Sep 25, 2023

I was actually thinking of something much more low-tech. I.e. "cat a.toml b.toml >$BUILD/rimage.toml" in make rules, and pass generated "rimage.toml" to rimage. But making this in a portable way is not zero effort either,

Windows has mktemp too so it should really not be that hard to do in rimage.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktemp-s-wmktemp-s?view=msvc-170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants