Lobsters - 03 Dec 2026

Page 9 of 10

("Root" => "rootdepot.sys-ntgroup.ntdev.microsoft.com:2001"),

("SdkTools" => "sdktoolsdepot.sys-ntgroup.ntdev.microsoft.com:2013"),

("Shell" => "shelldepot.sys-ntgroup.ntdev.microsoft.com:2014"),

("TermSrv" => "termsrvdepot.sys-ntgroup.ntdev.microsoft.com:2015"),

("Windows" => "windowsdepot.sys-ntgroup.ntdev.microsoft.com:2016"));

The developer dealt with SDX 1.03, in tools/sdx.pl. Point SDXROOT at an enlistment, select the product, branch and projects wanted (there was an option for all projects), and sdx sync, submit or integrate did its work in every project one after another. In 2001 there were scripts both to catch a project pointing to a different branch from the enlistment root, checkdepots.pl, and to switch an entire enlistment, changelab.pl.

Public was the place to go for another project's headers and libraries. The primary build machine for the branch checked them in. Add or remove a file and you had to put your mail name and reason in tools/publicchanges.txt. It says "KEEP THIS FILE SORTED..." twice. The file and its archive record 2,250 entries by 242 people, from "Mistake" and "Fix public screwup" to "use in conjunction with sputilsa.lib (temporary)". Six build files require you to consult a named individual. "Any changes made without doing so will be summarily deleted".

=tools/buildmachines.txt= lists the labs actually building Windows. Lab01_N through Lab07_N, with no Lab05, and Lab10_N. changelab.pl would accept names as far as lab15_n. There was main, xpclient for the product, xpsp1 for the service pack and a QFE branch for hotfixes. VBL is what the scripts call a lab's build machines, presumably virtual build lab. All told the file contains 158 entries for 146 official machines across fourteen branches. Take the rule about primary machines at the head of the file and then look at the very first branch it lists.

; This file lists the official build machines for each branch. It's layout

; s/b obvious (machinename,primary/secondary,branchname,arch,chk/fre,notifydl). There can only be

; one primary build machine for any branch (that's the machine that will be

; checking in most of the published headers and libs).

WINSEXPFI,primary,xpclnt_qfe,ia64,fre,qfebld

WINSEXPFX,primary,XPCLNT_QFE,x86,fre,qfebld

WINSEXPCI,primary,XPCLNT_QFE,ia64,chk,qfebld

WINSEXPCX,primary,XPCLNT_QFE,x86,chk,qfebld

