From: Alex Kost <alezost@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Bugs in parsing build options
Date: Wed, 25 Feb 2015 17:38:26 +0300 [thread overview]
Message-ID: <871tlegiot.fsf@gmail.com> (raw)
In-Reply-To: <87oaoj7wu0.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 24 Feb 2015 23:45:27 +0100")
Ludovic Courtès (2015-02-25 01:45 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> I noticed that "--no-grub" option has no effect. For example,
>> "guix system --no-grub reconfigure" installs GRUB anyway.
>>
>> Further investigation showed that there is a problem in parsing build
>> options. After that commit (847391f) we have the following code:
>>
>> (append (parse-options-from args)
>> (parse-options-from (environment-build-options)))
>>
>> in several places. But 'parse-options-from' returns default values for
>> unspecified options, e.g. if you didn't set GUIX_BUILD_OPTIONS, then
>> (parse-options-from '()) will return an alist of default options
>> (including ‘(install-grub? . #t)’).
>
> Indeed, good catch. Commit 6e1a7d1 fixes it.
Not really, I'm afraid.
>> So build commands will just ignore such options as "--no-grub" or
>> "--no-substitutes" if a user didn't tweak GUIX_BUILD_OPTIONS.
>
> The problem was in fact specific to the option handler for --no-grub;
> the one for --no-substitutes (and all the others I checked) always
> conses, so there’s no problem.
Yes, I realized that, but I believe the real problem lies deeper – it is
in the current way of parsing build options in general (sorry, I should
have written more about that initially).
Suppose a user specifies "--no-substitutes" in his GUIX_BUILD_OPTIONS
and then he calls "guix system reconfigure". What would happen?
Substitutes _will be used_ anyway, because:
‘(parse-options-from args)’ will contain ‘(substitutes? . #t)’ among
other things and it will shadow the false value for substitutes returned
by ‘(parse-options-from (environment-build-options))’.
Now (after your patch) the same will happen with "--no-grub":
“export GUIX_BUILD_OPTIONS=--no-grub” will not be honored unless a user
explicitly specifies "--no-grub" option one more time in a "guix system"
command.
That's why I didn't propose a patch initially: I don't really know what
would be the best way to fix all that.
--
Alex
next prev parent reply other threads:[~2015-02-25 14:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJ41eeyECrUPfEhS+9puU3y0iczEeCs8JgKB8RnTRofVNOW_4w@mail.gmail.com>
2014-12-05 0:53 ` [PATCH] guix: scripts: Fix GUIX_BUILD_OPTIONS handling Deck Pickard
2014-12-06 15:04 ` Ludovic Courtès
2015-02-20 20:47 ` Bugs in parsing build options Alex Kost
2015-02-24 22:45 ` Ludovic Courtès
2015-02-25 14:38 ` Alex Kost [this message]
2015-02-25 23:05 ` Ludovic Courtès
2015-02-26 21:08 ` Alex Kost
2015-05-30 16:26 ` Alex Kost
2015-05-31 19:32 ` Ludovic Courtès
2015-06-01 6:52 ` Alex Kost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871tlegiot.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.