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

Proposal: Rebuild *.cbuild.yml and *.cbuild-idx.yml files when using cbuild -r option #1094

Closed
ReinhardKeil opened this issue Aug 23, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ReinhardKeil
Copy link
Collaborator

This is not necessarily a bug, but an improvement suggestion.

Using cbuild hello.csolution.yml does not overwrite *.cbuild.yml and *.cbuild-idx.yml files when they exist. This is a great feature!

But I would recommend that when using the option -r, these files are regenerated.

Note: There seems to be a small bug, as in the generated-by tag the version number is not compared, but that might be also a feature.

@ReinhardKeil ReinhardKeil added the bug Something isn't working label Aug 23, 2023
@jkrech
Copy link
Member

jkrech commented Aug 24, 2023

Today cbuild's -r --rebuild option is probably only forwarded to the invocation of the cmake command. This means we may need to better understand whether csolution should have a command line option to control the cbuild.yml generation more precisely. If we leave cbuild.yml files from previous tool invocation untouched, this bears the risk that they are outdated when inspected or used by other tools.

@ReinhardKeil
Copy link
Collaborator Author

Note that this behavior is somewhat inconsistent. When using cbuild with option -r on the csolution examples it:

  • rebuilds all files for the SimpleTZ.csolution.yml
  • does not rebuild all files for the Hello.csolution.yml

@soumeh01
Copy link
Collaborator

The files (*.cbuild.yml and *.cbuild-idx.yml) are only overwritten when the content already present in the files differs from the new content being introduced. csolution always processes the information that needs to go into the files and then compares it with the existing content. If there is any difference, it overwrites it with the newly processed information.

After this fix Clean all selected contexts before rebuilding, The inconsistency is no more there.

$ cbuild.exe ./SimpleTrustZone/SimpleTZ.csolution.yml -r
<PATH>/csolution-examples/SimpleTrustZone/CM33_s/CM33_s.Debug+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/SimpleTrustZone/CM33_s/CM33_s.Release+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/SimpleTrustZone/CM33_ns/CM33_ns.Debug+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/SimpleTrustZone/CM33_ns/CM33_ns.Release+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/SimpleTrustZone/CM33_s/CM33_s.Debug+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/SimpleTrustZone/CM33_s/CM33_s.Release+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/SimpleTrustZone/CM33_ns/CM33_ns.Debug+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/SimpleTrustZone/CM33_ns/CM33_ns.Release+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/SimpleTrustZone/SimpleTZ.cbuild-idx.yml - info csolution: file is already up-to-date
$ cbuild.exe ./Hello/Hello.csolution.yml -r
<PATH>/csolution-examples/Hello/Hello.Debug+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/Hello/Hello.Release+AVH.cprj - info csolution: file generated successfully
<PATH>/csolution-examples/Hello/Hello.Debug+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/Hello/Hello.Release+AVH.cbuild.yml - info csolution: file is already up-to-date
<PATH>/csolution-examples/Hello/Hello.cbuild-idx.yml - info csolution: file is already up-to-date

@jkrech
Copy link
Member

jkrech commented Sep 3, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants