Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Inform user of missing dependencies instead #33

Closed
ooxi wants to merge 1 commit into arduino-cmake:develop from ooxi:patch-1

Conversation

@ooxi
Copy link
Contributor

@ooxi ooxi commented Sep 25, 2018

Instead of failing with a cryptic error message like

CMake Error at /tmp/Arduino-CMake-NG/cmake/Platform/System/LinuxDistDetector.cmake:12 (string):
 string no output variable specified
Call Stack (most recent call first):
 /tmp/Arduino-CMake-NG/cmake/Platform/System/BuildSystemInitializer.cmake:25 (detect_host_linux_distribution)
 /tmp/Arduino-CMake-NG/cmake/Platform/Arduino.cmake:34 (initialize_build_system)
 /usr/share/cmake-3.10/Modules/CMakeSystemSpecificInformation.cmake:26 (include)
 CMakeLists.txt:2 (project)

let's fail with a clean message about missing dependencies :-)

Instead of failing with a cryptic error message like
```
CMake Error at /tmp/Arduino-CMake-NG/cmake/Platform/System/LinuxDistDetector.cmake:12 (string):
 string no output variable specified
Call Stack (most recent call first):
 /tmp/Arduino-CMake-NG/cmake/Platform/System/BuildSystemInitializer.cmake:25 (detect_host_linux_distribution)
 /tmp/Arduino-CMake-NG/cmake/Platform/Arduino.cmake:34 (initialize_build_system)
 /usr/share/cmake-3.10/Modules/CMakeSystemSpecificInformation.cmake:26 (include)
 CMakeLists.txt:2 (project)
```
let's fail with a clean message about missing dependencies :-)
Copy link
Member

@MrPointer MrPointer left a comment

Choose a reason for hiding this comment

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

@ooxi Welcome to the project and thank you very much for this contribution!
You've noticed a very subtle bug and I really appreciate the effort to fix it yourself!
It looks good, I just have a few notes for you to look at in the review comments 😄

find_program(lsb_release_exec lsb_release)

if ("lsb_release_exec-NOTFOUND" STREQUAL "${lsb_release_exec}")
message(FATAL_ERROR "`lsb_release' not found")
Copy link
Member

@MrPointer MrPointer Sep 25, 2018
edited
Loading

Choose a reason for hiding this comment

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

FATAL_ERROR fails the whole CMake process, which is something we don't really want to do here since the dist-detection module is not part of the framework's core, just a nice-to-have feature 😃
Instead, use WARNING to inform the user that it won't benefit from this module until it installs missing dependencies.

Besides, I think it'd be more informative if the message also stated that "Linux distribution couldn't be detected", then the exact reason why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the fast feedback, I'll update my pull request!

@ooxi ooxi closed this Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer

@MrPointer MrPointer MrPointer requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /