Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Commit 12f697c

Browse files
sesmith177Andrew Keesler
authored and
Andrew Keesler
committed
Update go build tasks to work around go1.11 symlink issue
See golang/go#27515 for context [#160287101] Signed-off-by: Andrew Keesler <[email protected]>
1 parent 7f68202 commit 12f697c

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

tasks/build-binary/run.ps1

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,15 @@ if ($env:BINARY_NAME -ne "") {
2828
$BINARY=(Get-Item $env:PACKAGE).BaseName + ".exe"
2929
}
3030

31-
go.exe build -o "binary-output/$BINARY" $env:PACKAGE
32-
if ($LastExitCode -ne 0) {
33-
exit $LastExitCode
31+
$binaryDir = "$PWD\binary-output"
32+
33+
# work around https://github.com/golang/go/issues/27515
34+
$linkType = (get-item $binaryDir).LinkType
35+
if ($linkType -ne "") {
36+
$binaryDir = (get-item $binaryDir).Target
3437
}
3538

36-
if ($BINARY -eq "winc-network") {
37-
gcc.exe -c "repo\network\firewall\dll\firewall.c" -o "$env:TEMP\firewall.o"
38-
if ($LastExitCode -ne 0) {
39-
exit $LastExitCode
40-
}
41-
gcc.exe -shared -o "binary-output\firewall.dll" "$env:TEMP\firewall.o" -lole32 -loleaut32
42-
if ($LastExitCode -ne 0) {
43-
exit $LastExitCode
44-
}
39+
go.exe build -o "$binaryDir\$BINARY" $env:PACKAGE
40+
if ($LastExitCode -ne 0) {
41+
exit $LastExitCode
4542
}

tasks/build-groot/run.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ go.exe version
66
$env:GOPATH=$PWD
77
$binaryDir = "$PWD\groot-binary"
88

9+
# work around https://github.com/golang/go/issues/27515
10+
$linkType = (get-item $binaryDir).LinkType
11+
if ($linkType -ne "") {
12+
$binaryDir = (get-item $binaryDir).Target
13+
}
14+
915
pushd src\code.cloudfoundry.org\groot-windows
1016
go build -o "$binaryDir\groot.exe" main.go
1117
if ($LastExitCode -ne 0) {

tasks/build-winc-network/run.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ go.exe version
66
$env:GOPATH=$PWD
77
$binaryDir = "$PWD\winc-network-binary"
88

9+
# work around https://github.com/golang/go/issues/27515
10+
$linkType = (get-item $binaryDir).LinkType
11+
if ($linkType -ne "") {
12+
$binaryDir = (get-item $binaryDir).Target
13+
}
14+
915
pushd src\code.cloudfoundry.org\winc
1016
if ($env:WINDOWS_VERSION -eq "1709") {
1117
go build -o "$binaryDir\winc-network.exe" .\cmd\winc-network

0 commit comments

Comments
 (0)