Bug 209747 - [exp-run] POSIX compliant basename()/dirname()
Summary: [exp-run] POSIX compliant basename()/dirname()
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Schouten
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 08:54 UTC by Ed Schouten
Modified: 2016-07-31 21:56 UTC (History)
1 user (show)

See Also:


Attachments
Patch for the zoneminder port (460 bytes, patch)
2016-07-31 21:56 UTC, Ed Schouten
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Schouten freebsd_committer 2016-05-25 08:54:46 UTC
Hi there,

I would hereby like to request an exp-run to see what would happen if FreeBSD had POSIX compliant basename()/dirname() functions. Please make the following changes to /usr/include/libgen.h:


--- libgen.h
+++ libgen.h
@@ -35,9 +35,9 @@
 
 __BEGIN_DECLS
 
-char   *basename(const char *);
+char   *basename(char *);
 char   *basename_r(const char *, char *);
-char   *dirname(const char *);
+char   *dirname(char *);
 #if 0
 char   *regcmp(const char *, ...);
 char   *regex(const char *, const char *, ...);


Do note that this change needs to be applied after installation; it is not sufficient for making buildworld pass.
Comment 1 Antoine Brodin freebsd_committer 2016-05-29 11:34:06 UTC
Exp-run results on 10.3 i386:

http://package18.nyi.freebsd.org/build.html?mastername=103i386PR209747-default&build=2016-05-28_17h12m55s

New failures:

+ {"origin"=>"audio/taglookup", "pkgname"=>"taglookup-0.2_3", "phase"=>"build", "errortype"=>"bad_C++_code"}
+ {"origin"=>"devel/gdb", "pkgname"=>"gdb-7.11_2", "phase"=>"build", "errortype"=>"compiler_error"}
+ {"origin"=>"devel/gdb66", "pkgname"=>"gdb66-6.6_3", "phase"=>"build", "errortype"=>"compiler_error"}
+ {"origin"=>"devel/insight", "pkgname"=>"gdb-insight-6.6_2", "phase"=>"build", "errortype"=>"compiler_error"}
+ {"origin"=>"games/burrtools", "pkgname"=>"burrtools-0.6.3_2", "phase"=>"build", "errortype"=>"bad_C++_code"}
+ {"origin"=>"sysutils/pefs-kmod", "pkgname"=>"pefs-kmod-2016.03.17", "phase"=>"build", "errortype"=>"clang_werror"}
+ {"origin"=>"sysutils/uhidd", "pkgname"=>"uhidd-0.2.1_2", "phase"=>"build", "errortype"=>"clang_werror"}

Failure logs:

http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/taglookup-0.2_3.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/gdb-7.11_2.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/gdb66-6.6_3.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/gdb-insight-6.6_2.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/burrtools-0.6.3_2.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/pefs-kmod-2016.03.17.log
http://package18.nyi.freebsd.org/data/103i386PR209747-default/2016-05-28_17h12m55s/logs/errors/uhidd-0.2.1_2.log
Comment 2 Ed Schouten freebsd_committer 2016-05-29 11:39:08 UTC
Thanks, Antoine! I'll see what I can do to get those packages fixed before patching up libgen.h in src.
Comment 3 commit-hook freebsd_committer 2016-05-29 17:30:20 UTC
A commit references this bug:

Author: jbeich
Date: Sun May 29 17:29:35 UTC 2016
New revision: 416118
URL: https://svnweb.freebsd.org/changeset/ports/416118

Log:
  sysutils/uhidd: unbreak build on 11.0

  Only call basename(3) when qualifying for "const" as /dev/ prefix in
  /dev/ugen%d.%d is unused.

  uhidd.c:234:16: error: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                      basename(hi->dev));
                               ^~~~~~~
  /usr/include/libgen.h:38:22: note: passing argument to parameter here
  char    *basename(char *);
                          ^
  Reported by:	antoine (exp-run), ed (ping)
  PR:		209747

Changes:
  head/sysutils/uhidd/Makefile
  head/sysutils/uhidd/files/patch-less-basename
Comment 4 commit-hook freebsd_committer 2016-05-30 11:58:46 UTC
A commit references this bug:

Author: jbeich
Date: Mon May 30 11:58:42 UTC 2016
New revision: 416146
URL: https://svnweb.freebsd.org/changeset/ports/416146

Log:
  games/burrtools: unbreak build on 11.0

  lib/stl.cpp: In member function 'void stlExporter_c::write(const char*, const voxel_c&, const faceList_c&)':
  lib/stl.cpp:69:38: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
     const char * title = basename(fname);
                                        ^
  In file included from lib/stl.cpp:44:0:
  /usr/include/libgen.h:38:7: error:   initializing argument 1 of 'char* basename(char*)' [-fpermissive]
   char *basename(char *);
         ^

  PR:		209747
  Reported by:	antoine (exp-run)

Changes:
  head/games/burrtools/files/patch-src-lib-stl.cpp
Comment 5 commit-hook freebsd_committer 2016-06-12 17:25:14 UTC
A commit references this bug:

Author: sbruno
Date: Sun Jun 12 17:24:13 UTC 2016
New revision: 416811
URL: https://svnweb.freebsd.org/changeset/ports/416811

Log:
  Update to version 2016-16-11
  - remove basename() calls

  PR:	209747
  Submitted by:	Gleb Kurtsou <gleb.kurtsou@gmail.com>

Changes:
  head/sysutils/pefs-kmod/Makefile
  head/sysutils/pefs-kmod/distinfo
Comment 6 Antoine Brodin freebsd_committer 2016-07-31 15:02:05 UTC
It seems audio/taglookup was not fixed before this was committed:

http://beefy3.nyi.freebsd.org/data/head-i386-default/p419292_s303524/logs/errors/taglookup-0.2_3.log
Comment 7 Ed Schouten freebsd_committer 2016-07-31 15:58:50 UTC
Looks like I overlooked that one. Just wrote a patch and sent it to the author of the port, who also happens to be the author of the software. Will commit it to the tree for him as soon as he approves.
Comment 8 Antoine Brodin freebsd_committer 2016-07-31 19:59:56 UTC
Another one:  multimedia/zoneminder

http://beefy3.nyi.freebsd.org/data/head-i386-default/p419292_s303524/logs/errors/zoneminder-1.30.0_2.log

The basename seems new in version 1.30  (there was no zm_logger.cpp in version 1.25).
Comment 9 Ed Schouten freebsd_committer 2016-07-31 21:56:25 UTC
Created attachment 173143 [details]
Patch for the zoneminder port

Hi there,

I've attached an untested patch for that port to this bug. It's already quite late over here, so I'll test it and send it out tomorrow.

Ed