[OpenAFS] OpenAFS Windows build environment

Benjamin Kaduk kaduk@mit.edu
Mon, 13 Feb 2017 23:45:53 -0600

On Mon, Feb 13, 2017 at 10:58:28PM +0200, Kostas Liakakis wrote:
> I 've decided (again) to take the plunge and attempt to create a build
> bot slave for OpenAFS on Windows platform. We use OpenAFS on our Windows
> PC labs and would like to continue to do so.

Thank you for stepping forward to help!  It is good to have more
people who are familiar with the windows setup.  (FWIW, there is
currently a windows builder that was set up by Alejandro Sedeno
on a VM donated by MIT:
https://buildbot.openafs.org/buildslaves/win7-amd64 .  But there is
probably still value in continuing your attempts -- for one, we are
limited to only two builds at a time on that machine, and there are
potentially four that are worth doing -- only two are in the set of
builds that are triggered for each submitted change.)

> I have been following the guide found here:
> http://git.openafs.org/?p=openafs.git;a=blob;f=README-WINDOWS;h=4f9af252f51677dd49e32c4af4411bd96eed53c9;hb=HEAD
> The guide itself admits it might be a bit outdated at it really is...

Yes ... and it is not entirely sure even how outdated it is (I say,
having made the most recent overhaul to it.)

> First things first, it is stated that only VS 2005 or 2008 is supported.
> The earliest VS I can have a valid license for is 2012. And that license
> would be through our University's Microsoft Imagine (ex Dreamspark)
> subscription. As I believe the binaries produced on a buildbot aren't
> the actual ones distributed I suppose a license can be used for this
> purpose. If not, I hope somebody can give some more insight on this.

The binaries produced on the buildbots are not distributed, yes.

> But since, VS 2012 is a big step forward, for the time being I settled
> for the 90day trial of VS2008 I found available for download from MS.
> According to the guide, Secure Endpoints Inc were building distributed
> binaries using VS2008.

In my attempts (several years ago, now), I do not think I actually
succeeded in getting a build with VS2008 to work (only VS2005).  But
that was a long time ago, and my notes are incomplete, so it's hard
to be sure.

> I decided to target an AMD64 build on Windows 7 x64 for starters. Soon I
> found out that NTbuild.bat alters PATH and the equivalent of Windows
> LIBPATH. Specifically, these lines
> cause the 32bit flavors of VS compiler and libraries to be used, even if
> an AMD64 build is requested according to the guide linked above.
> The correct settings should be:
> set AFSDEV_LIB=%MSSDKDIR%\lib\x64;%MSVCDIR%\lib\amd64;
> set
> AFSDEV_BIN=%MSSDKDIR%\bin;%MSVCDIR%\bin\amd64;%PERL%\bin;%CYGWINDIR%\bin;%WIX%

It seems that at least sometimes, the historical usage has been to
have a different ntbuild.bat for each of the four combinations of
32/64-bit and debug/release builds (sometimes called free/checked).
But it probably doesn't matter which one you start off with.

> With that out of the way, the build continues up until Microsoft IDN
> APIs headers are required. For the life of me I couldn't locate any
> place where this is available. All Google links I found are a dead-end.
> Is there anybody who has a source for IDN APIs 1.1 ?

That one may be a bit harder to find.  (I don't even know what the
redistributable status of such a thing would be even if someone did
have a copy sitting around...)

> And then the next problem is that apparently WiX 2.0.5805.0 will not
> recognize VS2008 Professional and refuse to install. Some digging around
> revealed forum posts stating that WiX 2.0 is too old to support VS2008.
> But then the guide states that all newer versions WiX are a no-no...
> which leads to a chicken and egg situation...

IIRC the WiX issue is what drove me off of VS2008 in my
experimentation so long ago.

But, ultimately, our dependence on
outdated/unsupported/no-longer-available tools will become
unsustainable, and we will be forced to upgrade.  It would be better
to pay the burden of that upgrade now, when it can be done at our
leisure, than have to do it in a hurry.  So, maybe it is the time to
ignore the documented requirements and see what breaks when using a
newer WiX.  (Obviously, start off with the oldest WiX that is
compatible with the old VS2008 -- don't try to jump straight to the
latest!)  And, of course, WiX is only needed for building
installers; just compiling the code can be done without any WiX at

> Does anybody have any knowledge of what version of WiX did Secure
> Endpoints used in their builds, provided the information that they had
> been using VS2008 is correct?

I think Jeffrey has already answered that one.

If you are not doing so already, I recommend keeping a "lab
notebook" that records what tools you installed, what commands you
used to (attempt to) build, etc., which could eventually be used to
make the above README actually resemble reality.

Thanks again,