Improving the ability to build packages only when a substitute is available

  • Open
  • quality assurance status badge
Details
One participant
  • Richard Sent
Owner
unassigned
Submitted by
Richard Sent
Severity
normal

Debbugs page

Richard Sent wrote 9 months ago
(address . bug-guix@gnu.org)
87cyodskwq.fsf@freakingpenguin.com
Hi Guix!

A question came up on IRC asking how to install package foo if and only
if foo has a substitute available on any server (in this case, foo may
be something like a web browser). This is different from the behavior of
--fallback. From [1]:

Toggle quote (4 lines)
> Note that when substitutes are disabled or no substitute is available
> for the derivation in question, a local build will _always_ be
> performed, regardless of whether or not ‘--fallback’ was given.

The solution I came up with is "$ guix weather foo && guix install foo".
However, this unfortunately does not work with how guix weather reports
command success. Guix Weather returns nonzero if /any/ substitute server
is missing the substitute, not just one. This hurts the ability to use
guix weather in the context I described since false-negatives in
substitute availability are detected.

In my opinion "returning zero if any substitute server has foo
available" is more useful behavior than "returning zero if and only if
every substitute server has foo".

I propose adding a --strict flag or similar to Guix weather. By default,
Guix weather returns zero if any server has a substitute. With --strict,
the current behavior is used.

Alternatively, a cleaner but potentially more involved solution may be
adding a --only-substitutes or similar flag to all commands that can
initiate builds.

[1]: (info "(guix) Substitution Failure")

--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 71641@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71641
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help