Bug 297851 - [NEW PORT] sysutils/gtime: GNU version of the time(1) utility
Summary: [NEW PORT] sysutils/gtime: GNU version of the time(1) utility
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Osipov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-24 14:09 UTC by Brian Callahan
Modified: 2026-09-26 22:56 UTC (History)
1 user (show)

See Also:


Attachments
GNU time port via git format-patch (1.79 KB, patch)
2026-08-24 14:09 UTC, Brian Callahan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Callahan 2026-08-24 14:09:36 UTC
Created attachment 274082 [details]
GNU time port via git format-patch

Hello --

We would like to propose a new port, sysutils/gtime, which is the GNU version of the time(1) utility.

We do a good amount of research on FreeBSD and across operating systems. The built-in time utility in bash is unreliable on FreeBSD (it occasionally produces non-numeric garbage output). Having GNU time available eliminates as best we can a potential confounding variable in our research when comparing timed runs across operating systems.

One test fails; we are happy to work with upstream to get that fixed. The test failure doesn't affect our usage of the utility.

We are also happy to maintain the port; it is fairly straightforward and is rarely updated upstream.

Thanks.
Comment 1 Brian Callahan 2026-09-26 19:34:49 UTC
Hello --

We would still appreciate this port being accepted. As mentioned, because we are heavy users of it, our research lab is happy to maintain this port for the long-term future.

Thanks.
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2026-09-26 21:50:13 UTC
Interesting observation. Do you have any insights what might be wrong with time(1) in the base system? Ideally we would fix this instead of resorting to external tools.

I will take care of you patch!
Comment 3 Brian Callahan 2026-09-26 21:54:45 UTC
(In reply to Michael Osipov from comment #2)
time(1) in the base system is fine :) But it's not readily available across FreeBSD, OpenBSD, NetBSD, Linux, macOS, and Illumos. GNU time is, so it's what we use everywhere.

Our original approach was to use the built-in time in bash, since bash is also readily available across operating systems. However, it is unreliable on FreeBSD; quick (~1s) timing collections in a 1000+ iteration loop occasionally produces - characters where there should be numbers.

Thanks.
Comment 4 Michael Osipov freebsd_committer freebsd_triage 2026-09-26 21:57:16 UTC
(In reply to Brian Callahan from comment #3)

OK, I see. Have you reported with upstream? I did several patches for bash years ago for HP-UX and the author was very receptive to those. Might be worth looking into.
Comment 5 Brian Callahan 2026-09-26 22:06:26 UTC
(In reply to Michael Osipov from comment #4)
We haven't reported anything to bash yet but it is on our (long) todo list...
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-09-26 22:55:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=21f9947ab9bb13e4c7d1b252d5c25347c19979ff

commit 21f9947ab9bb13e4c7d1b252d5c25347c19979ff
Author:     Brian Callahan <bcallaha@monmouth.edu>
AuthorDate: 2026-08-23 23:44:26 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-09-26 22:54:25 +0000

    sysutils/gtime: new port

    GNU time runs another program, then displays information about the
    resources used by that program.

    Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
    PR:             297851

 sysutils/Makefile              |  1 +
 sysutils/gtime/Makefile (new)  | 22 ++++++++++++++++++++++
 sysutils/gtime/distinfo (new)  |  3 +++
 sysutils/gtime/pkg-descr (new) |  2 ++
 4 files changed, 28 insertions(+)