appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 64 forks source link

Go support broken on `Ubuntu` image #3840

Closed holiman closed 1 year ago

holiman commented 1 year ago

The appveyor updates as per september 2 says that the Ubuntu template contains

Go 1.19, 1.18.5, 1.17.13. Old versions prior 1.15.15 removed - can be installed during the build with gvm tool.

However, it seems to me that this is not true, and it indeed broke our (go-ethereum) Ubuntu/Go builds from that day. Example https://ci.appveyor.com/project/ethereum/go-ethereum/builds/44685236/job/txvt6qjiei64ybnq:

/opt/appveyor/build-agent/bash-shell.sh: line 51: go: command not found

So go does not exist or is not found.

I have done some experimentation. gvm list : https://ci.appveyor.com/project/ethereum/go-ethereum/build/job/77fr5lora1vh59a8

gvm gos (installed)
   go1.14.15

So gvm appears to believe that only an ancient go version is installed.

The $PATH appears to be

echo $PATH
/home/appveyor/.rvm/gems/ruby-2.7.2/bin:/home/appveyor/.rvm/gems/ruby-2.7.2@global/bin:/home/appveyor/.rvm/rubies/ruby-2.7.2/bin:/home/appveyor/.gvm/bin:/usr/lib/jvm/java-9-openjdk-amd64/bin:/home/appveyor/.nvm/versions/node/v16.17.0/bin:/opt/appveyor/build-agent:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/appveyor/.dotnet/tools:/home/appveyor/.rvm/bin:/opt/mssql-tools/bin:/home/appveyor/vcpkg

Using stack: https://ci.appveyor.com/project/ethereum/go-ethereum/builds/44683950/job/2993ay6u1no2o6u8

Configuring 'stack'
Enabling Go 1.18.5
go1.18.5 is not installed. Install it by running 'gvm install go1.18.5'

Tried using gvm install : https://ci.appveyor.com/project/ethereum/go-ethereum/builds/44683962/job/2494kjjlofj14625:

gvm install go1.18.5
Installing go1.18.5...
 * Compiling...
/home/appveyor/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /home/appveyor/.gvm/logs/go-go1.18.5-compile.log
ERROR: Failed to use installed version
Command exited with code 1
Build failed

Apparently gvm install doesn't work unless a go version is already present.

FeodorFitsner commented 1 year ago

Thanks for letting know, we are looking into that.

FeodorFitsner commented 1 year ago

Indeed, gvm install without -B option is trying to build Golang distro from sources and exising Golang installation is required as a "bootstrap".

Installing from binaries with -B works as expected: https://ci.appveyor.com/project/FeodorFitsner/appveyor-check/builds/44694405

However, go version not working before using gvm is another issue and it seems it's only reproducible on GCP environment images. Images on primary cloud work OK and there is a default go1.19 is available: https://ci.appveyor.com/project/FeodorFitsner/appveyor-check/builds/44694382

I'm going to investigate that.

GCP cloud is used as a backup cloud and I see you've been historically running there for some reason. I'd recommend you to try switching to an in-house Hyper-V cloud by removing APPVEYOR_BUILD_WORKER_CLOUD environment variable from your builds and see how that goes.

Let me know.

holiman commented 1 year ago

Yes, removing APPVEYOR_BUILD_WORKER_CLOUD fixed it, thanks. From my perspective this issue can be closed.

FeodorFitsner commented 1 year ago

OK, thanks for the update!