giongto35 / cloud-game

Web-based Cloud Gaming service for Retro Game
https://www.youtube.com/watch?v=GUBrJGAxZZg
Apache License 2.0
2.28k stars 345 forks source link

error Debian 11 EC2: folder build already exist to first make #346

Closed ImanCol closed 3 years ago

ImanCol commented 3 years ago

I had an error in which I could not copy the coordinate files in the bin folder, because that folder already existed. This happened on the first build.

go: downloading golang.org/x/text v0.3.7 //From here it did not happen and the error occurred that the folder existed and stopped the make go build -buildmode=exe -o bin/ ./cmd/worker go: downloading github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 when I run it for the second time, it no longer gives that problem.

sergystepanov commented 3 years ago

@ImanCol, could you please explain your problem again? What command do you run for the build? And does this problem still persist?

Make sure you use the latest code. Every push to this repository starts a bunch of build jobs for different OSes, so far everything builds just fine. I recommend using prebuilt Docker images from here.

ImanCol commented 3 years ago

@ImanCol, could you please explain your problem again? What command do you run for the build? And does this problem still persist?

Make sure you use the latest code. Every push to this repository starts a bunch of build jobs for different OSes, so far everything builds just fine. I recommend using prebuilt Docker images from here.

I've been using Debian 11, recommended here. Run this on the Amazon AWS EC2 Free Tier. Some packages are not available so I had to do some previous installations. Use these:


sudo apt install golang-go
sudo apt-get install pip
sudo pip install pyngrok --quiet
sudo ngrok
sudo ngrok http 8000

//Open another command promp
sudo apt-get install -y make gcc pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev
sudo apt-get install git
sudo git clone https://github.com/giongto35/cloud-game.git
cd cloud-games
sudo make dev.run
//Error, can't copy, bin directory already exists
//run again...
sudo make dev.run
//Succeful```
sergystepanov commented 3 years ago

Reproduced this "bug". This is a problem with Golang versions below 1.16. By default Amazon EC2 Debian 11 installs go version go1.15.9 linux/amd64. The gist of this problem: if the build output is a new dir (not a file), then it will error out the first time but will create the dir, that is why it will run fine the second time. This was fixed in Go 1.16. I fixed it by forcing to create the output dir before builds. Personally, I recommend do not use Go from the apt-get repositories and install the newest versions as described in the official guide for Linux.

asciicast