Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

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 :-)

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.

Haha, you shouldn't have closed the previous PR just to update the code - GitHub will handle it for you automatically and let me approve the PR.
Nevertheless, please take another look at my review since there are still some things bothering me, thanks!

find_program(lsb_release_exec lsb_release)

if ("lsb_release_exec-NOTFOUND" STREQUAL "${lsb_release_exec}")
message(WARNING "Linux distribution couldn't be detected because `lsb_release' not found.")
Copy link
Member

Choose a reason for hiding this comment

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

There's a mismatch in the ticks here: `lsb_release' i.e The first is a back-tick, 2nd is a single-quote/tick.
I'd choose single-quotes here, so it'd become 'lsb_release'.

Also, I myself choose restrain from the word 'because' in technical information messages. IMHO a hyphen (-) is a much better choice, but I'll leave that for your judgement.

At last, I feel that saying a certain "thing" hasn't been found is not informative enough.
Correct me if I'm wrong, but I think that most of the users don't know that the lsb_release program is, so they'll just end up opening an issue here, asking for help. Instead, we could inform them that it's a package they need to install.
So I would rephrase it as such:

Linux distribution couldn't be detected - Please install 'lsb_release'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your suggestions!

@ooxi
Copy link
Contributor Author

ooxi commented Sep 25, 2018

I have reopened this pull request after applying the requested changes :-)

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 :-)
@MrPointer MrPointer merged commit ada111e into arduino-cmake:develop Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants