aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2012-03-20 14:04:20 +1100
committerAlex Brainman <alex.brainman@gmail.com>2012-03-20 14:04:20 +1100
commit7fbef930a6f84b4ba57fa90a39131263967248f5 (patch)
tree3e74213b8a4bbb9506bcf4a19d0a0523004b0541
parent2a5879d1e2f397d71097b27eda74c7867f48094a (diff)
downloadgo-7fbef930a6f84b4ba57fa90a39131263967248f5.tar.gz
go-7fbef930a6f84b4ba57fa90a39131263967248f5.zip
build: do more during windows build
- use GO_GCFLAGS and GO_LDFLAGS if supplied - build misc\dashboard\builder and misc\goplay - run tests in test\bench\go1 - check api compatibility R=golang-dev, r, kardianos, bradfitz CC=golang-dev https://golang.org/cl/5847063
-rwxr-xr-xsrc/make.bash5
-rw-r--r--src/make.bat35
-rw-r--r--src/pkg/log/syslog/syslog_windows.go8
-rw-r--r--src/run.bat15
4 files changed, 56 insertions, 7 deletions
diff --git a/src/make.bash b/src/make.bash
index 080e0d6e1d..b2de37b724 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -23,8 +23,9 @@
# GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
# building the commands.
#
-# CGO_ENABLED: Setting this to 0 disables the use of cgo
-# in the built and installed packages and tools.
+# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
+# to include all cgo related files, .c and .go file with "cgo"
+# build directive, in the build. Set it to 0 to ignore them.
set -e
if [ ! -f run.bash ]; then
diff --git a/src/make.bat b/src/make.bat
index 82d9452f39..ec39392dd9 100644
--- a/src/make.bat
+++ b/src/make.bat
@@ -1,6 +1,31 @@
:: Copyright 2012 The Go Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style
:: license that can be found in the LICENSE file.
+
+:: Environment variables that control make.bat:
+::
+:: GOROOT_FINAL: The expected final Go root, baked into binaries.
+:: The default is the location of the Go tree during the build.
+::
+:: GOHOSTARCH: The architecture for host tools (compilers and
+:: binaries). Binaries of this type must be executable on the current
+:: system, so the only common reason to set this is to set
+:: GOHOSTARCH=386 on an amd64 machine.
+::
+:: GOARCH: The target architecture for installed packages and tools.
+::
+:: GOOS: The target operating system for installed packages and tools.
+::
+:: GO_GCFLAGS: Additional 5g/6g/8g arguments to use when
+:: building the packages and commands.
+::
+:: GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
+:: building the commands.
+::
+:: CGO_ENABLED: Controls cgo usage during the build. Set it to 1
+:: to include all cgo related files, .c and .go file with "cgo"
+:: build directive, in the build. Set it to 0 to ignore them.
+
@echo off
:: Keep environment variables within this script
@@ -17,6 +42,9 @@ echo Must run make.bat from Go src directory.
goto fail
:ok
+:: Clean old generated file that will cause problems in the build.
+del /F ".\pkg\runtime\runtime_defs.go" 2>NUL
+
:: Grab default GOROOT_FINAL and set GOROOT for build.
:: The expression %VAR:\=\\% means to take %VAR%
:: and apply the substitution \ = \\, escaping the
@@ -28,9 +56,6 @@ cd src
if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""
-:: Clean old generated file that will cause problems in the build.
-del /F ".\pkg\runtime\runtime_defs.go" 2>NUL
-
echo # Building C bootstrap tool.
echo cmd/dist
if not exist ..\bin\tool mkdir ..\bin\tool
@@ -62,14 +87,14 @@ echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
setlocal
set GOOS=%GOHOSTOS%
set GOARCH=%GOHOSTARCH%
-"%GOTOOLDIR%\go_bootstrap" install -v std
+"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -v std
endlocal
if errorlevel 1 goto fail
echo.
:mainbuild
echo # Building packages and commands.
-"%GOTOOLDIR%\go_bootstrap" install -a -v std
+"%GOTOOLDIR%\go_bootstrap" install -gcflags "%GO_GCFLAGS%" -ldflags "%GO_LDFLAGS%" -a -v std
if errorlevel 1 goto fail
del "%GOTOOLDIR%\go_bootstrap.exe"
echo.
diff --git a/src/pkg/log/syslog/syslog_windows.go b/src/pkg/log/syslog/syslog_windows.go
new file mode 100644
index 0000000000..8d99e2e594
--- /dev/null
+++ b/src/pkg/log/syslog/syslog_windows.go
@@ -0,0 +1,8 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package syslog provides a simple interface to the system log service.
+package syslog
+
+// BUG(brainman): This package is not implemented on Windows yet.
diff --git a/src/run.bat b/src/run.bat
index 1a3412602c..01d0b4f958 100644
--- a/src/run.bat
+++ b/src/run.bat
@@ -36,6 +36,16 @@ go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
echo.
+echo # ..\misc\dashboard\builder ..\misc\goplay
+go build ..\misc\dashboard\builder ..\misc\goplay
+if errorlevel 1 goto fail
+echo.
+
+echo # ..\test\bench\go1
+go test ..\test\bench\go1
+if errorlevel 1 goto fail
+echo.
+
:: TODO: The other tests in run.bash.
echo # test
@@ -47,6 +57,11 @@ cd ..\src
echo.
if %FAIL%==1 goto fail
+echo # Checking API compatibility.
+go tool api -c ..\api\go1.txt
+if errorlevel 1 goto fail
+echo.
+
echo ALL TESTS PASSED
goto end