bugGNUstep - Bugs: bug #55526, FTBFS on GNU/kFreeBSD:...

Group
 
 

bug #55526: FTBFS on GNU/kFreeBSD: NSWorkspace.m:1252:27: error: 'MOUNTED_PATH' undeclared

Submitter:  Yavor Doganov <yavor>
Submitted:  Sun 20 Jan 2019 04:57:10 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  rmottola
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Feb 2019 07:25:25 AM UTC, comment #5: 

Riccardo, it builds successfully, feel free to close this bug.

Yavor Doganov <yavor>
Mon 21 Jan 2019 11:38:20 PM UTC, comment #4: 

Thanks; I won't be able to build-test it until the next gnustep-gui upload to Debian.

GNU/kFreeBSD is more closer to GNU/Linux than to FreeBSD, because the underlying C library (glibc) is the same.  This is basically a GNU system but running with another kernel.  Part of the confusion comes because people talk about Linux as an OS when in fact it's just a kernel.

For programming purposes, you can (and should) treat GNU/kFreeBSD as a glibc platform -- you are already using the portable macros as documented in the glibc manual (albeit confusingly redefined to the deprecated ones) so that should be sufficient.

The conditionals in -mountedLocalVolumePaths are of no concern since the HAVE_GETMNTINFO branch will be compiled on GNU/kFreeBSD, which is fine.  It is also fine to compile the other branch (HAVE_GETMNTENT) and you can enforce it on GNU/kFreeBSD if you wish so with the appropriate defines.

But the result should be the same.  When Bruno Haibble ported the GNU C Library to the FreeBSD kernel (hats off to this hacker!), he implemented interfaces which were not feasible with the Linux kernel but were expected and customary with a FreeBSD kernel, like getmntinfo.

So there it is, a hybrid system which proves the defines were wrong as it is perfectly possible to have both.

Yavor Doganov <yavor>
Mon 21 Jan 2019 10:28:12 PM UTC, comment #3: 

I commited an equivalent patch, you can try it. It has no adverse effects on Linux where I tried. It will fix your "compile from source"

The issue might be in
mountedLocalVolumePaths  though

However I don't know if on kFreeBSD it is more Linux like or not. Should i use the getmintinfo code path or getmntent?

Riccardo Mottola <rmottola>
Group Member
Sun 20 Jan 2019 06:34:02 PM UTC, comment #2: 

Yes, the code which triggers this is new (your changes) which is why we got away with it until now.  I don't see anything unsafe with the patch; this code will work on GNU/kFreeBSD in the same way as on GNU/Linux.

Yavor Doganov <yavor>
Sun 20 Jan 2019 05:51:56 PM UTC, comment #1: 

I will try looking into this.
The includes you are changing are the same since 8 years!
However, the code which uses them is now new.

Your patch might make the code compile, but I think it will not function or not function optimally.

I have no means of testing the result however.

Riccardo Mottola <rmottola>
Group Member
Sun 20 Jan 2019 04:57:10 PM UTC, original submission:  

GUI 0.27.0 fails to build on GNU/kFreeBSD with:


gcc NSWorkspace.m -c \
      -MMD -MP -Wdate-time -D_FORTIFY_SOURCE=2 -DGNUSTEP_TARGET_DIR=\".\" -DGNUSTEP_TARGET_CPU=\"x86_64\" -DGNUSTEP_TARGET_OS=\"kfreebsd-gnu\" -DLIBRARY_COMBO=\"gnu-gnu-gnu\" -DGNUSTEP_BASE_HAVE_LIBXML=1 -DBACKEND_BUNDLE=1 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -fPIC -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fgnu-runtime -Wall -fconstant-string-class=NSConstantString -I../Headers/Additions -I../Headers -I./. -I. -I/usr/local/include/GNUstep -I/usr/include/GNUstep -Wdate-time -D_FORTIFY_SOURCE=2 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-kfreebsd-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/libpng16 \
       -o obj/libgnustep-gui.obj/NSWorkspace.m.o
NSWorkspace.m:71:4: warning: #warning "Mounted path file for you OS guessed to /etc/mtab"; [-Wcpp]
 #  warning "Mounted path file for you OS guessed to /etc/mtab";
    ^~~~~~~
NSWorkspace.m: In function '-[NSWorkspace getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:]':
NSWorkspace.m:1252:17: warning: implicit declaration of function 'setmntent'; did you mean 'getmntinfo'? [-Wimplicit-function-declaration]
   FILE  *fptr = setmntent(MOUNTED_PATH, "r");
                 ^~~~~~~~~
                 getmntinfo
NSWorkspace.m:1252:27: error: 'MOUNTED_PATH' undeclared (first use in this function); did you mean 'AUDIT_PATH'?
   FILE  *fptr = setmntent(MOUNTED_PATH, "r");
                           ^~~~~~~~~~~~
                           AUDIT_PATH
NSWorkspace.m:1252:27: note: each undeclared identifier is reported only once for each function it appears in
NSWorkspace.m:1255:16: warning: implicit declaration of function 'getmntent'; did you mean 'getmntinfo'? [-Wimplicit-function-declaration]
   while ((me = getmntent(fptr)) != 0)
                ^~~~~~~~~
                getmntinfo
NSWorkspace.m:1255:14: warning: assignment to 'struct mntent *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   while ((me = getmntent(fptr)) != 0)
              ^
In file included from /usr/include/string.h:634,
                 from /usr/include/x86_64-kfreebsd-gnu/sys/mount.h:38,
                 from NSWorkspace.m:39:
NSWorkspace.m:1257:18: error: dereferencing pointer to incomplete type 'struct mntent'
     if (strcmp(me->MNT_MEMB, [fullPath fileSystemRepresentation]) == 0)
                  ^~
NSWorkspace.m:1262:3: warning: implicit declaration of function 'endmntent' [-Wimplicit-function-declaration]
   endmntent(fptr);
   ^~~~~~~~~
/usr/share/GNUstep/Makefiles/rules.make:479: recipe for target 'obj/libgnustep-gui.obj/NSWorkspace.m.o' failed


GNU/kFreeBSD provides both getmntinfo and getmntent but the conditionals assume it's either one of them (as is the case on GNU/Linux where getmntinfo is missing).

Please consider applying the attached obvious patch which has been tested on Debian's GNU/kFreeBSD autobuilders.  (I believe you can do it with "git am".)

Yavor Doganov <yavor>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Updated the item)
  • -email is unavailable- added by rmottola (Posted a comment)
  • -email is unavailable- added by yavor (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-10 FredKiefer StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-01-21 rmottola StatusNone Ready For Test
    2019-01-20 rmottola Assigned toNone rmottola
    2019-01-20 yavor Attached File- Added 0001-Fix-build-failure-on-GNU-kFreeBSD.patch, #46042

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code