launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #17475
[Merge] lp:~wgrant/launchpad/bpb-arch_indep-2 into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/bpb-arch_indep-2 into lp:launchpad.
Commit message:
Pass BinaryPackageBuild.arch_indep through to the slave, rather than using isNominatedArchIndep directly.
Requested reviews:
William Grant (wgrant): code
Related bugs:
Bug #1350208 in Launchpad itself: "createMissingBuilds misbehaves when copying between series with different nominatedarchindep"
https://bugs.launchpad.net/launchpad/+bug/1350208
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bpb-arch_indep-2/+merge/240802
Now that BinaryPackageBuild.arch_indep is populated everywhere, we can use it to fill the launchpad-buildd's arch_indep argument. And drop the migration code.
--
https://code.launchpad.net/~wgrant/launchpad/bpb-arch_indep-2/+merge/240802
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2014-11-03 06:39:07 +0000
+++ database/schema/security.cfg 2014-11-06 02:23:37 +0000
@@ -2237,7 +2237,6 @@
public.answercontact = SELECT, DELETE
public.branch = SELECT, UPDATE
public.branchjob = SELECT, DELETE
-public.binarypackagebuild = SELECT, UPDATE
public.binarypackagename = SELECT
public.binarypackagerelease = SELECT
public.binarypackagepublishinghistory = SELECT, UPDATE
=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py 2014-11-03 14:08:35 +0000
+++ lib/lp/scripts/garbo.py 2014-11-06 02:23:37 +0000
@@ -117,7 +117,6 @@
from lp.services.session.model import SessionData
from lp.services.verification.model.logintoken import LoginToken
from lp.soyuz.model.archive import Archive
-from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
from lp.soyuz.model.livefsbuild import LiveFSFile
from lp.soyuz.model.publishing import SourcePackagePublishingHistory
from lp.soyuz.model.reporting import LatestPersonSourcePackageReleaseCache
@@ -1347,39 +1346,6 @@
transaction.commit()
-class BinaryPackageBuildArchIndepPopulator(TunableLoop):
- """Populate the status and build_farm_job columns of BuildQueue."""
-
- maximum_chunk_size = 5000
-
- def __init__(self, log, abort_time=None):
- super(BinaryPackageBuildArchIndepPopulator, self).__init__(
- log, abort_time)
- state = load_garbo_job_state(self.__class__.__name__) or {}
- self.start_at = state.get('next_bpb_id', 1)
- self.store = IMasterStore(BinaryPackageBuild)
-
- def findBuilds(self):
- return self.store.find(
- BinaryPackageBuild,
- BinaryPackageBuild.id >= self.start_at).order_by(
- BinaryPackageBuild.id)
-
- def isDone(self):
- return (
- not getFeatureFlag('soyuz.bpb_arch_indep_populator.enabled')
- or self.findBuilds().is_empty())
-
- def __call__(self, chunk_size):
- bpbs = list(self.findBuilds()[:chunk_size])
- for bpb in bpbs:
- bpb.arch_indep = bpb.distro_arch_series.isNominatedArchIndep
- self.start_at = bpbs[-1].id + 1
- save_garbo_job_state(
- self.__class__.__name__, {'next_bpb_id': self.start_at})
- transaction.commit()
-
-
class LiveFSFilePruner(BulkPruner):
"""A BulkPruner to remove old `LiveFSFile`s.
@@ -1655,7 +1621,6 @@
UnusedSessionPruner,
DuplicateSessionPruner,
BugHeatUpdater,
- BinaryPackageBuildArchIndepPopulator,
]
experimental_tunable_loops = []
=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py 2014-11-05 10:54:10 +0000
+++ lib/lp/scripts/tests/test_garbo.py 2014-11-06 02:23:37 +0000
@@ -116,10 +116,7 @@
TestCase,
TestCaseWithFactory,
)
-from lp.testing.dbuser import (
- dbuser,
- switch_dbuser,
- )
+from lp.testing.dbuser import switch_dbuser
from lp.testing.layers import (
DatabaseLayer,
LaunchpadScriptLayer,
=== modified file 'lib/lp/soyuz/model/binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2014-07-24 11:11:30 +0000
+++ lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2014-11-06 02:23:37 +0000
@@ -139,11 +139,7 @@
# Build extra arguments.
args = {}
- # turn 'arch_indep' ON only if build is archindep or if
- # the specific architecture is the nominatedarchindep for
- # this distroseries (in case it requires any archindep source)
- args['arch_indep'] = das.isNominatedArchIndep
-
+ args['arch_indep'] = build.arch_indep
args['distribution'] = das.distroseries.distribution.name
args['suite'] = das.distroseries.getSuite(build.pocket)
args['arch_tag'] = das.architecturetag
=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2014-07-24 11:11:50 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2014-11-06 02:23:37 +0000
@@ -55,6 +55,9 @@
from lp.soyuz.adapters.archivedependencies import (
get_sources_list_for_building,
)
+from lp.soyuz.model.binarypackagebuildbehaviour import (
+ BinaryPackageBuildBehaviour,
+ )
from lp.soyuz.enums import ArchivePurpose
from lp.testing import TestCaseWithFactory
from lp.testing.dbuser import switch_dbuser
@@ -286,6 +289,19 @@
'Soyuz is not yet capable of building SECURITY uploads.',
str(e))
+ def test_arch_indep(self):
+ # BinaryPackageBuild.arch_indep is passed through to the slave.
+ build = self.factory.makeBinaryPackageBuild(arch_indep=False)
+ self.assertIs(
+ False,
+ BinaryPackageBuildBehaviour(build)._extraBuildArgs(build)[
+ 'arch_indep'])
+ build = self.factory.makeBinaryPackageBuild(arch_indep=True)
+ self.assertIs(
+ True,
+ BinaryPackageBuildBehaviour(build)._extraBuildArgs(build)[
+ 'arch_indep'])
+
def test_verifyBuildRequest(self):
# Don't allow a virtual build on a non-virtual builder.
archive = self.factory.makeArchive(purpose=ArchivePurpose.PPA)
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2014-10-31 07:07:49 +0000
+++ lib/lp/testing/factory.py 2014-11-06 02:23:37 +0000
@@ -3560,7 +3560,7 @@
def makeBinaryPackageBuild(self, source_package_release=None,
distroarchseries=None, archive=None, builder=None,
status=None, pocket=None, date_created=None, processor=None,
- sourcepackagename=None):
+ sourcepackagename=None, arch_indep=None):
"""Create a BinaryPackageBuild.
If archive is not supplied, the source_package_release is used
@@ -3594,6 +3594,8 @@
and processor != distroarchseries.processor):
raise AssertionError(
"DistroArchSeries and Processor must match.")
+ if arch_indep is None:
+ arch_indep = distroarchseries.isNominatedArchIndep
if archive is None:
if source_package_release is None:
archive = distroarchseries.main_archive
@@ -3624,7 +3626,8 @@
status=status,
archive=archive,
pocket=pocket,
- builder=builder)
+ builder=builder,
+ arch_indep=arch_indep)
IStore(binary_package_build).flush()
return binary_package_build
References