Troubleshooting Building MariaDB 5.1 on Windows

This is a follow-up, troubleshooting article that goes hand-in-hand with my “Building MariaDB 5.1 on Windows Revisited” post, and covers some problems and their solutions that one might encounter when attempting to build MariaDB from source code on Microsoft Windows.

The first error I ran into was this, on my main compile step (i.e., the 2nd cmake command):

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp
Common.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
[C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj]

That in itself doesn’t tell us too much. Searching the full compile output, we find:

Generating ../../scripts/mysql_fix_privilege_tables.sql
The system cannot find the file specified.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp
Common.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
[C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj]
Done Building Project
"C:\mysql\mariadb-5.1.67\bld\scripts\GenFixPrivs.vcxproj" (default targets)
 -- FAILED.

Thus, there is a path issue. In this case, I had created a directory named “bld” within mysql-5.1.67/ and was attempting to build (and run cmake) there. After seeing this error, I deleted bld/ and just compiled in the main dir.

This helped things progress further on the next compile.

However, while it progressed further, I encountered a new set of errors:

"C:\mysql\mariadb-5.1.67\package.vcxproj" (default target) (1) ->
(PostBuildEvent target) ->
  EXEC : CPack error : Cannot find NSIS compiler makensis:
    likely it is not installed, or not in your PATH
    [C:\mysql\mariadb-5.1.67\package.vcxproj]
  EXEC : CPack error : Could not read NSIS registry value.
    This is usually caused by NSIS not being installed. Please install NSIS
    from http://nsis.sourceforge.net [C:\mysql\mariadb-5.1.67\package.vcxproj]
  EXEC : CPack error : Cannot initialize the generator NSIS
    [C:\mysql\mariadb-5.1.67\package.vcxproj]
  ...
    17 Warning(s)
    4 Error(s)

These seem related to NSIS, and so I’ll follow the note from the error message: Please install NSIS from http://nsis.sourceforge.net

Thus I downloaded NSIS and installed it (since I didn’t already have it installed). I then re-ran the 2nd cmake command, and it progressed further than before.

However, I was still not out of the woods yet. This time it produced:

  CPack: Create package using NSIS
  CPack: Install projects
  CPack: - Install project: MySql
  CPack: -   Install component: Unspecified
  CPack: -   Install component: headers
  CPack: -   Install component: mysqltest
  CPack: -   Install component: runtime
  CPack: -   Install component: scripts
  CPack: -   Install component: sqlbench
  CPack: Create package
EXEC : CPack error : Problem running NSIS command:
  "C:/Program Files (x86)/NSIS/makensis.exe"
  "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
  Please check C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/NSISOutput.log
  for errors
EXEC : CPack error : Problem compressing the directory
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
EXEC : CPack error : Error when generating package: MariaDB
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
...
Done Building Project "C:\mysql\mariadb-5.1.67\package.vcxproj" (default targets)
 -- FAILED.
Build FAILED.

    0 Warning(s)
    4 Error(s)

Upon examining the above, we see the main error is:

EXEC : CPack error : Problem running NSIS command:
  "C:/Program Files (x86)/NSIS/makensis.exe"
  "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
  [C:\mysql\mariadb-5.1.67\package.vcxproj]
  Please check C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/NSISOutput.log
  for errors

I checked the log it mentions to see what is going on, and the last 2 lines of NSISOutput.log say:

!macro: macro named "RemoveSection" already found!
Error in script "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
on line 134 -- aborting creation process

Re-looked at error, which says “Problem running NSIS command …”

Thus I tried to run said command, exactly as-is, to see if it runs and/or what it reports:

C:\> "C:/Program Files (x86)/NSIS/makensis.exe" "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"

Output is basically identical to that in NSISOutput.log, aside from 2 comments at the very beginning of NSISOutput.log (which shows the command run). The last 2 lines are (shown in ‘red’ in my terminal):

!macro: macro named "RemoveSection" already found!
Error in script "C:/mysql/mariadb-5.1.67/_CPack_Packages/win32/NSIS/project.nsi"
on line 134 -- aborting creation process

So what is this “RemoveSection”? Need to check project.nsi on line 134.

Searched the file, is only there once, so not sure where else it is coming from (i.e., how it is “already found!”).

So I decided to Google: “macro named “RemoveSection” already found”

1st result, bingo! Known bug!

“0013202: CPack fails with latest prerelease NSIS”

http://public.kitware.com/Bug/view.php?id=13202

Bug says, “Fixed in Version CMake 2.8.11″, so I checked my cmake version:

C:\>cmake –version
cmake version 2.8.10.2

Thus it is an affected version of cmake, therefore I need to upgrade cmake.

I downloaded the latest cmake, 2.8.11.1, and then upgraded it:

C:\Windows\system32>cmake --version
cmake version 2.8.11.1

So now re-run cmake command again:

cmake --build . --config relwithdebinfo --target package

Worked!!!!!!!

Build succeeded.
    0 Warning(s)
    0 Error(s)

Hope this helps. :)

 

Related Build Links:

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

One Response to “Troubleshooting Building MariaDB 5.1 on Windows”

  1. Wlad says:

    It is not going to help people who are trying to build MariaDB from source, because the only person who is trying to build 5.1 from source is you:)

    Everyone else is on 5.5 . Seriously :)


Period Panties by Period Panteez Menstrual Underwear Menstruation PMS Panty