Control: reassign -1 vim
Control: retitle -1 vim: Make it possible to set VARIANT with multiple values

[ Leaving enough context for the reassignment. ]

On Fri, 2018-07-20 at 07:37:26 -0700, Danek Duvall wrote:
> On Fri, Jul 20, 2018 at 12:54:10PM +0200, Guillem Jover wrote:
> > On Mon, 2018-07-16 at 12:33:31 -0700, Danek Duvall wrote:
> > > Package: dpkg-dev
> > > Version: 1.18.24
> > > Severity: wishlist

> > > I'm trying to run a build of Debian's vim package, but limiting it to a 
> > > couple
> > > of variants, to reduce the build time.  The debian/rules file allows you 
> > > to set
> > > the VARIANT variable on the commandline to the variants you want, but
> > > communicating a variable with a value containing a space to the makefile 
> > > via
> > > dpkg-buildpackage isn't possible, as far as I can tell.
> > > 
> > > What does work is
> > > 
> > >     dpkg-buildpackage -b --no-sign -R"debian/rules VARIANT=vim-nox"
> > > 
> > > Though perhaps I'm abusing the -R option here a bit, as there's no 
> > > explicit way
> > > to pass non-target arguments to dpkg-buildpackage (and perhaps that's the 
> > > real
> > > request here).
> > > 
> > > What does not work is
> > > 
> > >     dpkg-buildpackage -b --no-sign -R"debian/rules VARIANT='vim-nox 
> > > vim-tiny'"
> > > 
> > > It complains that there's no "vim-tiny'" target.

> > Yeah, because that's not a valid invocation. :)
> > 
> > You should just pass the variable as part of the environment, such as:
> > 
> >   $ VARIANT="a b" dpkg-buildpackage --no-sign -b
> > 
> > Does that not work? Otherwise I'll just close this report. Or perhaps
> > add some words to the man page in case this was not obvious.
> 
> It doesn't work for this particular rules file, because it specifically
> checks to see that the variable comes from the command-line:
> 
>     ifeq ($(origin VARIANT), command line)
> 
> Now, setting VARIANT just lets you override the existing Makefile variable
> VARIANTS, but you can only override Makefile variables via the environment
> if you pass the -e flag, and that's a pretty big hammer for this problem.
> (Plus, -R is still probably the wrong way of passing that along, even
> though it would work.)

Ah! Well, as a workaround you can always do something like:

  $ dpkg-buildpackage --no-sign -b \
    -R "debian/rules VARIANT+=vim-nox VARIANT+=vim-tiny"

> Perhaps we need a new option to allow us to pass extra commandline
> arguments?

I think what -R provides, which does allow to pass space-separated
arguments should be enough, combined with the usual convention of
debian/rules accepting variables from the environment.

> Or is the rules file being too cautious for its own good?

It appears so to me, yes. I'd probably change it to:

  ,---
  ifneq ($(origin VARIANT), undefined)
        VARIANTS = $(VARIANT) vim-basic
  endif
  `---

Because it should in theory never be “default”, “file”, “override”
nor “automatic”. Ant we'd want the condition to trigger on one of
“command line”, “environment” or “environment override”. So that
leaves “undefined” to key on.

I'm thus reassigning the report to the vim package.

Thanks,
Guillem

Reply via email to