View Issue Details

IDProjectCategoryView StatusLast Update
0005898SOGoSOPEpublic2024-02-09 10:39
Reporterjam Assigned Toqhivert  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSGentoo LinuxOS Version17.1/hardened
Product Version5.9.0 
Summary0005898: Compile errors with gnustep base libs >= 1.29.0
Description

Compiling SOPE 5.9.0 with gnustep base libs >= 1.29.0 (which was released on Jan 8, 2023) fails.
The following errors are thrown:

x86_64-pc-linux-gnu-gcc NGMimeFileData.m -c \
-MMD -MP -DLIBRARY_MAJOR_VERSION=4 -DLIBRARY_MINOR_VERSION=9 -DLIBRARY_SUBMINOR_VERSION=3 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -march=znver2 -O2 -pipe -Wuninitialized -g -frecord-gcc-switches -fconstant-string-class=NSConstantString -I.. -I../.. -I../../sope-core/NGStreams/ -I../../sope-core/NGExtensions/ -I../../sope-core -I. -I/mnt/noraid_one/portage/tmpdir/portage/gnustep-libs/sope-5.9.0/work/GNUstep/Library/Headers -I/usr/local/include -I/usr/include \
-o obj/NGMime.obj/NGMimeFileData.m.o
NGMimeType.m: In function '+[NGMimeType stringEncodingForCharset:]':
NGMimeType.m:128:16: error: 'NSBIG5StringEncoding' undeclared (first use in this function); did you mean 'NSBig5StringEncoding'?
128 | encoding = NSBIG5StringEncoding;
| ^~~~~~~~
| NSBig5StringEncoding
NGMimeType.m:128:16: note: each undeclared identifier is reported only once for each function it appears in
x86_64-pc-linux-gnu-gcc NGMimeJoinedData.m -c \
-MMD -MP -DLIBRARY_MAJOR_VERSION=4 -DLIBRARY_MINOR_VERSION=9 -DLIBRARY_SUBMINOR_VERSION=3 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -march=znver2 -O2 -pipe -Wuninitialized -g -frecord-gcc-switches -fconstant-string-class=NSConstantString -I.. -I../.. -I../../sope-core/NGStreams/ -I../../sope-core/NGExtensions/ -I../../sope-core -I. -I/mnt/noraid_one/portage/tmpdir/portage/gnustep-libs/sope-5.9.0/work/GNUstep/Library/Headers -I/usr/local/include -I/usr/include \
-o obj/NGMime.obj/NGMimeJoinedData.m.o
NGMimeType.m:134:16: error: 'NSGB2312StringEncoding' undeclared (first use in this function); did you mean 'NSHZ_GB_2312StringEncoding'?
134 | encoding = NSGB2312StringEncoding;
| ^~~~~~
| NSHZ_GB_2312StringEncoding

Steps To Reproduce

Compile SOPE 5.9.0 with gnustep base libs >= 1.29.0

Additional Information

Some system information:

System uname: Linux-6.1.53-gentoo-r1-x86_64-x86_64-AMD_Ryzen_5_5600G_with_Radeon_Graphics-with-glibc2.37
Timestamp of repository gentoo: Fri, 03 Nov 2023 10:45:01 +0000
Head commit of repository gentoo: f8f8570e1d34e8e42b9e258723ea22f6d0aad8a5
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils: 1.3.5::gentoo
app-shells/bash: 5.1_p16-r6::gentoo
dev-lang/perl: 5.38.0-r1::gentoo
dev-lang/python: 3.11.5::gentoo
dev-lang/rust: 1.71.1::gentoo
dev-util/cmake: 3.26.5-r2::gentoo
dev-util/meson: 1.2.1-r1::gentoo
sys-apps/baselayout: 2.14::gentoo
sys-apps/openrc: 0.48::gentoo
sys-apps/sandbox: 2.38::gentoo
sys-devel/autoconf: 2.71-r6::gentoo
sys-devel/automake: 1.16.5-r1::gentoo
sys-devel/binutils: 2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc: 13.2.1_p20230826::gentoo
sys-devel/gcc-config: 2.11::gentoo
sys-devel/libtool: 2.4.7-r1::gentoo
sys-devel/make: 4.4.1-r1::gentoo
sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers)
sys-libs/glibc: 2.37-r7::gentoo

