On Tue, 26 Jan 2016 15:42:13 +0100 Johannes Schauer <jo...@debian.org> wrote:
> Hi,
> 
> Quoting Johannes Schauer (2015-12-24 01:08:39)
> > So I guess a sensible default would be either put this in ~/.sbuildrc:
> > 
> > $build_environment = %ENV;
> > 
> > Or to be more conservative and say:
> > 
> > $build_environment = {
> >     'DEB_BUILD_OPTIONS' => $ENV{'DEB_BUILD_OPTIONS'}
> > };
> 
> I can confirm that the latter of the above two options indeed works.
> 

This breaks the case where you don't want to set DEB_BUILD_OPTIONS at all as 
the user. In this case, when doing a cross-build, sbuild will overwrite 
DEB_BUILD_OPTIONS with the empty value from the outside, clobbering what would 
have been a "nocheck" value.

- this is against the Build-Profiles specification, which says "Builds that set 
this profile must also add nocheck to DEB_BUILD_OPTIONS" 
https://wiki.debian.org/BuildProfileSpec

- d/rules that assume nothing violates the spec, will proceed with attempting 
to build and run tests in this cross build.

> > Or to change the default of the BUILD_ENVIRONMENT config variable in Conf.pm
> > from the empty hash to %ENV.
> > 
> > Or lastly, to change the check that you quoted above to also check
> > $ENV{'DEB_BUILD_OPTIONS'} and concatenate accordingly.
> 
> Neither of the above is a sensible solution by itself. A greater pictures has
> to be considered. [..]
> 
> And to top it off, there are also some environment variables like
> DEB_BUILD_OPTIONS where one has the choice between appending to them or just
> replacing their existing value.
> 
> Now preferably sbuild should do the right thing while at the same time not
> removing control from the user.
> 
> There seem to four general options:
> 
> [..]

IMO this is way over-thinking it. Just append "nocheck" to the pre-existing 
value of DEB_BUILD_OPTIONS.

If sbuild needs to modify the environment elsewhere, treat those cases 
according to the specific semantics of those envvars. There is no general 
solution, because every envvar has different semantics. That shouldn't stop us 
from fixing the DEB_BUILD_OPTIONS behaviour.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

Reply via email to