Communique icon indicating copy to clipboard operation
Communique copied to clipboard

Fails to compile on Alpine

Open eddsalkield opened this issue 1 year ago • 0 comments

Describe the bug

When compiling on Alpine with ninja -C builddir, the build fails with:

[15/161] Compiling Vala source ../plugins/backend/fresh/freshAPI.vala ../plugins/backend/fresh/freshInterface.vala ../plugins/backend/fresh/freshUtils.vala ../plugins/backend/fresh/freshConnection.vala FeedReader.vapi
ninja: job failed: cc -Icom.github.suzie97.communique.p -I. -I.. -Ilibraries/libIvy -I../libraries/libIvy -Ilibraries/libgtkimageview -I../libraries/libgtkimageview -Ilibraries/htmlclean -I../libraries/htmlclean -Ilibraries -I../libraries -Idata -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libdrm -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/json-glib-1.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/gee-0.8 -I/usr/include/libsecret-1 -I/usr/include/rest-0.7 -I/usr/include/webkitgtk-4.0 -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/libpeas-1.0 -I/usr/include/gobject-introspection-1.0 -I/usr/include/goa-1.0 -I/usr/lib/goa-1.0/include -I/usr/include/granite -I/usr/include/libhandy-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -O0 -g -pthread -g -w -rdynamic -Wno-deprecated-declarations '-DVERSION="undefined"' '-DGETTEXT_PACKAGE="com.github.suzie97.communique"' '-DGNOMELOCALEDIR="/usr/local/share/locale"' -DGOA_API_IS_SUBJECT_TO_CHANGE -include FeedReader.h -MD -MQ com.github.suzie97.communique.p/meson-generated_src_FeedReaderMain.c.o -MF com.github.suzie97.communique.p/meson-generated_src_FeedReaderMain.c.o.d -o com.github.suzie97.communique.p/meson-generated_src_FeedReaderMain.c.o -c com.github.suzie97.communique.p/src/FeedReaderMain.c
../src/FeedReaderMain.vala: In function 'feed_reader_main_main':
../src/FeedReaderMain.vala:94:31: error: assignment of read-only variable 'stdout'
   94 |                         var old_stdout =(owned)stdout;
      |                               ^
com.github.suzie97.communique.p/src/FeedReaderMain.c:28:52: error: assignment of read-only variable 'stdout'
   28 | #define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL)))
      |                                                    ^
../src/FeedReaderMain.vala:95:24: note: in expansion of macro '_fclose0'
   95 |                         stdout = FileStream.open("/dev/null", "w");
      |                 ^       ~~~~~~~
../src/FeedReaderMain.vala:95:31: error: assignment of read-only variable 'stdout'
   95 |                         stdout = FileStream.open("/dev/null", "w");
      |                               ^
com.github.suzie97.communique.p/src/FeedReaderMain.c:28:52: error: assignment of read-only variable 'stdout'
   28 | #define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL)))
      |                                                    ^
../src/FeedReaderMain.vala:97:24: note: in expansion of macro '_fclose0'
   97 |                         stdout =(owned)old_stdout;
      |                 ^       ~~~~~~~
../src/FeedReaderMain.vala:97:31: error: assignment of read-only variable 'stdout'
   97 |                         stdout =(owned)old_stdout;
      |                               ^
sqlite3.vapi:34.59-34.76: warning: Use of possibly unassigned parameter `errmsg'
   34 | 		public int exec (string sql, Callback? callback = null, out string? errmsg = null) {
      | 		                                                        ^~~~~~~~~~~~~~~~~~
sqlite3.vapi:54.90-54.107: warning: Use of possibly unassigned parameter `errmsg'
   54 | 		public int get_table (string sql, out string[] resultp, out int nrow, out int ncolumn, out string? errmsg = null) {
      | 		                                                                                       ^~~~~~~~~~~~~~~~~~

To Reproduce

This should be unrelated, but I've patched out the dependency on execinfo.h with the following patch:

diff --git a/libraries/libIvy/Extractor.vala b/libraries/libIvy/Extractor.vala
index 9111ef1f..f82faf78 100644
--- a/libraries/libIvy/Extractor.vala
+++ b/libraries/libIvy/Extractor.vala
@@ -398,16 +398,8 @@ namespace Ivy {
                                        trace.is_all_function_name_blank = true;
                                        trace.is_all_file_name_blank = true;

-                                       // TODO fix that > 0.26
-                                       #if VALA_0_26 || VALA_0_28
-                                       var size = Linux.Backtrace.@get (array);
-                                       var strings = Linux.Backtrace.symbols (array);
-                                       #else
-                                       int size = Linux.backtrace (array, frame_count);
-                                       unowned string[] strings = Linux.backtrace_symbols (array, size);
-                                       // Needed because of some weird bug
-                                       strings.length = size;
-                                       #endif
+                                      var size = 0;
+                                      string[] strings = new string[0];

                                        int[] addresses = (int[])array;
                                        string module = get_module_name ();

Expected behavior

Program compiles successfully

Platform Information

Compiled master branch and v1.2.0, on Alpine edge.

eddsalkield avatar Nov 17 '22 15:11 eddsalkield