The cause for the compile errors can be found in a change to the enum constants in NSString.h and Unicode.h from gnustep base libs version 1.28.0 to 1.29.0.
This diff shows their changes: https://github.com/gnustep/libs-base/commit/fe2f41c7f19f19bf8b5100a2124e815d92d784d1
With some revision of the enums they also changed some of the constant names.

On my system, the following patch got rid of the compile errors:

--- a/sope-mime/NGMime/NGMimeType.m 2023-09-27 10:35:19.000000000 +0200
+++ b/sope-mime/NGMime/NGMimeType.m 2023-11-03 12:23:55.037647584 +0100
@@ -125,13 +125,21 @@
encoding = NSKoreanEUCStringEncoding;
}
else if ([charset isEqualToString:@"big5"]) {
+#if ((GNUSTEP_BASE_MAJOR_VERSION >= 1) && (GNUSTEP_BASE_MINOR_VERSION >= 19) && (GNUSTEP_BASE_SUBMINOR_VERSION >= 0))

  • encoding = NSBig5StringEncoding;
    +#else
    encoding = NSBIG5StringEncoding;
    +#endif
    }
    else if ([charset isEqualToString:@"iso-2022-jp"]) {
    encoding = NSISO2022JPStringEncoding;
    }
    else if ([charset isEqualToString:@"gb2312"]) {
    +#if ((GNUSTEP_BASE_MAJOR_VERSION >= 1) && (GNUSTEP_BASE_MINOR_VERSION >= 19) && (GNUSTEP_BASE_SUBMINOR_VERSION >= 0))
  • encoding = NSHZ_GB_2312StringEncoding;
    +#else
    encoding = NSGB2312StringEncoding;
    +#endif
    }
    else if ([charset isEqualToString:@"koi8-r"]) {
    encoding = NSKOI8RStringEncoding;

If basically introduces a version check for the gnustep base libs and uses different enum constants which should refer to the same character set.
That said, I aimed for a quick fix and I'm not 100% sure if I chose the correct constants. It certainly looks correct to me, but I did not test it.

TagsNo tags attached.

Activities

jam

jam

2023-11-03 12:28

reporter   ~0017404

Formatting in my initial report is broken. Sorry for that.
I tried to upload the patch file with this note, but it only gave me HTTP 500 (multiple times).
Will try again later.

qhivert

qhivert

2023-11-04 11:35

administrator   ~0017408

Hello, thanks for reporting this.
As for now, we don't seem to have an supporting OS that use the 1.29 but we definitely will. As you found the problem, the best would be to make a PR in our sope repo so we can discuss there your patch.

jam

jam

2023-11-07 18:35

reporter   ~0017416

I just submitted a pull request to the sope repo: https://github.com/Alinto/sope/pull/66

As for the OS: Yes, I am fully aware that I am running SOGo on an unsupported OS. I figured you might still be interested, as supported OS will move to 1.29 sooner or later too.

qhivert

qhivert

2023-11-08 07:57

administrator   ~0017417

Ah yes don't read me wrong, we glad you found that error and the solution beforehand!

Issue History

Date Modified Username Field Change
2023-11-03 12:22 jam New Issue
2023-11-03 12:28 jam Note Added: 0017404
2023-11-04 11:35 qhivert Note Added: 0017408
2023-11-04 11:35 qhivert Assigned To => qhivert
2023-11-04 11:35 qhivert Status new => assigned
2023-11-06 08:04 qhivert Status assigned => feedback
2023-11-07 18:35 jam Note Added: 0017416
2023-11-07 18:35 jam Status feedback => assigned
2023-11-08 07:57 qhivert Note Added: 0017417
2024-02-09 10:39 qhivert Status assigned => closed
2024-02-09 10:39 qhivert Resolution open => fixed