From a70334988311c2774937a909bea4776836df33cc Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 18 Jan 2017 04:57:11 -0600 Subject: [PATCH] Put the commit hash into the msvc binary package --- .gitattributes | 1 - ship/make_msvc_package.py | 3 ++- src/shared/{GetCommitHash.cmd => GetCommitHash.bat} | 0 src/shared/UpdateGenVersion.bat | 8 ++------ src/winpty.gyp | 5 ++++- vcbuild.bat | 5 +++++ 6 files changed, 13 insertions(+), 9 deletions(-) rename src/shared/{GetCommitHash.cmd => GetCommitHash.bat} (100%) diff --git a/.gitattributes b/.gitattributes index ee95542..36d4c60 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,4 +17,3 @@ configure text *.sh eol=lf configure eol=lf VERSION.txt eol=lf -shared/GetCommitHash.cmd text eol=crlf diff --git a/ship/make_msvc_package.py b/ship/make_msvc_package.py index fef5d0e..220f02b 100755 --- a/ship/make_msvc_package.py +++ b/ship/make_msvc_package.py @@ -106,7 +106,8 @@ def build(arch, packageDir, xp=False): '"' + devCmdPath + '" && ' " vcbuild.bat" + " --gyp-msvs-version " + versionInfo["gyp_version"] + - " --msvc-platform " + archInfo["msvc_platform"] + " --msvc-platform " + archInfo["msvc_platform"] + + " --commit-hash " + common_ship.commitHash ) subprocess.check_call(commandLine, shell=True, env=newEnv) diff --git a/src/shared/GetCommitHash.cmd b/src/shared/GetCommitHash.bat similarity index 100% rename from src/shared/GetCommitHash.cmd rename to src/shared/GetCommitHash.bat diff --git a/src/shared/UpdateGenVersion.bat b/src/shared/UpdateGenVersion.bat index cab3520..ea2a7d6 100755 --- a/src/shared/UpdateGenVersion.bat +++ b/src/shared/UpdateGenVersion.bat @@ -6,13 +6,9 @@ rem -- output nothing instead. mkdir ..\gen 2>nul set /p VERSION=<..\..\VERSION.txt -git rev-parse HEAD >nul 2>nul && ( - for /F "delims=" %%i IN ('git rev-parse HEAD') DO set COMMIT=%%i -) || ( - set COMMIT=none -) +set COMMIT=%1 -echo // AUTO-GENERATED BY %0>..\gen\GenVersion.h +echo // AUTO-GENERATED BY %0 %*>..\gen\GenVersion.h echo const char GenVersion_Version[] = "%VERSION%";>>..\gen\GenVersion.h echo const char GenVersion_Commit[] = "%COMMIT%";>>..\gen\GenVersion.h diff --git a/src/winpty.gyp b/src/winpty.gyp index f4aae21..7ee68d5 100644 --- a/src/winpty.gyp +++ b/src/winpty.gyp @@ -9,6 +9,9 @@ # can be configured by passing variables to make, e.g.: # make -j4 CXX=i686-w64-mingw32-g++ LDFLAGS="-static -static-libgcc -static-libstdc++" + 'variables': { + 'WINPTY_COMMIT_HASH%': '