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

[Bug ?] "executes:" not handled correctly #168

Closed
3 of 13 tasks
saperlot opened this issue Sep 6, 2024 · 8 comments
Closed
3 of 13 tasks

[Bug ?] "executes:" not handled correctly #168

saperlot opened this issue Sep 6, 2024 · 8 comments

Comments

@saperlot
Copy link

saperlot commented Sep 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Unusable feature

Post Build scripts are not executed corretly.

Current Behavior

For example:

Included in csolution.yml:

 executes:
    - execute: include CRC
      run: somebat.bat $input$ $output$
      always:
      input:
        - $hex()$
      output:
        - $hex()$_crc
      for-context:
        - .Debug
  • when cbuild *** --context-set --context ***.Debug*** is issued, the script wont execute.
  • when no context was set with cbuild it executes on Debug context build.

Now if we remove the for-context in executes: config:

  • when building with --context, the script wont execute.
  • when no context was set with cbuild it executes only on Debug context build.

Now if we set the for-context to - .Release in executes: config:

  • when building with --context ***-Release+*** , error appears:
    error csolution: context ".Debug+" referenced by access sequence 'hex' does not exist or is not selected
  • when building without context set, it executes with hex files in the Debug output folder.

--> So executes is not usable, which is a neccessary feature, therefore i've set it as a blocker

Another issue is, that build script execution direction is tmp/ I would assume that base directory to be on root.

Expected Behavior

Executes handled correctly.

Steps To Reproduce

--> see current behavior

Affected tools

  • cbuild
  • cbuild2cmake
  • cpackget
  • csolution
  • packchk
  • svdconv

Affected operating systems

  • Windows amd64
  • Windows arm64
  • Linux amd64
  • Linux arm64
  • MacOS amd64
  • MacOS arm64

Environment

Windows 11
cmsis-toolbox: 2.5.0

@saperlot saperlot added bug Something isn't working critical Sever bug that blocks certain use-cases labels Sep 6, 2024
@ReinhardKeil
Copy link
Collaborator

ReinhardKeil commented Sep 6, 2024

@saperlot do you apply execute: in the *.cproject.yml file or in the *.csolution.yml file?

Forget the request, the information is there.

@saperlot
Copy link
Author

saperlot commented Sep 6, 2024

I've just tried it again within cproject.yml. But here it will fail when the batch file does not return Status OK.
So then, i've included EXIT /B 0 at the end of the batch, and it does execute on both buildtypes with correct files.

But it still only execute without --contex builds.

@brondani
Copy link
Collaborator

brondani commented Sep 6, 2024

As documented here please note for-context and not-for-context are only supported when the execute node is in *.cproject.yml, in such case the execute is iterated and runs for each context:
https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/2.5.0/docs/YML-Input-Format.md#executes

The execute nodes in *.csolution.yml are considered at solution level and for this reason they run just once, they are not iterated over multiple contexts.

@jkrech jkrech removed the critical Sever bug that blocks certain use-cases label Sep 10, 2024
@jkrech
Copy link
Member

jkrech commented Sep 10, 2024

@saperlot I have removed the critical label for now. Given Daniel's link to the documentation, do you still believe the behavior of the tools is different from what has been documented?

@jkrech jkrech changed the title [Blocker]: "executes:" not handled correctly [Bug ?] "executes:" not handled correctly Sep 10, 2024
@saperlot
Copy link
Author

@jkrech I do not have a for-context directive in the executes config. What i mean with "But it still only execute without --contex builds." is that when i issue a build command from vsocode cmsis extensions build button, then it only builds the current active context with cbuild *** --context-set --context ***.Debug*** in this scenario, the execute command wont be executed.

@ReinhardKeil
Copy link
Collaborator

ReinhardKeil commented Sep 12, 2024

Thank for raising this issues. We improved the description https://github.com/ReinhardKeil/cmsis-toolbox/blob/main/docs/YML-Input-Format.md#executes. The executes: node are only processed on full application builds. Using --context triggers only project builds. Using --context-set works fine.

We will work on better messaging for the user to indicate when execute: commands are performed.

@jkrech
Copy link
Member

jkrech commented Sep 17, 2024

Can this issue be closed?

jkrech pushed a commit that referenced this issue Sep 17, 2024
Improved description for executes: node addresses issues:
- #168
- Open-CMSIS-Pack/devtools#1043
- Open-CMSIS-Pack/devtools#1735
- Open-CMSIS-Pack/devtools#1561
Added new cpackget options
Open-CMSIS-Pack/cpackget#324
Added to cbuild-idx.yml apis, component file status, messages
Improve documentation for Linker Script generation
@jkrech jkrech removed the bug Something isn't working label Oct 1, 2024
@jkrech
Copy link
Member

jkrech commented Oct 1, 2024

This issue Open-CMSIS-Pack/cbuild2cmake#185 will probably address your concern.

@jkrech jkrech closed this as completed Oct 1, 2024
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

No branches or pull requests

4 participants