cloudfoundry / bosh-vsphere-cpi-release

BOSH vSphere CPI
Apache License 2.0
32 stars 36 forks source link

Incorrect go platform binary used when compiling iso9660wrap #356

Closed jimconner closed 1 year ago

jimconner commented 1 year ago

Describe the bug

Attempting to build bosh-vsphere-cpi v90 on MacOS fails when compiling iso9660wrap due to incorrect architecture of 'go' binary.

Even though the script detects that I am on Darwin as a platform, it then attempts to use the linux version of 'go' which is not compatible, resulting in an 'Exec format error'

To Reproduce Steps to reproduce the behavior:

  1. Use a Mac (either x64 or arm64 - the results are the same).
  2. Run a command which would cause CPI to be compiled (e.g by doing a bosh create-env)

CPI Error Log

+ platform=darwin
+ mkdir -p /Users/someone/.bosh/installations/35c949cf-1c59-4990-451d-9ea6a533050e/packages/iso9660wrap/bin
+ echo 'building iso9660wrap-darwin-amd64'
+ cd /Users/someone/.bosh/installations/35c949cf-1c59-4990-451d-9ea6a533050e/tmp/bosh-release-pkg2907244064/iso9660wrap
+ GOOS=darwin
+ GOARCH=amd64
+ CGO_ENABLED=0
+ go build -o /Users/someone/.bosh/installations/35c949cf-1c59-4990-451d-9ea6a533050e/packages/iso9660wrap/bin/iso9660wrap ./...
packaging: line 15: /Users/someone/.bosh/installations/35c949cf-1c59-4990-451d-9ea6a533050e/packages/golang-1-linux/bin/go: cannot execute binary file: Exec format error
':

Expected behavior CPI compilation completes normally.

Release Version & Related Info (please complete the following information):

Additional context Almost certainly related to #321 which is covering the fact that the darwin version of 'go' is currently unsued due to hardcoding in https://github.com/cloudfoundry/bosh-vsphere-cpi-release/blob/master/packages/iso9660wrap/packaging#L4

rkoster commented 1 year ago

@jpalermo is this related to: https://github.com/cloudfoundry/bosh-vsphere-cpi-release/issues/321#issuecomment-1194948512

jpalermo commented 1 year ago

Should be fixed in the next release by https://github.com/cloudfoundry/bosh-vsphere-cpi-release/commit/de1553b7f7ee0cf09119d2683edd3fc4a808a72c from @danielfor