Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
76 stars 59 forks source link

Clean does not work for multitarget projects #1809

Open KimmoVaisanen-AlifSemi opened 1 month ago

KimmoVaisanen-AlifSemi commented 1 month ago

Describe the bug cmsis-toolbox 2.6.0/2.6.1 fails to clean multitarget/compiler project.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/alifsemi/alif_vscode-template
  2. install submodules (git submodule update --init)
  3. Open project with VSCode
  4. Update cmsis-toolbox to version 2.6.1 in vcpkg-configuration.json
  5. Run Task First time pack installation
  6. Build the project from CMSIS menu
  7. Clean project

Expected behavior Project is cleaned

Observed behavior

Environment (please complete the following information):

Additional context This works ok with cmsis-toolbox v2.4.0

ReinhardKeil commented 1 month ago

Thanks for this example.

I have not installed the pack yet, and get

cbuild setup c:\Test\alif_vscode-template\alif.csolution.yaml --context-set --context blinky.debug+HE --context hello.debug+HE --context hello_rtt.debug+HE --packs --update-rte
error cbuild: invalid file argument

NOTE: this is because you did install CMSIS-Toolbox 2.4.0. So we should ensure that 2.6.1 is installed.

KimmoVaisanen-AlifSemi commented 1 month ago

Yes, sorry, forgot to mention that toolbox has to be updated manually. We haven't pushed 2.6.1 yet until we get these other issues resolved.

ReinhardKeil commented 1 month ago

NOTE: "Run Task First time pack installation" does not work on Windows.

This should do the job on all OS systems (provided that the pack is public). And the new vscode extension executes this anyway with the default configuration.

  cbuild setup alif.csolution.yaml --packs

I agree with you that --clean should not be so sensitive to missing files. Hence we leave this ticket open.

However, the RTE files should be part of the repo, see here https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/build-overview.md#reproducible-builds

You might be interested in our device specific templates: https://github.com/Open-CMSIS-Pack/STM32F4xx_DFP/blob/main/Keil.STM32F4xx_DFP.pdsc#L3789

It allows you to start new projects with a defined setup. Use the New Project feature in VSCode.

KimmoVaisanen-AlifSemi commented 1 month ago

Thank you. I modified our template to the new format (compiler selection) and now cleaning works.

I'll check the RTE files. Actually with the latest versions, without RTE files in version control, the 1st build will fail until you run --update-rte. The easiest workaround in our template is to go into Manage Solution and click other target and that seems to trigger the update. But if RTE files are required to keep within the version control (as documented), we can add those as well.

ReinhardKeil commented 1 month ago

Yes, before it called cbuild setup --update-rte, but the consequence is that just opening a project modifies files. We have removed therefore this feature.

RTE files contain configuration settings. When you are only using defaults then --update-rte does the job, but we would like to avoid that users loose config settings.

ReinhardKeil commented 6 days ago

I suggest to implement clean with the following behaviour:

Discussion point: should this be more pragmatic and delete always all files in outdir:?