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

Compatibility with libgit2 1.8+ #39

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

es20490446e
Copy link
Contributor

@es20490446e
Copy link
Contributor Author

@codereader

@MirceaKitsune
Copy link

Eagerly awaiting the fix myself: I can no longer compile and use DarkRadiant over this issue. I use Manjaro Linux which switched to libgit 1.8 recently, this seems to be the cause with DR requiring a fix to support the newer library. Thank you for the pull request and I hope it can be merged ASAP.

@es20490446e
Copy link
Contributor Author

@MirceaKitsune Use this recipe changing pkgver=3.9.0.

@MirceaKitsune
Copy link

@es20490446e I got it working for now by looking at your PR: You just need to remove the word const at Commit.h line 55 and Repository.cpp line 339 and it works. I did that as a workaround, recompiled, then changed it back in the source code to avoid Git conflicts when this is merged since I shouldn't need to recompile again before then.

@es20490446e
Copy link
Contributor Author

Fixed 👍

@MirceaKitsune
Copy link

Fixed 👍

Why still checking the ligbit version though? That looks like it's doing the same thing regardless which version of the library it finds which is redundant. If that const was never needed to begin with, the solution compared to master looks like just removing the word const in those two places and nothing else.

@es20490446e
Copy link
Contributor Author

Yeah, it doesn't make much sense to have two cases when you are just using the last libgit2 anyways.

Fixed.

@MirceaKitsune
Copy link

Looks perfect now! Can confirm it works, hope this can be merged soon.

@codereader codereader merged commit 2365ced into codereader:master Jul 23, 2024
@MirceaKitsune
Copy link

MirceaKitsune commented Jul 23, 2024

Strange: Although this PR was merged and I updated and did a fully clean recompile, I still seem to get the same error. Was part of it missed or the issue added elsewhere since?

/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c: In function ‘_lwo_load’:
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:373:57: warning: ‘PicoFindVertexCombinationInHashTable’ accessing 24 bytes in a region of size 16 [-Wstringop-overflow=]
  373 |                                 vertexCombinationHash = PicoFindVertexCombinationInHashTable( hashTable, xyz, normal, st, color );
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:373:57: note: referencing argument 4 of type ‘double[3]’
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:373:57: note: referencing argument 5 of type ‘picoByte_t[4]’ {aka ‘unsigned char[4]’}
In file included from /home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/picointernal.h:55,
                 from /home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:39:
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/picomodel.h:335:34: note: in a call to function ‘PicoFindVertexCombinationInHashTable’
  335 | picoVertexCombinationHash_t     *PicoFindVertexCombinationInHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color );
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:383:65: warning: ‘PicoAddVertexCombinationToHashTable’ accessing 24 bytes in a region of size 16 [-Wstringop-overflow=]
  383 |                                         vertexCombinationHash = PicoAddVertexCombinationToHashTable( hashTable, xyz, normal, st, color, (picoIndex_t) numverts );
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:383:65: note: referencing argument 4 of type ‘double[3]’
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/pm_lwo.c:383:65: note: referencing argument 5 of type ‘picoByte_t[4]’ {aka ‘unsigned char[4]’}
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/radiantcore/model/picomodel/lib/picomodel.h:336:30: note: in a call to function ‘PicoAddVertexCombinationToHashTable’
  336 | picoVertexCombinationHash_t *PicoAddVertexCombinationToHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color, picoIndex_t index );
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If I attempt to recompile it will compile the rest. However at the end it will fail with this error which looks like the old one:

/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/plugins/vcs/Repository.cpp: In member function ‘void vcs::git::Repository::createCommit(const vcs::git::CommitMetadata&, const vcs::git::Reference::Ptr&)’:
/home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/plugins/vcs/Repository.cpp:368:49: error: invalid conversion from ‘const git_commit**’ to ‘git_commit* const*’ [-fpermissive]
  368 |         parentCommits.size(), parentCommits.data());
      |                               ~~~~~~~~~~~~~~~~~~^~
      |                                                 |
      |                                                 const git_commit**
In file included from /usr/include/git2/repository.h:14,
                 from /usr/include/git2/annotated_commit.h:11,
                 from /usr/include/git2.h:11,
                 from /home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/plugins/vcs/Reference.h:5,
                 from /home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/plugins/vcs/Repository.h:5,
                 from /home/mircea/Games/Quake/TheDarkMod/DarkRadiant_GIT/plugins/vcs/Repository.cpp:1:
/usr/include/git2/commit.h:369:28: note:   initializing argument 10 of ‘int git_commit_create(git_oid*, git_repository*, const char*, const git_signature*, const git_signature*, const char*, const char*, const git_tree*, size_t, git_commit* const*)’
  369 |         git_commit * const parents[]);
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make[2]: *** [plugins/vcs/CMakeFiles/vcs.dir/build.make:104: plugins/vcs/CMakeFiles/vcs.dir/Repository.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:613: plugins/vcs/CMakeFiles/vcs.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@es20490446e
Copy link
Contributor Author

Let me check, and I will come back.

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