Bug 245814 - games/lugaru: Update to 1.3
Summary: games/lugaru: Update to 1.3
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lorenzo Salvadore
URL:
Keywords: buildisok
Depends on:
Blocks:
 
Reported: 2020-04-22 07:36 UTC by shamaz.mazum
Modified: 2020-06-01 10:37 UTC (History)
4 users (show)

See Also:
fernape: merge-quarterly?


Attachments
Port diff (41.66 KB, patch)
2020-04-22 07:36 UTC, shamaz.mazum
salvadore: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description shamaz.mazum 2020-04-22 07:36:30 UTC
Created attachment 213669 [details]
Port diff

Please update lugaru to 1.3

This version is based on my repository on github which is a fork of this read-only repo: https://github.com/osslugaru/lugaru. The major changes compared to the version in ports is migration to SDL2 and memory corruption fix when drawing sprites.
Comment 1 Automation User 2020-04-22 08:01:43 UTC
Build info is available at https://gitlab.com/swills/freebsd-ports/pipelines/138576075
Comment 2 Lorenzo Salvadore freebsd_committer 2020-05-21 21:35:50 UTC
Hi, I am the new maintainer of lugaru.

I think it is preferable to keep lugaru port following the official software rather than forks. Thus I suggest you to do one of the following:
- submit your patches upstream: https://gitlab.com/osslugaru/lugaru
- make your fork a new stand alone software and create a new port for it.

According to your description, your fork is essentially the original game improved, then I recommend following the first path.

In the meantime, I plan to update the port to version 1.2 from https://gitlab.com/osslugaru/lugaru (as you know we are still tracking old version from bitbucket). If you want to give a help and submit the patch here, you're welcome.
Comment 3 shamaz.mazum 2020-05-22 04:48:23 UTC
The last commit on GitLab repository was 8 months ago. That's why I decided to switch to a fork. Also I really do not want to get an account on GitLab for just a one game ;( Maybe you can add my patches to the port itself or I can do it if you attach your new port here.

The version upstream is completely broken. You can play at most one minute before it crashes. It contains a piece of code like this:

vector<foo> bar;
...
for (int i=0; i<bar.size(); i++) {
    if (condition) bar.erase (bar.begin() + i);
}

If this is not fixed, the game will no be playable, so my patches are super-puper-mega important;) See https://github.com/shamazmazum/lugaru/commit/09adc18d56cd87f65d9ace34369ec389f9013b02 and https://github.com/shamazmazum/lugaru/commit/9204227ad2c4587144e2281a9d752a5efc840aac
Comment 4 Lorenzo Salvadore freebsd_committer 2020-05-22 10:09:26 UTC
If version 1.2 is indeed broken and/or if the software is unmaintained upstream this is different indeed. I am trying to contact upstream to check if the project is still active: if it is I will point them to your patches, if it is not I will switch to your fork after having confirmed that 1.2 is indeed broken.
Comment 5 shamaz.mazum 2020-05-22 10:18:16 UTC
Thanks!
Comment 6 Lorenzo Salvadore freebsd_committer 2020-05-22 13:26:22 UTC
I successfully contacted the lugaru team on irc (#lugaru on freenode) and they are looking into your commits:
https://gitlab.com/osslugaru/lugaru/-/issues/113

They also told me that you can use your github account on gitlab.

They are working on a maitainance release (1.2.1):
https://gitlab.com/osslugaru/lugaru/-/issues/112

We will make sure that 1.2.1 works on FreeBSD as well and I will update the port consistently.

Thanks for your work.
Comment 7 shamaz.mazum 2020-05-22 16:08:44 UTC
My patches are sent
Comment 8 shamaz.mazum 2020-06-01 05:16:51 UTC
Oh, thanks for totally ignoring my work! Probably anyone who installs this port and runs the game is experiencing crashes now.
Comment 9 shamaz.mazum 2020-06-01 06:04:33 UTC
I see this port is based not on the master, but on some commit which fixes animation. Good, but my biggest problem was on drawing sprites.

This is a backtrace of crashed lugaru built from master:
(lldb) bt
* thread #1, name = 'lugaru', stop reason = signal SIGSEGV
  * frame #0: 0x000000000024ff05 lugaru`Sprite::Draw() at Sprite.cpp:407:25
    frame #1: 0x00000000002d881b lugaru`Game::DrawGLScene(side=stereoCenter) at GameDraw.cpp:545:9
    frame #2: 0x000000000021fb60 lugaru`main(argc=<unavailable>, argv=<unavailable>) at main.cpp:718:21
    frame #3: 0x000000000021e10f lugaru`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7

On c7b99378439735c60f84869b05c6ebde53083667 such problem does not occur, but I don't see how it is fixed. Problems with memory can be well hidden and manifest themselves later on some irrelevant change in the code or environment.

But, whatever, I do not care anymore. I also don't think you are the right person to blame, but developers of lugaru are. Maybe they will run across that bug sometimes and fix it on their own.
Comment 10 Lorenzo Salvadore freebsd_committer 2020-06-01 10:31:56 UTC
(In reply to shamaz.mazum from comment #9)

Do not worry, your contributions have not been ignored. As I wrote earlier, I reported them upstream and developers are discussing in this issue which is still open:
https://gitlab.com/osslugaru/lugaru/-/issues/113
If you want you can partecipate to the discussion and try to convince them of the validity of your work.

Moreover, the developers are working to a new maintenance release and this will probably include anything that is found useful from your work.

If you still happen to disagree with the developers you can fork the game as you already did, but make sure that is is clear that it is a fork. In particular do not keep calling it lugaru: this creates confusion and people cannot distinguish your fork and the original game easily. Once your fork is ready you can create a new port in the FreeBSD ports tree for it.

However, as a port maintainer, I cannot change a port to track a fork if it is maintained upstream, even if it is buggy. If there is a bug it must be reported upstream and fixed upstream; if it is not fixed upstream then developers are doing bad work and someone should fork the software, but in a clear manner that do not create confusion.

I hope this experience will not discourage you to contribute again to FreeBSD, lugaru or any open source project.
Comment 11 shamaz.mazum 2020-06-01 10:37:27 UTC
Thanks. At least the port is upgraded and playable ;)