On Fri, Jul 20, 2018 at 12:54:10PM +0200, Guillem Jover wrote:
> Hi!
>
> 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.)
Perhaps we need a new option to allow us to pass extra commandline
arguments?
Or is the rules file being too cautious for its own good?
Thanks,
Danek