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

Is it possible to get different "exit code" ? #316

Open
jeromecoutant opened this issue Sep 16, 2021 · 1 comment
Open

Is it possible to get different "exit code" ? #316

jeromecoutant opened this issue Sep 16, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jeromecoutant
Copy link

Is your feature request related to a problem? Please describe.

Goal is to use `mbedtools compile xxx`` commands in scripts.

It seems that "exit code" is currently 0 when it is successful, 1 in case of issue.

Describe the solution you'd like

Do you think it is possible to have more error codes ?

  • 1 would be the default error code
  • 2 for issue in mbed_validate_application_profile function?
  • 3 in case of CMakeLists.txt configuration issue?
  • etc...

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jeromecoutant jeromecoutant added the enhancement New feature or request label Sep 16, 2021
@rwalton-arm
Copy link
Contributor

This seems like a good addition to allow use of mbed-tools in scripts.

One thing to note: CMake just returns 1 for any configuration error, including the FATAL_ERROR raised by mbed_validate_application_profile. So, to implement the suggested error codes, we would have to check the stderr from CMake, then decide which exit code to return based on the output messages. This doesn't seem like a robust solution as the CMake output messages could change at any time.

If we decide not to create specific exit codes for different CMake configuration failures, we could at least define the following exit codes relatively easily:

  • MBED_CONFIG_PROCESSING_ERROR
  • CMAKE_CONFIGURATION_ERROR
  • CMAKE_BUILD_ERROR

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

No branches or pull requests

2 participants