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

Failed to check CMake version #37381

Closed
xiangzhai opened this issue Jun 4, 2020 · 3 comments
Closed

Failed to check CMake version #37381

xiangzhai opened this issue Jun 4, 2020 · 3 comments

Comments

@xiangzhai
Copy link
Contributor

Hi,

Description

When building coreclr:

./src/coreclr/build-runtime.sh

check_prereqs failed to check CMake version:

Commencing CoreCLR Repo build
__DistroRid: linux-mips64
__RuntimeId: linux-mips64
Setting up directories for build
Checking prerequisites...
/usr/bin/cmake
Found cmake v in PATH. Please install v3.14.5 or newer from https://www.cmake.org/download/.

Because cmake --version is:

cmake version 3.16.20191127-g7046a52

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Workaround patch:

diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh
index 31d8d8b..735a090 100755
--- a/eng/native/build-commons.sh
+++ b/eng/native/build-commons.sh
@@ -54,7 +54,7 @@ check_prereqs()
     function version { echo "$@" | awk -F. '{ printf("%d%02d%02d\n", $1,$2,$3); }'; }
 
     local cmakeRequiredMinimumVersion="3.14.5"
-    local cmakeInstalledVersion="$(cmake --version | awk '/^cmake.* version [0-9]+\.[0-9]+\.[0-9]+$/ {print $3}')"
+    local cmakeInstalledVersion="$(cmake --version 2>&1 | sed '1!d' | sed -e 's/"//g' | awk '{print $3}')"
 
     if [[ "$(version "$cmakeInstalledVersion")" -lt "$(version "$cmakeRequiredMinimumVersion")" ]]; then
         echo "Found cmake v$cmakeInstalledVersion in PATH. Please install v$cmakeRequiredMinimumVersion or newer from https://www.cmake.org/download/."

Thanks,
Leslie Zhai

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner labels Jun 4, 2020
@BruceForstall
Copy link
Member

@xiangzhai Looks ok to me. presumably it will compare "3.14.5" against "3.16.20191127-g7046a52" which will do the right thing?

Can you submit a PR?

@xiangzhai
Copy link
Contributor Author

Hi @BruceForstall

Can you submit a PR?

#37398

Thanks,
Leslie Zhai

@jashook jashook removed the untriaged New issue has not been triaged by the area owner label Jul 13, 2020
@jashook
Copy link
Contributor

jashook commented Jul 17, 2020

Addressed

@jashook jashook closed this as completed Jul 17, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants