planet-lia / lia-SDK

Software development kit for Lia.
GNU Affero General Public License v3.0
3 stars 0 forks source link

Not working in Arch Linux #4

Closed janleskovec closed 5 years ago

janleskovec commented 5 years ago

I tried running the command ./lia bot python3 John and got the following output:

Using settings file: /home/jan/.lia.json
Downloading bot from https://github.com/liagame/python3-bot/archive/v1.0.0.zip...
Preparing bot...
failed move bot dir from python3-bot-1.0.0 to /home/jan/Development/lia-sdk-linux/John. rename /tmp/378382523/python3-bot-1.0.0 /home/jan/Development/lia-sdk-linux/John: invalid cross-device link
greenstatic commented 5 years ago

@slole do you have /home and /tmp on different file systems? I'll try to create a hotfix, which you can demo test.

Thanks for the bug report! 😃


I suspect the issue is the os.Rename call, here.

According to the Go library docs:

OS-specific restrictions may apply when oldpath and newpath are in different directories if the Go

Additionally, if the Go library is similarly implemented to the Python os library; it states:

The operation may fail on some Unix flavors if src and dst are on different filesystems.

greenstatic commented 5 years ago

@slole I have created a hotfix. Before we push this as an official release we need to test it. It would be great if you could give it a try and see if it solves your issue.

You can download a prebuilt (linux/amd64) build of the hotfix release here.

Or you can clone the hotfix branch and build it yourself (you will need to follow the README.md instructions.

Thanks again for helping out! 🙌

janleskovec commented 5 years ago

Creating a bot now works:

bot python3 John
Using settings file: /home/jan/.lia.json
Downloading bot from https://github.com/liagame/python3-bot/archive/v1.0.0.zip...
Preparing bot...
Bot John is ready!

However running a bot still has the same problem:

Using settings file: /home/jan/.lia.json
Couldn't open file. Location: /home/jan/Development/lia-sdk-linux-invalid-cross-device-link-hotfix/python3/lia.json.failed to read /home/jan/Development/lia-sdk-linux-invalid-cross-device-link-hotfix/python3/lia.json
open /home/jan/Development/lia-sdk-linux-invalid-cross-device-link-hotfix/python3/lia.json: no such file or directory

@slole do you have /home and /tmp on different file systems? I'll try to create a hotfix, which you can demo test.

I do not have /home and /tmp on separate file systems.

greenstatic commented 5 years ago

How are you running in the bot? Have you tried:

./lia play John John
RdecKa commented 5 years ago

Hi, I had exactly the same problem with the bot command on Arch Linux. The release, downloaded from here solved the problem.

Running bots with ./lia play John John works without problems, game is generated and a replay starts. Documentation here (tab Terminal) says that it should be run with ./lia.exe play John John, though.

greenstatic commented 5 years ago

@RdecKa Thanks for the report!

The lia.exe is for windows users. @Svigelj Maybe we should rename the Cmd tab to Windows cmd and Terminal to Linux/MacOS, thoughts?

RdecKa commented 5 years ago

I know, I know :laughing: But someone else might be confused, so I mentioned it. It's already fixed, as I can see.

svigelj commented 5 years ago

Hi all! :smiley:

@RdecKa I have just deployed the fix for the typo in Documentation, thanks for reporting!

@slole it looks like as @greenstatic has mentioned, that you have made a mistake in the play command. Did you run something like lia play python3 John instead of eg. lia play John John?

@RdecKa @slole for the original bug of this issue, we will release an official version that will fix it some time today. I will write a note here and you can then download it via lia update command.

@greenstatic I have also renamed tabs displaying commands in Documentation to be easier to understand (Windows cmd, Windows PowerShell, Linux/macOS).

jakoberzar commented 5 years ago

I would just like to confirm the cause of error. Arch by default uses a different filesystem for /tmp, called tmpfs.

Arch uses a tmpfs /run directory, with /var/run and /var/lock simply existing as symlinks for compatibility. It is also used for /tmp by the default systemd setup and does not require an entry in fstab unless a specific configuration is needed.

janleskovec commented 5 years ago

@Svigelj yes I remembered I did make a mistake in the play command. The program should maybe detect such a mistake and warn the user?

svigelj commented 5 years ago

@slole agreed. Will add the warning.

svigelj commented 5 years ago

@slole @RdecKa @greenstatic fix was merged to the master via this commit. New version is now v1.0.1.

If you run lia update command the new version should be downloaded for you automatically.

Thanks again for reporting and helping us out! :smiley:

greenstatic commented 5 years ago

It has come to our attention that those of you who experienced this bug, can't actually use the lia update command due to the nature of the bug. For those of you who experienced this issue, you will need to download the release manually - from then on the update command should work.