@@ -8,7 +8,6 @@ import os
88import re
99from collections import defaultdict
1010from dataclasses import dataclass
11- from enum import Enum
1211from functools import reduce
1312from pathlib import Path
1413
@@ -23,7 +22,6 @@ from buildbot.reporters.github import GitHubStatusPush
2322from buildbot .reporters .message import MessageFormatterRenderable
2423from buildbot .schedulers .basic import AnyBranchScheduler
2524from buildbot .schedulers .forcesched import ForceScheduler
26- from buildbot .schedulers .timed import Nightly
2725from buildbot .steps .cmake import CMake
2826from buildbot .steps .master import SetProperties
2927from buildbot .steps .shell import SetPropertyFromCommand , ShellCommand
@@ -135,15 +133,6 @@ HALIDE_BRANCHES = {
135133 HALIDE_RELEASE_21 : VersionedBranch (ref = "release/21.x" , version = Version (21 , 0 , 0 )),
136134}
137135
138- # This lists the Halide branch(es) for which we want to build nightlies;
139- # it's usually desirable to constrain these to save buildbot time (esp on the slower bots)
140- # and avoid branches that aren't changing much (i.e. -- recent releases that aren't
141- # likely to need new updates soon).
142- HALIDE_NIGHTLIES = [
143- HALIDE_MAIN ,
144- HALIDE_RELEASE_21 ,
145- ]
146-
147136# Given a halide branch, return the 'native' llvm version we expect to use with it.
148137# For halide release branches, this is the corresponding llvm release branch; for
149138# halide main, it's llvm main.
@@ -200,11 +189,6 @@ performance_lock = WorkerLock("performance_lock", maxCount=9999)
200189# only take place on one worker.
201190
202191
203- class Purpose (Enum ):
204- nightly = 1
205- testbranch = 2
206-
207-
208192class BuilderType :
209193 """
210194 A class to encapsulate the settings for a specific Builder.
@@ -213,7 +197,6 @@ class BuilderType:
213197 It includes:
214198 - Halide 'target' in the form of arch-bits-os
215199 - LLVM branch to be used
216- - halide-nightly vs halide-testbranch
217200 - sanitizers vs none
218201
219202 It doesn't currently include any 'features' because we don't currently
@@ -224,7 +207,7 @@ class BuilderType:
224207 setup. (If we ever need to do so, compiler should be added to this.)
225208 """
226209
227- def __init__ (self , arch , bits , os , halide_branch , llvm_branch , purpose , sanitizer = None ):
210+ def __init__ (self , arch , bits , os , halide_branch , llvm_branch , sanitizer = None ):
228211 assert arch in ["arm" , "x86" ]
229212 assert bits in [32 , 64 ]
230213 assert os in ["linux" , "windows" , "osx" ]
@@ -235,15 +218,10 @@ class BuilderType:
235218 self .os = os
236219 self .halide_branch = halide_branch
237220 self .llvm_branch = llvm_branch
238- self .purpose = purpose
239221 self .sanitizer = sanitizer
240222
241223 assert self .halide_branch , "halide_branch is required"
242224 assert self .halide_branch in HALIDE_BRANCHES , f"unknown branch { self .halide_branch } "
243- assert (
244- self .purpose == Purpose .testbranch # if not testbranch...
245- or self .llvm_branch in LLVM_FOR_HALIDE [self .halide_branch ]
246- )
247225
248226 if self .sanitizer :
249227 assert self .sanitizer in _SANITIZERS
@@ -329,10 +307,6 @@ class BuilderType:
329307 a = ["halide" ]
330308 if self .sanitizer :
331309 a .append (self .sanitizer )
332- if self .purpose == Purpose .testbranch :
333- a .append ("testbranch" )
334- elif self .purpose == Purpose .nightly :
335- a .append ("nightly" )
336310 a .append (self .halide_branch )
337311 if self .halide_branch == HALIDE_MAIN :
338312 # Halide master is built against multiple LLVM versions,
@@ -871,86 +845,6 @@ def add_build_steps(factory, builder_type):
871845 )
872846
873847
874- def add_package_steps (factory , builder_type ):
875- source_dir = get_source_path ()
876-
877- target = builder_type .halide_target ()
878- ext = "zip" if builder_type .os == "windows" else "tar.gz"
879-
880- factory .addStep (
881- SetPropertiesFromCMakeCache (
882- name = "Get Halide package version" , workdir = get_build_path (), props = ["CMAKE_PROJECT_VERSION" ]
883- )
884- )
885-
886- extra_env = dict (
887- Halide_LLVM_ROOT = Property ("HALIDE_LLVM_ROOT" ),
888- Halide_VERSION = Property ("CMAKE_PROJECT_VERSION" ),
889- )
890-
891- if builder_type .os == "windows" :
892- # TODO: on Windows, we can't use Ninja for packaging (as we do everywhere
893- # else in this cfg) due to a bug in CMake 3.18, so we must use MSBuild;
894- # that means we must use a different build directory entirely. To simplify the
895- # world, we make this a subdir of the real build dir (so it gets cleaned properly).
896- # https://github.com/halide/Halide/issues/5264
897- build_dir = get_build_path ("packaging_dir" )
898-
899- if builder_type .arch == "arm" :
900- arch = "ARM" if builder_type .bits == 32 else "ARM64"
901- else :
902- arch = "Win32" if builder_type .bits == 32 else "x64"
903- cmd = [get_source_path ("packaging/zip/package.bat" ), source_dir , build_dir , arch ]
904- else :
905- build_dir = get_build_path ()
906- cmd = [get_source_path ("packaging/tgz/package.sh" ), source_dir , build_dir ]
907- if builder_type .arch == "arm" and builder_type .bits == 32 and builder_type .os == "linux" :
908- extra_env ["CMAKE_TOOLCHAIN_FILE" ] = get_source_path ("cmake" , "toolchain.linux-arm32.cmake" )
909-
910- factory .addStep (
911- ShellCommand (
912- name = "Package Halide" ,
913- description = "Package Halide" ,
914- workdir = build_dir ,
915- env = Merge (Property ("env" ), extra_env ),
916- locks = [performance_lock .access ("counting" )],
917- haltOnFailure = True ,
918- command = cmd ,
919- )
920- )
921-
922- factory .addStep (
923- FileUpload (
924- name = "Upload Halide package" ,
925- workersrc = Interpolate (f"Halide-%(prop:CMAKE_PROJECT_VERSION)s-{ target } .{ ext } " ),
926- locks = [performance_lock .access ("counting" )],
927- haltOnFailure = True ,
928- workdir = build_dir ,
929- mode = 0o644 ,
930- masterdest = Interpolate (
931- f"{ ARTIFACTS_DIR } /Halide-%s-{ target } -%s.{ ext } " ,
932- Property ("CMAKE_PROJECT_VERSION" ),
933- Lookup (Property ("got_revision" ), "halide" ),
934- ),
935- )
936- )
937-
938- def pkg_version_and_target (path : Path ):
939- # Archives names are formatted like: Halide-[version]-[arch]-[commit].[ext]
940- # This grabs "Halide-[version]-[arch]".
941- match = re .match (r"^(.*)-[a-f0-9]+\.(tar\.gz|tgz|zip)" , path .name )
942- return match .group (1 ) if match else None
943-
944- factory .addStep (
945- CleanOldFiles (
946- name = "Clean old Halide releases" ,
947- workdir = ARTIFACTS_DIR ,
948- locks = [performance_lock .access ("counting" )],
949- groupfn = pkg_version_and_target ,
950- )
951- )
952-
953-
954848# Figure out which "non-cpu" (GPU, DSP, etc) targets this builder can handle.
955849# Return (target, is_simulator)
956850def get_gpu_dsp_targets (builder_type ):
@@ -1341,11 +1235,6 @@ def create_build_factory(builder_type):
13411235 add_install_llvm_step (factory , builder_type )
13421236 add_build_steps (factory , builder_type )
13431237 add_test_steps (factory , builder_type )
1344-
1345- # If everything else looks ok, build a distrib.
1346- if builder_type .purpose == Purpose .nightly :
1347- add_package_steps (factory , builder_type )
1348-
13491238 return factory
13501239
13511240
@@ -1362,16 +1251,16 @@ def get_interesting_targets():
13621251 yield arch , bits , os
13631252
13641253
1365- def create_builder (arch , bits , os , halide_branch , llvm_branch , purpose ):
1254+ def create_builder (arch , bits , os , halide_branch , llvm_branch ):
13661255 # Always do a build with no sanitizers
13671256 sanitizers = [None ]
13681257
1369- # Also build with sanitizers (but not if we are doing nightlies)
1370- # if purpose != Purpose.nightly:
1371- # sanitizers.extend(_SANITIZERS)
1258+ # Also build with sanitizers
1259+ # TODO: disabled for now while we work out packaging issues with the sanitizer runtimes
1260+ # sanitizers.extend(_SANITIZERS)
13721261
13731262 for san in sanitizers :
1374- builder_type = BuilderType (arch , bits , os , halide_branch , llvm_branch , purpose , san )
1263+ builder_type = BuilderType (arch , bits , os , halide_branch , llvm_branch , san )
13751264 if san and not builder_type .handles_sanitizers ():
13761265 continue
13771266
@@ -1389,24 +1278,18 @@ def create_builder(arch, bits, os, halide_branch, llvm_branch, purpose):
13891278
13901279def create_builders ():
13911280 for arch , bits , os in get_interesting_targets ():
1392- # Create builders for build + package of Halide master + release branches
1393- # (but only against their 'native' LLVM versions)
1394- for halide_branch in HALIDE_NIGHTLIES :
1395- for llvm_branch in LLVM_FOR_HALIDE [halide_branch ]:
1396- yield from create_builder (arch , bits , os , halide_branch , llvm_branch , Purpose .nightly )
1397-
13981281 # Create the builders for testing pull requests to releases.
13991282 for halide_branch in _HALIDE_RELEASES :
14001283 for llvm_branch in LLVM_FOR_HALIDE [halide_branch ]:
1401- yield from create_builder (arch , bits , os , halide_branch , llvm_branch , Purpose . testbranch )
1284+ yield from create_builder (arch , bits , os , halide_branch , llvm_branch )
14021285
14031286 # Create the builders for testing pull requests to main.
1404- yield from create_builder (arch , bits , os , HALIDE_MAIN , LLVM_MAIN , Purpose . testbranch )
1287+ yield from create_builder (arch , bits , os , HALIDE_MAIN , LLVM_MAIN )
14051288
14061289 # Test pull requests for Halide master against the current and previous LLVM, for at least one target.
14071290 for llvm_branch in LLVM_BRANCHES :
14081291 if llvm_branch != LLVM_MAIN :
1409- yield from create_builder ("x86" , 64 , "linux" , HALIDE_MAIN , llvm_branch , Purpose . testbranch )
1292+ yield from create_builder ("x86" , 64 , "linux" , HALIDE_MAIN , llvm_branch )
14101293
14111294
14121295def create_scheduler (halide_branch ):
@@ -1421,47 +1304,18 @@ def create_scheduler(halide_branch):
14211304 ref = change .properties .getProperty ("basename" )
14221305 return ref == HALIDE_BRANCHES [halide_branch ].ref
14231306
1424- # ----- nightlies
1425- builders = [
1426- b
1427- for b in c ["builders" ]
1428- if b .builder_type .halide_branch == halide_branch and b .builder_type .purpose == Purpose .nightly
1429- ]
1430- if builders :
1431- builder_names = [str (b .name ) for b in builders ]
1432-
1433- # Start the Halide nightlies at 11PM Pacific; our buildbot master uses UTC for
1434- # cron, so that's 0600. Note that this is (deliberately) well before
1435- # the LLVM nightlies get built (currently 1am start); the idea is
1436- # that Halide nightlies get built using the previous day's LLVM
1437- # nightlies, on the assumption that those are more likely to get at
1438- # least some test coverage (via testbranch) to minimize breakage.
1439- yield Nightly (
1440- name = "halide-package-" + halide_branch ,
1441- builderNames = builder_names ,
1442- hour = 6 ,
1443- minute = 0 ,
1444- )
1445-
1446- yield ForceScheduler (name = "force-halide-nightly-" + halide_branch , builderNames = builder_names )
1447-
1448- # ----- testbranch
1449- builders = [
1450- b
1451- for b in c ["builders" ]
1452- if b .builder_type .halide_branch == halide_branch and b .builder_type .purpose == Purpose .testbranch
1453- ]
1307+ builders = [b for b in c ["builders" ] if b .builder_type .halide_branch == halide_branch ]
14541308 if builders :
14551309 # NOT SingleBranchScheduler, because this can process changes from many branches (all PRs)
14561310 builder_names = [str (b .name ) for b in builders ]
14571311 yield AnyBranchScheduler (
1458- name = "halide-testbranch- " + halide_branch ,
1312+ name = "halide-" + halide_branch ,
14591313 change_filter = ChangeFilter (category = "pull" , branch_fn = is_pr_branch , filter_fn = github_base_branch_matches ),
14601314 treeStableTimer = 60 * 5 , # seconds
14611315 builderNames = builder_names ,
14621316 )
14631317
1464- yield ForceScheduler (name = "force-halide-testbranch- " + halide_branch , builderNames = builder_names )
1318+ yield ForceScheduler (name = "force-halide-" + halide_branch , builderNames = builder_names )
14651319
14661320
14671321def create_schedulers ():
0 commit comments