One primary per branch is permitted. The first branch, QFE, has four, one for each combination of architecture and flavour. Fre means retail or free and chk means debug or checked. Main, xpclient, idx01 and idx02 also have four. 77 entries say distbuild, where several machines shared a build. The 158 entries break down as 82 x86, 72 Itanium, two AMD64 (one machine, two flavours of Cutler's port), and two axp64, lab machines for the old 64-bit Alpha.

Read an RI in the comments to tools/sdx.pm and you can time an actual delivery. RI is reverse integration, lab up into main, whereas ordinary integration went back down to the lab. For build 2268 on 8 September 2000 Lab07 sent a change into each of seven depots. The entries start at five in the afternoon and cover a little over two minutes.

build contrib

build type op branch branch project change/timestamp

----- ---- --- ------ ------- ---------- -------------------------

2268 MAIN RI main lab07_n admin 15654 2000/09/08:17:00:04

2268 MAIN RI main lab07_n base 10928 2000/09/08:17:00:21

2268 MAIN RI main lab07_n com 1755 2000/09/08:17:00:29

RI could also mean the deadline after which somebody hoped to tidy up. A driver kit copy script has an "extra split for a quick fix so we can RI". A proper one "will be test and checked in for the next RI."

In 2017 Windows finally moved from Source Depot to Git. It had grown to 3.5 million files, 300 GB, 4,000 engineers and 440 branches, with 1,760 lab builds in a day.

How it was built

How did they get one Windows out every day when developing Windows 2000 had taken about 1,400 developers and 1,700 testers? Mark Lucovsky, one of the original NT engineers, gave a talk in August 2000 and described what they had been doing. You needed written permission to change the source. The build lab approved about a hundred changes a day and typed the sync and build commands in itself. In his words, "a developer that mistypes a build instruction can stop the build lab, which in turn stops over 5,000 people". The lab branches let each lab run its builds, "100% hands off". Ten in the morning and ten at night each got a "full synch and full build", with failures detected and mailed to the team. Under tools you can read how much of what we now do in CI they had got working.

The first thing you needed was a build window. tools/razzle.cmd, named after NT's old code name Razzle according to Chen, gave you "a pure system path", because "16-bit tools sometimes puke on long paths". The compilers from the tree went first. It picked the processor and, unless you asked otherwise, gave you a checked build with DBG=1 and the assertions intact. About 8,500 C files and headers have conditional DBG blocks. Then the command to build Windows was build. Its 20,335 lines are in sdktools/build and its history starts on 16 May 1989. It walked dirs files to find the directories and sources files to find out what one binary needed. There are 3,650 of the former and 13,139 of the latter. Minesweeper's sources, for example, identifies a program named winmine, lists its C files and asks for the Unicode definitions and the C runtime.

TARGETNAME=winmine

TARGETPATH=obj

TARGETTYPE=PROGRAM

INCLUDES=.;..

C_DEFINES=-DWIN32 -D_UNICODE -DUNICODE

USE_MSVCRT=1

MSC_WARNING_LEVEL=/W3 /WX

SOURCES=winmine.c \

grafix.c \

pref.c \

rtns.c \

sound.c \

util.c \

res.rc

Look at the makefile beside almost any one of those sources files and there's only one line of consequence. All the machinery is in tools/makefile.def, 4,532 lines of nmake shared across the tree. Some 7,125 little makefiles say they're for "all the components of NT OS/2", as the project was called until 1990. build.exe sent nmake round three times, to generate files such as the MIDL interfaces and message tables, to compile, and to link. binplace then split out the debug symbols and put the binaries where placefil.txt told it to (19,593 entries). If a build had no errors, build.exe deleted the empty build.err. Everything else could watch for the existence of that one file. And an individual developer didn't have to build Windows just to try a change. PopulateFromVBL.pl gave you the lab's latest binaries to use with the project you'd compiled yourself.

There is a per-processor makefile too. All the architectures use /WX to turn a compiler warning into an error. Two undocumented options caught my eye in the x86 makefile. Its comments translate them: /QIf asks for frame pointer omission records for every function, and /QIfdiv- tells the compiler not to generate a test for faulty Pentiums.

# Undocumented switch definitions

# /QIfdiv- : Don't emit code to test for bad pentiums

# /QIf : Emit FPO records for every function

ERATTA_FLAGS=/QIfdiv- /QIf

The old 1994 Pentium division bug shows up in the kernel elsewhere in this article. Here every x86 file was compiled with an explicit instruction to leave out the compiler's check for it. You can date the compiler quite closely. tools/x86 contains pre-release binaries, with cl.exe identifying itself as 13.00.9176 from March 2001. Visual Studio .NET, the product it was being built for, appeared in February 2002 with 13.00.9466.

An official binary carries the branch name. Somebody using a shared Terminal Services machine for a buddy build gets the branch and computer name, and an ordinary developer gets the branch and their user name. That's how you can look at the 112 stamped tools in tools/x86 and find that 91 came from somebody's machine or a shared one. One is a header tool for WOW64, which lets 32-bit software run on 64-bit Windows. It was built under Dave Cutler's user name, starting at 20:36 on New Year's Day 2001.

Now follow a build in the lab. tools/timebuild.pl has most of the work written out in its running order, a condition on the left, the command it governs beside it.

'!NOSYNC revert_public.cmd',

'=CHECKSYNC CHECKWARN perl %sdxroot%\Tools\sendbuildstats.pl -warn -m revert_public failed',

'=NOSCORCH @echo SKIPPING scorch',

'!NOSCORCH nmake -lf makefil0 scorch_source',

'!NOSCORCH CHECKWARN perl %sdxroot%\Tools\sendbuildstats.pl -warn -m scorch failed see %sdxroot%\build.scorch',

'!NOSYNC sdx sync ...<<timestamp>> -q -h > build.changes 2>&1',

'=CHECKSYNC CHECKWARN perl %sdxroot%\Tools\sendbuildstats.pl -warn -m sdx sync failed',

'!NOSYNC sdx resolve -af',

'=CHECKSYNC CHECKWARN perl %sdxroot%\Tools\sendbuildstats.pl -warn -m sdx resolve failed',

'!NOSYNC perl %sdxroot%\Tools\ChangesToFiles.pl build.changes > build.changedfiles 2>&1',

'!NOSYNC @echo BUILDDATE=<<BUILDDATE_timestamp>> > __blddate__',

# ' sdx delta > build.baseline',

'!NOCLEANBUILD build -cZP',

'=NOCLEANBUILD @echo NOT BUILDING CLEAN',

'=NOCLEANBUILD build -ZP',

' CHECKBUILDERRORS',

' CHECKFATAL perl %sdxroot%\Tools\sendbuildstats.pl -too -buildfailure',

Read !NOSYNC as unless you've asked to skip the sync, CHECKWARN as mail somebody if the previous step failed, CHECKFATAL as stop. The first casualties of a clean build were local modifications to the published headers and writable files that Source Depot hadn't supplied, removed by scorch_source. The sixteen depots were all synced to the same minute. That date went in the build. The script ran the clean build and if it failed, mailed the people who might have broken it.

=2415.x86fre.main.001222-1745= was an example in the usage text. If build 2415 was to be a retail x86 build from main at 17:45 on 22 December 2000, timebuild could wait for that minute, sync every depot to it, then use it for the name. That's how you read 5.1.2600.1106 (xpsp1.020828-1920) on an SP1 machine: xpsp1 on 28 August 2002 at 19:20. The number in ntverp.h itself was "only modified by the official builder". You can still read newver.pl, a "failed attempt at a auto-newver script, keeping for future reference". Larry Osterman traces the round release number to Brian Valentine. NT used to advance one a day, but over on Exchange where Valentine came from they rounded up at a milestone. XP got 2600.

It's one thing to notice that a file no longer compiles. Is its last editor the person to drag out of bed? sendbuildstats.pl took the broken paths, turned them into directories and asked what files in those directories had been synced since the last build. That gave it a set of changes and a set of people.

for (<FD>) {

my($project, $change, $dev, $date, $time, $sdpath, $type) = split;

next unless $type;

$_ = $sdpath;

s|#.*||; # strip #change

s|//depot/[^/]*/||i; # strip //depot/lab

tr|/|\\|; # / -> \

$canonpath = CanonicalizeBuildPath $_;

next unless $BuildFailure{$canonpath};

print "Suspect $dev because of change $change affecting $canonpath\n" if $Verbose and not $Pinged{$change};

$Pinged{$change}++;

$Checklist{$dev}++;

}

People on the list got the email directly and the lab got a copy. If the script came up empty, everyone who'd changed anything got the mail. Apparently the lab could acknowledge an error while the build was running. When the current build.err matched the saved build.fixed-err, the pipeline reported "Error file hasn't changed. Build errors ignored."

REM Sleep 15 minutes

sleep 900

REM See if there's a build.err. If not, retry.

if "%_BuildBranch%" == "Lab01_N" goto Lab01_SpecialWork

:CheckForBuildErrors

if NOT exist %_ntbindir%\build.err goto top

for %%a in (%_ntbindir%\build.err) do if %%~za EQU 0 goto top

REM Is there a build.fixed-err? If not, page 'em.

if NOT exist %_ntbindir%\build.fixed-err goto PageBuildBreak

REM Are the build break fixed? If not, page 'em.

set ERRORS=1

for /f "delims=" %%i in ('fc %_ntbindir%\build.err %_ntbindir%\build.fixed-err') do (

if "%%i" == "FC: no differences encountered" set ERRORS=0

)

if "%ERRORS%" == "0" goto top

Every fifteen minutes tools/checkbuild.cmd compared the files. If they differed it sent "Build Break" to an email-to-pager gateway. syncbuild.cmd had a loop for running timebuild over and over, doing the sync, the build and the mail on each round. Chen remembers a four-processor Alpha doing this hourly for the shell team. Its message was "The Alpha AXP build is broken. Go fix it."

Eight hours for a complete Windows 2000 build on four processors, according to Lucovsky. Build Console 1.0 in sdktools/mtscript could spread the wait around. Its JScript service registered with remote COM. A web page could direct machines the code calls slaves. Main's x86 retail build had four distbuild machines feeding one postbuild host, Lab07's checked Itanium build had ten. A worker cleared the tree, synced on six threads, built and copied its output to the postbuild host. Then it waited for nextpass. In a sample for one depot on one machine, 13 April 2000, generating files took about six minutes, waiting for the others 48 minutes, and compiling 27 seconds. Another three hours and fourteen minutes including waits before linking was reported done. bcbuild.js knows what to tell a developer trying to publish files while the manager is busy. "Your Laptop is destoryed".

All that compiling gives you a directory full of binaries and somebody still has to turn it into CDs. postbuild.cmd reads a file called pbuild.dat. BEGIN starts a script that can run alongside the others and END waits for one to finish. To find the dependencies you read the comments. One says the catalog signer is waiting on the rule scripts, and the CD image maker waits on compression, which in turn waits on the catalog signer.

BEGIN %RazzleToolPath%\PostBuildScripts\symbolcd.cmd

; start 'bldrule' scripts first because catsign is waiting on them

; and cdimage is waiting on startcompress postcomp, which happens

; after catsign

; The 'bldrule' scripts themselves are ordered by the time

; of execution (my best guess)

BEGIN %RazzleToolPath%\PostBuildScripts\admigration.cmd

BEGIN %RazzleToolPath%\PostBuildScripts\adminpak.cmd

BEGIN %RazzleToolPath%\PostBuildScripts\inetsrv.cmd -o CABGEN

BEGIN %RazzleToolPath%\PostBuildScripts\deploytools.cmd

BEGIN %RazzleToolPath%\PostBuildScripts\wmmkdcache.cmd

There are 64 scripts in the postbuild. They compress most of the files with LZX (hence all the .dl_ and .sy_ names on the XP CD), compile catalogs of the files' hashes and sign them with a Microsoft test root the testers had to install. The real signature was a separate request. Other scripts index the symbols, put file sizes in the layout that Setup reads for its disk estimates, and assemble seven CD images from the same binaries, Home Edition through Datacenter Server. Hard links let them afford seven copies. A beta got its expiry date here, and a Microsoft Research tool obfuscated the activation files on x86. A failed script might leave its window open with "Possible error, sleeping 30 minutes" for whoever was in the lab. At the end postbuild decided it had failed if it could find the string "error:" in one log. Even writing the finish time to disk has a comment. A timestamp ending in 1 or 2 could accidentally turn its last digit into part of a redirection. They made the output descriptor explicit so they'd keep the whole time.

REM note we have to use the funny syntax for the redirect here because

REM the date time stamp ends in a number -- if that number is one or two,

REM we'd accidentally redirect the wrong way and lose a digit from our string.

REM

echo %SDTimeStamp% 1>%MyCopyDir%\BuildFinishTime.txt 2>nul

The people doing the international builds started with the US binaries with the same build number and added translated resources. Only the parts that needed compiling for a particular language got rebuilt. The postbuild readme asks you to take any new step, "multiply its execution time with 21 (7 Redmond-based languages and 14 Dublin-based languages) and assess whether its execution time is still acceptable". By XP they were doing 25 languages. On top of that there was a pseudo-localised build to exercise the translation process without doing a translation, and a mirrored one, presumably to try right-to-left layout.

How they knew a build worked

Releasing the build was reserved for official machines. localrel.cmd looked for 10 GB of free space, moved the tree into a release directory named for the build and made latest point at it. release.cmd distributed it to the release servers with remote.exe. "Remote.exe always return 6, ignore the return value". In the main lab there was also a boot-test machine for each product. autoboottest.pl reformatted its test partition and installed the new Windows unattended. A private option in winnt32 put text and GUI setup under the kernel debugger and setup's program under ntsd, so a crash in the middle of installing Windows could be examined there. autoboottest.pl also left a script in the new system's Startup folder. Whether that script ever ran was itself a test.

REM Don't create a "booted" remote any longer! It's a security hole!

REM call :LogMe "Create a remote for raiseall.pl"

REM start \%BootTestDrive\%\\tools\\remote /S \"cmd.exe\" Booted

REM If no wait, start raiseall with quality bvt

if not defined Wait (

REM BUGBUG Wait 27 minutes before we try to raise the build to give release time to complete.

sleep 1620

call :LogMe "Raiseall to BVT on all release servers"

You needed a logged-on desktop to get as far as Startup. From there the script allowed 27 minutes for the release to finish copying before asking the servers to raise the build to bvt. The celebrated build qualities are a small file in the logs and a latest link for each quality. You can read their order in the Perl script, beginning with pre, then bvt, tst, sav, idw, ids and finally idc.

my %Ordered_Qualities = ( pre => 1,

bvt => 2,

tst => 3,

sav => 4,

idw => 5,

ids => 6,

idc => 7 );

Next page | Previous page | More Lobsters | Headlines

Original: https://lr0.org/blog/p/winxp/