Closed waza-ari closed 2 years ago
Sure, I think it's a good idea.. I will be updating my development system soon to support it.
Hey, awesome, thanks! I’ll be more than happy to test a build. I wanted to compile and build it locally but already failed while downloading the required dependencies. I’m far from being a Go expect though, so that might simply be my stupidity.
Yeah I also want this. After playing around with my go environment I was able to build this using GOOS=darwin GOARCH=arm64
and it worked.
@alaaalii do you remember the steps you took to build it locally? I’d like to give it a shot as well.
Yeah sorry I wanted to post the steps yesterday but I had spent a couple of hours and did so many things, I couldn't remember exactly what worked :).
I actually just tried a different approach that worked again now. Here it is:
$GOPATH
is ~/go
and I don't care about anything in the environment so I just deleted everything under it and recreated the three folders ~/go/pkg
, ~/go/src
, and ~/go/bin
just to reset everything.mkdir -p ~/go/src/github.com/josenk cd ~/go/src/github.com/josenk git clone https://github.com/josenk/terraform-provider-esxi cd terraform-provider-esxi
go get
- this is what downloads all the required dependencies.GOOS=darwin GOARCH=arm64
, so the full command is:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags '-w -extldflags "-static"' -o terraform-provider-esxi_`cat version`
This will generate the terraform-provider-esxi_v1.9.1
file.
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/josenk/esxi/1.9.1/darwin_arm64/ cp terraform-provider-esxi_v1.9.1 ~/.terraform.d/plugins/registry.terraform.io/josenk/esxi/1.9.1/darwin_arm64/
.terraform.lock.hcl
file in my project then ran terraform init
and it initialized successfully.I'm using these versions:
alaa@laptop:~$ go version
go version go1.17.2 darwin/arm64
alaa@laptop:~$ terraform version
Terraform v1.0.10
on darwin_arm64
I think the problem with the build steps in this repo is the -u
option in the go get
command, because I believe that updates packages but this provider is referencing an old version of terraform in its build so the update messes stuff up - I don't know ¯\_(ツ)_/¯ .
done
Thanks for add darwin_arm64 and make it compatible.
But the OVF Tool dependency requires Rosetta2 :/ Any other way then the OVF Tool from VMware?
On Apple MacBooks with M1 processor (running
darwin_arm64
) architecture, there is currently no build available for your plugin.goreleaser
does support building for this platform, I guess the main problem is the GO version which must be at least 1.16.