From 795a8179209a74a3277b73e60c6af226d55dc5a7 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Thu, 29 Jun 2017 17:55:14 -0400 Subject: [PATCH] Allow BAL to be built for Windows [#147845349] Signed-off-by: Amin Jamali --- .gitmodules | 3 +++ packages/buildpack_app_lifecycle/packaging | 7 ++++++- packages/buildpack_app_lifecycle/spec | 1 + src/golang.org/x/sys | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 160000 src/golang.org/x/sys diff --git a/.gitmodules b/.gitmodules index bdf5081d95..1ef603cef2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -386,3 +386,6 @@ [submodule "src/golang.org/x/text"] path = src/golang.org/x/text url = https://go.googlesource.com/text +[submodule "src/golang.org/x/sys"] + path = src/golang.org/x/sys + url = https://go.googlesource.com/sys diff --git a/packages/buildpack_app_lifecycle/packaging b/packages/buildpack_app_lifecycle/packaging index 100ecc4b48..99452317e3 100644 --- a/packages/buildpack_app_lifecycle/packaging +++ b/packages/buildpack_app_lifecycle/packaging @@ -10,14 +10,19 @@ export PATH=$GOROOT/bin:$PATH CGO_ENABLED=0 go build -a -installsuffix static code.cloudfoundry.org/buildpackapplifecycle/builder CGO_ENABLED=0 go build -a -installsuffix static code.cloudfoundry.org/buildpackapplifecycle/launcher +GOOS=windows CGO_ENABLED=0 go build -a -installsuffix static code.cloudfoundry.org/buildpackapplifecycle/builder +GOOS=windows CGO_ENABLED=0 go build -a -installsuffix static code.cloudfoundry.org/buildpackapplifecycle/launcher + for binary in builder launcher; do ldd $binary && echo "$binary must be statically linked" && false done tar -xzf /var/vcap/packages/diego-sshd/diego-sshd.tgz +tar -xzf /var/vcap/packages/diego-sshd/diego-sshd-windows.tgz cp /var/vcap/packages/healthcheck/healthcheck . +cp /var/vcap/packages/healthcheck/healthcheck.exe . -tar -czf ${BOSH_INSTALL_TARGET}/buildpack_app_lifecycle.tgz builder launcher healthcheck diego-sshd +tar -czf ${BOSH_INSTALL_TARGET}/buildpack_app_lifecycle.tgz builder launcher healthcheck diego-sshd builder.exe launcher.exe healthcheck.exe diego-sshd.exe # clean up source artifacts rm -rf ${BOSH_INSTALL_TARGET}/src ${BOSH_INSTALL_TARGET}/pkg diff --git a/packages/buildpack_app_lifecycle/spec b/packages/buildpack_app_lifecycle/spec index 29729b5b32..33c43e5754 100644 --- a/packages/buildpack_app_lifecycle/spec +++ b/packages/buildpack_app_lifecycle/spec @@ -18,3 +18,4 @@ files: - code.cloudfoundry.org/lager/*.go # gosub - code.cloudfoundry.org/systemcerts/*.go # gosub - github.com/cloudfoundry-incubator/candiedyaml/*.go # gosub + - golang.org/x/sys/windows/**/* #gosub diff --git a/src/golang.org/x/sys b/src/golang.org/x/sys new file mode 160000 index 0000000000..90796e5a05 --- /dev/null +++ b/src/golang.org/x/sys @@ -0,0 +1 @@ +Subproject commit 90796e5a05ce440b41c768bd9af257005e470461