Subject: Re: bug#55898: Services depending on new Shepherd features may fail until reboot

From: Ludovic Courtès <[email-masked]>
Date: Tue, 30 Aug 2022 15:50:48 +0200

Maxime Devos <[email-masked]> skribis:

> On 30-08-2022 09:33, Ludovic Courtès wrote:
>
>> So are you suggesting replacing:
>>
>>    (defined? 'make-inetd-constructor)
>>
>> by something like:
>>
>>    (version<? shepherd-version "0.9.0")
>>
>> or is it something different that you have in mind?
>>
>> I’m not sure how this could improve the user experience, unless by
>> “user” you mean the person writing the service?
>
> (defined? '...) does not work in all contexts -- it works on the
> top-level, but not always inside a procedure, as it tests if the thing
> is defined in (current-module), and not whether it is defined in the
> module that calls (defined? '...).

Right, but that’s a bit of a theoretical concern in my view.

Alternatively, one could write:

  (module-defined? (resolve-interface '(shepherd service))
                   'make-inetd-constructor)

Thanks,
Ludo’.