Closed Bug 427724 Opened 16 years ago Closed 15 years ago

Multiple problems running windows 64 bit msys builds

Categories

(Firefox Build System :: MozillaBuild, task)

x86
Windows Server 2003
task
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 415100

People

(Reporter: rkent, Unassigned)

References

Details

start-msvc8.bat with Visual C++ 2005 Express Edition on Windows 2003 Server 64 bit version fails to find the installation directory because the registry key is incorrect. In guess-msvc.bat, the key is shown as:

MSVC8EXPRESSKEY=HKLM\SOFTWARE\Microsoft\VCExpress\8.0\Setup\VC

But there is no key there. The actual key location is at:

MSVC8EXPRESSKEY=HKLM\SOFTWARE\Wow6432Node\Microsoft\VCExpress\8.0\Setup\VC

The key location is correct for 32 bit versions of Windows 2003 Server.
Does it work if you run from a 32-bit command shell?
Component: Build Config → MozillaBuild
Product: Core → mozilla.org
QA Contact: build-config → mozillabuild
Version: Trunk → other
Yes that does work for getting the directory for VCExpress (I didn't even know there was a 32 bit cmd.exe until you asked). Unfortunately I am having all kinds of bizarre problems in addition to this one. One is probably safe to report: the new Vista SDK installs are version 6.1, not 6.0 as expected by guess-msvc.bat

The bizarre behavior is incorrect processing of environment variables in the .bat files. It's acting like it can't define any more variables, so if I add at a certain point in start-msvc8.bat:

set garbage=1
echo %garbage%

then nothing is there. Maybe my Windows installation is hosed. I'm trying a fresh install on a VMware virtual machine to test.
OK I've finally sorted out my bizarre problem. It's actually quite funny if you look at it with a sense of humor. I kept running the start-msvc8.bat file with parameters set correctly to work in the 64 bit environment, but every time I ran it I got this error message: "\Microsoft was unexpected at this time"  Nothing I could do would get rid of it. I was beginning to suspect that some Mozilla Linux hacker had added some clever hack to spite Microsoft. Finally I was able to figure out that the problem was coming from lines like this:

@set DevEnvDir=c:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE

Earlier similar examples were getting set just fine. What is the difference? It's the if statement. So this short little CMD.exe batch file shows the problem:

rem demo of MS bug
set GOODSET=C:\Program Files (x86)\IAMGOOD
If 0==0 (
  set BADSET=c:\Program Files (x86)\IAMBAD
)

The GOODSET works, the BADSET gives the error "\IAMBAD was unexpected at this time" This behavior is only related to the 64 bit environment because of the (x86) in the path names.

I'm going to broaden the summary of this bug to include all of the various issues associated with getting x64 version of Windows 2003 (and I suspect it also applies to XP 64 bit) working with the build environment. This little cmd.exe bug is the second of multiple issues. I'll also confirm it since I have now seen the problem on several different installations.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Registry key for VC8 Express on 64 bit installs incorrect → Multiple problems running windows 64 bit msys builds
While 64 bit Windows 2003 Server is probably an unusual build environment, Vista 64 bit probably is not. I can confirm that 64 bit installs of Vista have both these "c:\Program Files (x86)" directories, plus the cmd.exe bug shown in comment 3 also exists. So I suspect you will need to fix this to support Vista.

The parentheses in the command files are not necessary for functionality. I was able to modify the standard start-msvc8.bat to use goto's instead (yes, I know, we moved beyond that decades ago, but heh I used to be a FORTRAN programmer so I still remember how to use them!)

So for the record, I am able to successfully compile Thunderbird on Windows 2003 Server 64 bit with the following setup:

1) Install Visual Studio 2005 C++ Express (I used the .iso file), default options except do not install SQL server part.
2) Install  "SDK for WIndows Server 2008 and .NET Framework 3.5" with default options. I installed using the .iso file.
3) Move the directory Include/atl found in the 2003 SDK version to the equivalent location in the 2008 SDK
4) Install mozillabuild version 1.2
5) Apply the patch to guess-msvc.bat suggested in https://bugzilla.mozilla.org/attachment.cgi?id=312010 to allow version 6.1 of the SDK to be detected
6) Modify start-msvc8.bat to use goto's instead of parentheses for program control.
7) Run the SysWOW64 version of cmd.exe to start the modified version of start-msvc8.bat

Following the setup described in comment 4, plus modifying msys as suggested in bug 415100, I was able to get msys to function in a 64 bit installation of Vista, and start a debug compile of Thunderbird. However, early in the build process, it died with the following output:

make[5]: Leaving directory `/D20080409/mozilla/tb-debug/config/mkdepend'
rm -f nfspwd
cp /D20080409/mozilla/config/nfspwd.pl nfspwd
chmod +x nfspwd
rm -f revdepth
cp /D20080409/mozilla/config/revdepth.pl revdepth
chmod +x revdepth
/c/mozilla-build/moztools/bin/nsinstall -m 644 ../mozilla-config.h /D20080409/mozilla/config/nsStaticComponents.h  ../dist/include
make[4]: execvp: /c/mozilla-build/moztools/bin/nsinstall: Bad file number
make[4]: *** [export] Error 127
make[4]: Leaving directory `/D20080409/mozilla/tb-debug/config'
make[3]: *** [export_tier_base] Error 2
make[3]: Leaving directory `/D20080409/mozilla/tb-debug'
make[2]: *** [tier_base] Error 2
make[2]: Leaving directory `/D20080409/mozilla/tb-debug'
make[1]: *** [default] Error 2

At this point, since I don't need Vista 64 to accomplish my goals, I'm going to drop further investigation. But I leave this here for future wanderers who may be able to take the next step.
To the best of my knowledge that's Vista deciding It Knows Better Than You and requiring that nsinstall only be runnable if you elevate privileges when doing so, and msys doesn't have any idea how to do that.  This problem also shows up with patch (!) as well.  I hacked around it with a privilege-elevation wrapper script, dunno what anyone else does or how anyone developer-y can stand to use Vista without quickly going insane and without writing wrappers.
(In reply to comment #6)
> To the best of my knowledge that's Vista deciding It Knows Better Than You and
> requiring that nsinstall only be runnable if you elevate privileges when doing
> so, and msys doesn't have any idea how to do that.  This problem also shows up
> with patch (!) as well.  I hacked around it with a privilege-elevation wrapper
> script, dunno what anyone else does or how anyone developer-y can stand to use
> Vista without quickly going insane and without writing wrappers.

FTR, this is fixed by either adding a manifest (done in mozillabuild 1.3), or disabling auto-detection of installers without a manifest.
I fixed the start scripts in another bug. The MSYS bits I'm going to fix in bug 415100.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.