Merge ~iconstantin/ubuntu-security-tools:master into ubuntu-security-tools:master

Proposed by Ian Constantin
Status: Merged
Merged at revision: 71d1afbeb6ce406e59ca57435ff27ff064d4a17f
Proposed branch: ~iconstantin/ubuntu-security-tools:master
Merge into: ubuntu-security-tools:master
Diff against target: 43 lines (+9/-2)
1 file modified
build-tools/umt (+9/-2)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+457304@code.launchpad.net

Commit message

Adding the option to skip the lintian check for binary builds

Description of the change

Primarily adding this option to skip the lintian check due to the following bug:

"lintian: Complex regular subexpression recursion limit exceeded in cruft check"
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993613>

This bug has been addressed in lintian version 2.115.3, leaving Jammy and earlier affected. I have bumped into this bug with dotnet builds, causing them to stall for many hours.

Having the ability to skip lintian will allow us to further normalize our dotnet build process by making umt usable (and will introduce the option for future scenarios if needed).

This PR only adds this option for binary builds since the ability to skip lintian for source builds already exists via: --add-debuild-opts='--no-lintian'

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

I like the idea of this but can't help but nitpick - sorry - would a better name for this be --skip-lintian?

Also would it be better to just add a --skip-lintian flag to the common build arguments so it can be used for both source and binary builds?

Revision history for this message
Ian Constantin (iconstantin) wrote :

Hey Alex, thank you for the quick review. Not nipicky at all, I think --skip-lintian works much better as a umt option.

Re: having it as a common build argument, that is how I implemented it originally, but then switched it to a binary only arg once I realized skipping lintian could already be achieved for source via --add-debuild-opts, which would allow the user the flexibility to choose if they want to skip them individually when running umt build.

However, I think --skip-lintian as a common build arg is more intuitive and in the rare cases where it will be used, will likely be meant to skip all lintian checks (further someone could run umt [source, binary] separately if they would need to skip lintian for only one of the two steps).

Please let me know if you think anything else should be adjusted - thank you!

Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM (lpci failure seems a transient network issue and unrelated to this change).

review: Approve
Revision history for this message
Ian Constantin (iconstantin) wrote :

> LGTM (lpci failure seems a transient network issue and unrelated to this
> change).

Ack, thank you again Alex!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/build-tools/umt b/build-tools/umt
2index 6d26d2c..db4221c 100755
3--- a/build-tools/umt
4+++ b/build-tools/umt
5@@ -570,6 +570,10 @@ def perform_source_build(details, opt):
6 for arg in opt.debuild_opts.split(" "):
7 build_params.append(arg)
8
9+ # common skip_lintian build option adds the --no-lintian debuild option
10+ if opt.skip_lintian:
11+ build_params.append('--no-lintian')
12+
13 if opt.start_version != "":
14 details['start_version'] = opt.start_version
15 build_params.append('-v%s' % (details['start_version']))
16@@ -631,6 +635,9 @@ def perform_binary_build(details, opt):
17 else:
18 buildopts.append('--no-arch-all')
19
20+ if opt.skip_lintian:
21+ buildopts.append('--no-run-lintian')
22+
23 if opt.cov_build:
24 if os.path.isfile(opt.cov_build) and os.access(opt.cov_build, os.X_OK):
25 prepare_dir(coverity_dest, opt.force)
26@@ -3899,7 +3906,6 @@ def add_binary_build_opts(parser: argparse.ArgumentParser):
27 parser.add_argument("--purge-schroot", metavar="METHOD", default=None, action='store',
28 help="Specify sbuild purge behavior (man sbuild): 'always' (sbuild default), 'successful', or 'never'. If not specified, uses sbuild default (or the value of $purge_session/$purge_build_directory in ~/.sbuildrc)")
29
30-
31 def add_common_build_opts(parser: argparse.ArgumentParser):
32 '''Adds common options.'''
33
34@@ -3935,7 +3941,8 @@ def add_common_build_opts(parser: argparse.ArgumentParser):
35 warn("Invalid setting '%s' for pkgbuild_parallel. Using autodetection" % (ust['pkgbuild_parallel']))
36 parser.add_argument("--parallel", default=cpus, metavar="THREADS",
37 help="how many CPUs to use for building, via DEB_BUILD_OPTIONS (default: autodetected %s or via pkgbuild_parallel in conf)" % (cpus))
38-
39+ parser.add_argument("--skip-lintian", dest="skip_lintian", default=False, action='store_true',
40+ help="Prevents lintian from running")
41
42 class OverrideConfigAction(argparse.Action):
43 def __init__(self, option_strings, dest, nargs=None, **kwargs):

Subscribers

People subscribed via source and target branches