From 7261b7140f5abf27d83c1c0ba0cdf6a6168e6ab8 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 6 Sep 2016 10:04:37 +0200 Subject: [PATCH 1/2] Do not run gofmt in the src directory All the src contains is a symbolic link to the root, causing gofmt to indefinitely recurse until it errors out. On Windows, this causes an error message like GetFileAttributesEx src\github.com\github\git-lfs\src\github.com\github\git-lfs\src\github.com\github\git-lfs\src\github.com\github\git-lfs\src\github.com\github\git-lfs\.git\objects\pack\pack-2fc21819ce9855ebf1a1f3ac77cf464c8a4e6e42.idx: The system cannot find the path specified. --- script/fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/fmt b/script/fmt index e0ac0921..dc2d39a0 100755 --- a/script/fmt +++ b/script/fmt @@ -6,7 +6,7 @@ hash goimports 2>/dev/null && { } # don't run gofmt in these directories -ignored=(/bin/ /docs/ /log/ /man/ /tmp/ /vendor/ /rpm/ /docker/ /debian/) +ignored=(/bin/ /docs/ /log/ /man/ /tmp/ /vendor/ /rpm/ /docker/ /debian/ /src/) for i in */ ; do if [[ ! ${ignored[*]} =~ "/$i" ]]; then $formatter -w -l "$@" "${i%?}" From 63dac507b68ba8f426201d6e6b25963bb3696edf Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 6 Sep 2016 09:11:16 +0200 Subject: [PATCH 2/2] Make the AppVeyor CI build work again AppVeyor now has Go and Git for Windows 2.x installed by default. Also, we can tell MSYS to actually create symbolic links. Finally, let the CI create the installer, too. --- appveyor.yml | 63 +++++++++--------------------------------------- script/bootstrap | 10 +++++--- 2 files changed, 19 insertions(+), 54 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 07f10493..0f1c45b3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,56 +1,17 @@ -version: 1.0.{build} -init: -- cmd: >- - set REPO_DIR=%cd% - - - mkdir %BASHROOT% - - cd %BASHROOT% - - - curl -LOk https://github.com/git-for-windows/git/releases/download/v2.6.2.windows.1/PortableGit-2.6.2-64-bit.7z.exe - - - 7z x PortableGit-2.6.2-64-bit.7z.exe > nul - - - mkdir c:\go15 - - cd \go15 - - - curl -LO https://storage.googleapis.com/golang/go1.5.1.windows-amd64.zip - - unzip -o go1.5.1.windows-amd64.zip > nul - - - set PATH=%BASHROOT%\bin;%GOROOT%\bin;%PATH% - - - cd %REPO_DIR% -environment: - GOROOT: c:\go15\go - BASHROOT: c:\bash2 install: -- cmd: + - cinst InnoSetup -y + - set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH% + build_script: -- cmd: >- - mkdir src\github.com\github + - bash -c 'GOARCH=386 script/bootstrap' + - mv bin\git-lfs git-lfs-x86.exe + - bash -c 'GOARCH=amd64 script/bootstrap' + - mv bin\git-lfs git-lfs-x64.exe +after_build: + - iscc script\windows-installer\inno-setup-git-lfs-installer.iss - mklink /J src\github.com\github\git-lfs . - - - set GOPATH=%CD% - - - go version - - - bash script\bootstrap - - - mv bin\git-lfs bin\git-lfs.exe artifacts: -- path: bin\git-lfs.exe \ No newline at end of file + - path: git-lfs-x86.exe + - path: git-lfs-x64.exe + - path: git-lfs-windows-*.exe diff --git a/script/bootstrap b/script/bootstrap index 14ae3373..c7be87f8 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -1,9 +1,13 @@ #!/usr/bin/env bash set -e -# Only set GOPATH on non-Windows platforms as Windows can't do the symlinking -# that we need. -if [ -z "$GOPATH" ] && uname -s | grep -vq "_NT-"; then +if uname -s | grep -q "_NT-"; then + # Tell Cygwin / MSYS to really create symbolic links. + export CYGWIN="$CYGWIN winsymlinks:nativestrict" + export MSYS="$MSYS winsymlinks:nativestrict" +fi + +if [ -z "$GOPATH" ]; then export GOPATH="$(pwd)" mkdir -p src/github.com/github [ -h src/github.com/github/git-lfs ] ||