Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.61k stars 12.35k forks source link

libfaketime should depend on coreutils #26568

Closed jsoref closed 6 years ago

jsoref commented 6 years ago

To help us debug your issue please explain:

Note: on my system, coreutils was installed and linked, and thus faketime worked for me. When I had a colleague install libfaketime, faketime didn't work, because he hadn't installed coreutils. But, essentially libfaketime isn't functional without coreutils, and thus it should depend on it. For lack of a better reference: https://github.com/wolfcw/libfaketime/blob/c9a681c3e36c453affb7ff393458478a953d886c/src/faketime.c#L174

Manually "fixing" libfaketime can be achieved by: brew install coreutils as:

brew install coreutils

After which, this works:

$ faketime '2010-01-01 12:00:00Z' ./date
Fri Jan  1 07:00:00 EST 2010

Note: while my sample includes copying date to ., that's coincidental. Because of macOS's System Integrity Protection, one can't shim system programs. For our actual use case, we aren't shimming date, although we do copy the program we are shimming to a non protected directory in order to shim it.

ilovezfs commented 6 years ago

Are you saying it's incompatible with BSD date command? That sounds like an upstream porting issue to me.

jsoref commented 6 years ago

It requires gnu date. That's an upstream choice. And since it requires it, the brew formula needs to make gnu date available.

jsoref commented 6 years ago

https://github.com/wolfcw/libfaketime/blob/c9a681c3e36c453affb7ff393458478a953d886c/src/faketime.c#L54

ilovezfs commented 6 years ago

Please create an issue upstream about this as I'm not comfortable resorting to a coreutils dependency unless there's some reason the BSD date command cannot do what's needed, which is unlikely.

the brew formula needs to make gnu date available.

We could simply remove the faketime command as the library is still useful without it.

jsoref commented 6 years ago

@ilovezfs: in https://github.com/wolfcw/libfaketime/issues/158#issuecomment-381385252 @wolfcw indicates that a distinct package for faketime that depended on either a gdate or coreutils package seems reasonable.

How does that sound to you?

ilovezfs commented 6 years ago

@jsoref we'll just depend on coreutils. This is now fixed.