Bug 224016 - [exp-run] Removal of basename_r()
Summary: [exp-run] Removal of basename_r()
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: Sean Bruno
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-01 10:54 UTC by Ed Schouten
Modified: 2017-12-17 00:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Schouten freebsd_committer 2017-12-01 10:54:49 UTC
Now that the POSIX folks have agreed on requiring that basename() and dirname() have to be thread-safe, there is even less of a need to provide our FreeBSD-specific copy of basename_r(). Relevant links:

POSIX working group discussion: http://austingroupbugs.net/view.php?id=1064
Old exp-run for adding POSIX versions of basename() and dirname(): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209747

As we no longer make use of basename_r() in our own base system, I would hereby like to request an exp-run to see what happens if we remove it entirely. Here's a patch I'm planning on committing:

http://80386.nl/pub/20171201-basename_r.txt

Thanks,
Ed
Comment 2 commit-hook freebsd_committer 2017-12-08 22:07:03 UTC
A commit references this bug:

Author: ed
Date: Fri Dec  8 22:06:18 UTC 2017
New revision: 326719
URL: https://svnweb.freebsd.org/changeset/base/326719

Log:
  Remove basename_r(3).

  Now that the POSIX working group is going to require that basename(3)
  and dirname(3) are thread-safe in future revisions of the standard,
  there is even less of a need to provide basename_r(3). Remove this
  function to prevent people from writing code that only builds on
  FreeBSD and Bionic.

  Removing this function seems to break exactly one port: sbruno@'s
  qemu-user-static. I will send him a pull request on GitHub in a bit.
  __FreeBSD_version will not be bumped, as any value from 2017 can be used
  to test for the presence of a thread-safe basename(3)/dirname(3).

  PR:		https://bugs.freebsd.org/224016

Changes:
  head/ObsoleteFiles.inc
  head/include/libgen.h
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/basename_compat.c
Comment 3 Ed Schouten freebsd_committer 2017-12-08 22:13:25 UTC
Thanks for testing, Antoine!

I've just committed the change to remove basename_r(3) from the base system. I also sent a pull request to Sean to fix the build of qemu-user-static on FreeBSD HEAD:

https://github.com/seanbruno/qemu-bsd-user/pull/61

I'm reassigning this bug to Sean to ensure this won't slip off the radar.
Comment 4 commit-hook freebsd_committer 2017-12-17 00:14:30 UTC
A commit references this bug:

Author: sbruno
Date: Sun Dec 17 00:14:17 UTC 2017
New revision: 456518
URL: https://svnweb.freebsd.org/changeset/ports/456518

Log:
  emulators/qemu-sbruno
  emulators/qemu-user-static

  Update to 2.11.50 + patches from submitters.  Upstream introduced some git
  nonsense with remotes inside their repos.  Change the way we fetch our
  distributions with GH_TUPLE instead of the previous way.  Clean up a couple
  lines commented out for the PCAP features that aren't stored in a patch, but
  merely direct committed to this tree.

  - Remove the interpreter name and interpreter prefix when retrieving the
    argument vectors using kvm_getargv  (Mikael Urankar)

  - No need to check msg_controllen: msg_controllen can have the value 0 and
    the kernel discards negative value  (Mikael Urankar)

  - Implement/modify kevent64 related syscalls.  (Mikael Urankar)

  - Implement ktimer_{create, delete, settime, gettime} (Mikael Urankar)

  - Stop using basename_r(3). Fix build after FreeBSD svn r326719 (Ed Shouten)

  Changelogs can be found at https://github.com/seanbruno/qemu-bsd-user

  PR:	224016

Changes:
  head/emulators/qemu-sbruno/Makefile
  head/emulators/qemu-sbruno/distinfo
  head/emulators/qemu-sbruno/files/cdrom-dma-patch
  head/emulators/qemu-sbruno/files/patch-Makefile