Bug #58411 wixca project fails to build when using Express Edition of VS
Submitted: 23 Nov 2010 7:07 Modified: 6 Jan 2011 15:17
Reporter: Santo Leto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.5-bzr OS:Microsoft Windows (7 64-bit)
Assigned to: Vladislav Vaintroub
Tags: afxres.h, CustomAction.rc, RC1015, wix, wixca.vcxproj
Triage: Triaged: D4 (Minor) / R1 (None/Negligible) / E1 (None/Negligible)

[23 Nov 2010 7:07] Santo Leto
Description:
When using VS Express, a fatal error occurs when building the project wixca. 

Investigating compilation logs, it's possible to understand that the error is in the file CustomAction.rc, and it's caused by the fact that include file afxres.h is not found.

Content of the file wixca.log under packaging\WiX\ca\wixca.dir\RelWithDebInfo:

Build started 23/11/2010 06:20:46.
     1>Project "D:\Santo_Local\mysql-source\mysql-5.5-build1\packaging\WiX\ca\wixca.vcxproj" on node 3 (build target(s)).
     1>InitializeBuildStatus:
         Touching "wixca.dir\RelWithDebInfo\wixca.unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
       ClCompile:
         All outputs are up-to-date.
       ResourceCompile:
         C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /l"0x0409" /I"D:/Santo_Local/mysql-source/mysql-5.5-build1/include" /I"C:/Program Files (x86)/Windows Installer XML v3/bin/../SDK/inc" /nologo /fo"wixca.dir\RelWithDebInfo\CustomAction.res" CustomAction.rc 
     1>CustomAction.rc(1): fatal error RC1015: cannot open include file 'afxres.h'.
         
     1>Done Building Project "D:\Santo_Local\mysql-source\mysql-5.5-build1\packaging\WiX\ca\wixca.vcxproj" (build target(s)) -- FAILED.

Build FAILED.

Time Elapsed 00:00:01.63

How to repeat:
- make sure you have the WiX tool installed and on your path
- execute:
  cmake -DBUILD_CONFIG=mysql_release -G "Visual Studio 10" -DSIGNCODE=0 
  [please note that option -DSIGNCODE=0 is needed as workaround of Bug #58313 - in general you don't need to use this option]
- make sure the output of the previous command do not contain the line "-- Cannot find wix 3, installer project will not be generated""  
- execute:  
  vcexpress MySql.sln /build RelWithDebInfo /project package /out mysql-5.5-build1.txt
  [please note that option /out is used just to write the compilation log to a file]

Suggested fix:
If possible, please replace "afxres.h" with "windows.h" in packaging\WiX\ca\CustomAction.rc (please also make sure that no regressions are created after this change).

Before the fix:

1>------ Build started: Project: ZERO_CHECK, Configuration: RelWithDebInfo Win32 ------
2>------ Build started: Project: GenServerSource, Configuration: RelWithDebInfo Win32 ------
3>------ Build started: Project: gen_versioninfo, Configuration: RelWithDebInfo Win32 ------
4>------ Build started: Project: wixca, Configuration: RelWithDebInfo Win32 ------
4>CustomAction.rc(1): fatal error RC1015: cannot open include file 'afxres.h'.
4>  
5>------ Build started: Project: ALL_BUILD, Configuration: RelWithDebInfo Win32 ------
6>------ Build started: Project: PACKAGE, Configuration: RelWithDebInfo Win32 ------
6>  CPack: Create package using ZIP
6>  CPack: Install projects
6>  CPack: - Install project: MySQL
6>  CPack: Compress package
6>  CPack: Finalize package
6>  CPack: Package D:/Santo_Local/mysql-source/mysql-5.5-build1/mysql-5.5.7-rc-win32.zip generated.
========== Build: 5 succeeded, 1 failed, 88 up-to-date, 0 skipped ==========

After the fix:

1>------ Build started: Project: ZERO_CHECK, Configuration: RelWithDebInfo Win32 ------
2>------ Build started: Project: gen_versioninfo, Configuration: RelWithDebInfo Win32 ------
3>------ Build started: Project: wixca, Configuration: RelWithDebInfo Win32 ------
3>     Creating library D:/Santo_Local/mysql-source/mysql-5.5-build1/packaging/WiX/ca/RelWithDebInfo/wixca.lib and object D:/Santo_Local/mysql-source/mysql-5.5-build1/packaging/WiX/ca/RelWithDebInfo/wixca.exp
3>     Creating library D:/Santo_Local/mysql-source/mysql-5.5-build1/packaging/WiX/ca/RelWithDebInfo/wixca.lib and object D:/Santo_Local/mysql-source/mysql-5.5-build1/packaging/WiX/ca/RelWithDebInfo/wixca.exp
3>  wixca.vcxproj -> D:\Santo_Local\mysql-source\mysql-5.5-build1\packaging\WiX\ca\RelWithDebInfo\wixca.dll
4>------ Build started: Project: ALL_BUILD, Configuration: RelWithDebInfo Win32 ------
5>------ Build started: Project: PACKAGE, Configuration: RelWithDebInfo Win32 ------
5>  CPack: Create package using ZIP
5>  CPack: Install projects
5>  CPack: - Install project: MySQL
5>  CPack: Compress package
5>  CPack: Finalize package
5>  CPack: Package D:/Santo_Local/mysql-source/mysql-5.5-build1/mysql-5.5.7-rc-win32.zip generated.
========== Build: 5 succeeded, 0 failed, 89 up-to-date, 0 skipped ==========

Note:
After changing "afxres.h" with "windows.h", the windows installer package is correctly created as well. If we execute:

vcexpress MySql.sln /build RelWithDebInfo /project msi /out mysql-5.5-build1.txt

we get:

1>------ Build started: Project: ZERO_CHECK, Configuration: RelWithDebInfo Win32 ------
2>------ Build started: Project: MSI, Configuration: RelWithDebInfo Win32 ------
2>  Microsoft (R) Windows Installer Xml Compiler version 3.0.5419.0
2>  
2>  Copyright (C) Microsoft Corporation. All rights reserved.
2>  
2>  
2>  
2>  mysql_server.wxs
2>  
2>  Microsoft (R) Windows Installer Xml Linker version 3.0.5419.0
2>  
2>  Copyright (C) Microsoft Corporation. All rights reserved.
2>  
2>  
2>  
2>  Building Custom Rule D:/Santo_Local/mysql-source/mysql-5.5-build1/packaging/WiX/CMakeLists.txt
2>  CMake does not need to re-run because D:\Santo_Local\mysql-source\mysql-5.5-build1\packaging\WiX\CMakeFiles\generate.stamp is up-to-date.
========== Build: 2 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
[24 Nov 2010 20:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/124931

3139 Vladislav Vaintroub	2010-11-24
      Bug #58411 :wixca project fails to build when using Express Edition of VS:
      
      The problem was MFC header file includes into the resource definition file (CustomAction.rc)
      afxres.h is not available with VS Express.
      
      The fix is to remove resource file from compilation and souce code repository. version of
      custom action dll is of no interest for anyone, it is internal dll kept inside the MSI.
[5 Dec 2010 12:43] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[14 Dec 2010 0:14] Paul Dubois
Bug is not present in any released 5.6.x version.
[17 Dec 2010 12:53] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:georgi.kodinov@oracle.com-20101217124733-p1ivu6higouawv8l) (version source revid:azundris@sun.com-20101125051437-3pavhs14p7zhks0c) (merge vers: 5.5.8) (pib:24)
[6 Jan 2011 15:17] Paul Dubois
Noted in 5.5.9 changelog.

If MySQL was built with Visual Studio Express, the project wixca was not built.