Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraction bug in v3.1.2 on Linux? #360

Closed
0h-no opened this issue Aug 28, 2021 · 10 comments
Closed

Extraction bug in v3.1.2 on Linux? #360

0h-no opened this issue Aug 28, 2021 · 10 comments

Comments

@0h-no
Copy link

0h-no commented Aug 28, 2021

Hi, I compiled v3.1.2 on Fedora - first stratagus, then wargus. On wargus I used:

STRATAGUS_INCLUDE_DIR=$(echo ~/.local/src/stratagus*/gameheaders | tail -1)
cmake -DCMAKE_INSTALL_PREFIX=~/.local -DSTRATAGUS_INCLUDE_DIR=$STRATAGUS_INCLUDE_DIR -DSTRATAGUS=~/.local/games/stratagus .
make
make install

Then I ran ~/.local/games/wargus, chose the INSTALL.MPQ file to extract (GOG edition), waited for the extraction to complete successfully and got this message:

/usr/bin/which: no osascript in (/home/my_user/.local/bin:/home/my_user/bin:/usr/local/games:/home/my_user/.local/bin:/home/my_user/bin:/usr/local/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin)

(zenity:91729): Gtk-WARNING **: 20:05:32.161: Failed to set text 'Stratagus failed to load game data. If you just launched the game without any arguments, this may indicate a bug with the extraction process. Please report this on https://github.com/Wargus/stratagus/issues/new, and please give details, including: operating system, installation path, username, kind of source CD. If you got an error message about the extraction command failing, please try to run it in a console and post the output to the issue. A common problem is symbols in the path for the installation, the game data path, or the username (like an & or !). Try changing these. Try also to remove the folder /home/my_user/.stratagus/data.Wargus and try the extraction again.' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &

Subsequent runs produce the same message (also tried removing the data directory as instructed, but it didn't help).
What file was being read? I couldn't figure out (strace -f didn't show any relevant files and I couldn't trace the file in the source code). Maybe there's an error log somewhere? (also, the osascript error is irrelevant, right?)
Thanks!

@timfel
Copy link
Member

timfel commented Aug 30, 2021

Hi, just to let you know that I'm currently swamped with work and other things and won't have time to look into this at all. Not having osascript sounds like something is wrong with the platform detection maybe (since that is a macOS command). You can always extract by just using wartool directly and then running with stratagus -d path/to/data

@0h-no
Copy link
Author

0h-no commented Aug 31, 2021

No worries, this is just a hobby project after all :)
My only intention was to document this behavior - we all have our lives, and fixing bugs in Stratagus shouldn't be on anyone's priority.

I ran wartool and it ran fine:

$ ~/.local/src/wargus-3.1.2/wartool -e ~/.wine/drive_c/games/gog/"Warcraft II BNE" ~/.stratagus/data.Wargus
(legit output goes here)

Running stratagus immediately produced a core dump:

$ ~/.local/games/stratagus -d ~/.stratagus/data.Wargus
Segmentation fault (core dumped)

The last system call before the fault appeared to be that the program tried to create the data directory, but I don't think it's related to the fault:

...
mkdir("/home/my_user/.stratagus", 0777) = -1 EEXIST (File exists)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xb} ---
+++ killed by SIGSEGV (core dumped) +++

Anyway, keep up the good work and feel free to only reply when you have some time to spare.

@ghost
Copy link

ghost commented Nov 20, 2021

Possibly related to Wargus/wargus#394 which was closed for #366 which may fix that.

@0h-no
Copy link
Author

0h-no commented Nov 20, 2021

Cool. Once #366 is closed I'll verify the issue is fixed and close it.

@0h-no
Copy link
Author

0h-no commented Dec 8, 2021

I was curious to see whether the changes to lua solved my case so I downloaded the latest master, but make fails on some network code:

.local/src/stratagus-master/src/network/netconnect.cpp: In lambda function:
.local/src/stratagus-master/src/network/netconnect.cpp:1882:26: error: ‘lua_objlen’ was not declared in this scope; did you mean ‘lua_rawlen’?
 1882 |                 auto i = lua_objlen(l, -1) + 1;
      |                          ^~~~~~~~~~
      |                          lua_rawlen
make[2]: *** [CMakeFiles/stratagus.dir/build.make:1880: CMakeFiles/stratagus.dir/src/network/netconnect.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/stratagus.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@ghost
Copy link

ghost commented Dec 8, 2021

Huh, how are you building it? It was working for me with the -DBUILD_VENDORED_LUA=ON flag. Could you post the commands you used, and any terminal output you get?

@0h-no
Copy link
Author

0h-no commented Dec 8, 2021

Sorry, my bad - I didn't use that flag. Once I added it to make it would compile. I think there is progress - now this is the error strace returns:

...
pid  9315] execve("~/.local/games/stratagus", ["wargus", "-d", "/home/my_user/.stratagus/data."...], 0x7ffd459622e8 /* 54 vars */) = -1 ENOENT (No such file or directory)
[pid  9315] execve("~/.local/games/stratagus", ["wargus", "-d", "/home/my_user/.stratagus/data."...], 0x7ffd459622e8 /* 54 vars */) = -1 ENOENT (No such file or directory)
...

Not sure what directory is missing though. I have /home/my_user/.stratagus/data.Wargus and both stratagus and wargus are in PATH.

@timfel
Copy link
Member

timfel commented Dec 8, 2021

You got that error when running ~/.local/games/stratagus -d ~/.stratagus/data.Wargus ?

@0h-no
Copy link
Author

0h-no commented Dec 9, 2021

Using ~/.local/games/stratagus -d ~/.stratagus/data.Wargus instead of wargus solved the issue, but before that I had to manually copy the scripts directory from the source to ~/.stratagus/data.Wargus.
I guess the scripts were not read from ~/.local/share/games/stratagus/wargus/scripts because I installed to a custom directory (~/.local instead of /usr/local).
I can run the game now - thanks!

@0h-no 0h-no closed this as completed Dec 9, 2021
@timfel
Copy link
Member

timfel commented Dec 9, 2021

@0h-no the scripts always have to be copied, but that's not what wartool is for, wargus does that. Since the extraction with wargus failed for you, and you ran wartool directly, you have to copy the scripts manually. There are actually more things you should copy, but they won't prevent you from running. The contrib folder in the installation needs to be copied to a specific location, but without it you'll simply be missing a few icons, you might not even notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants