odrling / Aegisub

Cross-platform advanced subtitle editor
http://www.aegisub.org
Other
21 stars 2 forks source link

Compilation error due to git_version.h #8

Open waarmond opened 3 weeks ago

waarmond commented 3 weeks ago

Bonjour,

I'm using your AUR PKGBUILD against current sources

[1/189] Generating git_version.h with a custom command
fatal: Invalid revision range 16cd907fe7482cb54a7374cd28b8501f138116be..HEAD
expr: syntax error: missing argument after '+'
[3/34] Compiling C++ object aegisub.p/src_version.cpp.o
FAILED: aegisub.p/src_version.cpp.o 
ccache c++ -Iaegisub.p -I. -I.. -I../libaegisub/include -Isrc/libresrc -I../src/libresrc -I../subprojects/avisynth/avs_core/include -Isubprojects/avisynth/__CMake_build -I../subprojects/avisynth/__CMake_build -Isubprojects/avisynth -I../subprojects/avisynth -I../subprojects/vapoursynth/include -Isrc -I../src -I../subprojects/bestsource/src -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/fribidi -I/usr/include -I/usr/lib/wx/include/gtk3-unicode-3.2 -I/usr/include/wx-3.2 -I/usr/include/hunspell -I/usr/include/uchardet -I/usr/include/luajit-2.1 -flto=auto -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -fpch-preprocess -include agi_pre.h -Wall -Winvalid-pch -std=c++17 -fPIE -D_REENTRANT -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -pthread -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_USE_DLL=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_ALL_NO_LIB -MD -MQ aegisub.p/src_version.cpp.o -MF aegisub.p/src_version.cpp.o.d -o aegisub.p/src_version.cpp.o -c ../src/version.cpp
../src/version.cpp: In function 'int GetSVNRevision()':
../src/version.cpp:79:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   79 |         return BUILD_GIT_VERSION_NUMBER;
      |         ^~~~~~
odrling commented 3 weeks ago

That sounds like you have a shallow clone of the repository that doesn't include 16cd907fe7482cb54a7374cd28b8501f138116be, so version.sh fails. I haven't modified the script so it is also shared by a few other forks that are also available on the AUR (arch1t3ct, tstools) that should also have the same issue.

I think makepkg defaults to fully cloning source repositories unless DLAGENTS is set to change this behaviour (https://pacman.archlinux.page/makepkg.conf.5.html). If you're using a AUR helper I guess it could also be overriding it too.

(CC @pjeanjean in case I'm missing something about the AUR/Arch part of the issue)

I can't think of a good way to have a satisfying version string from a shallow clone of the repository, so that can't be easily changed (and I would assume it would also cause issues for other packages).

waarmond commented 3 weeks ago

Now with a deep clone:

../src/version.cpp:79:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   79 |         return BUILD_GIT_VERSION_NUMBER;
      |         ^~~~~~

which I've patched away:

--- old/src/version.cpp 2024-06-05 19:48:52.804199104 +0200
+++ aegisub/src/version.cpp 2024-06-05 19:49:35.328154377 +0200
@@ -75,9 +75,5 @@
 }

 int GetSVNRevision() {
-#ifdef BUILD_GIT_VERSION_NUMBER
-   return BUILD_GIT_VERSION_NUMBER;
-#else
-   return 0;
-#endif
-}
+return 0;
+}
odrling commented 3 weeks ago

Well that should obviously not be patched this way.

In the build directory there is a git_version.h header file that defines the variable. It is empty and that's where the issue is (EDIT: or rather, it is in the script that generates this file). Perhaps share the build log.

pjeanjean commented 3 weeks ago

I could not reproduce this specific issue with the PKGBUILD, but it needed some updates so I changed a few things. Maybe try to force a cleanbuild if the problem persists?

odrling commented 3 weeks ago

@waarmond if you want this issue to go anywhere can you try the latest PKGBUILD and share the build log?