February 7, 2010

Changing MySQL parser code on Windows – Build breaks due to Bison

In case if you working on Windows environment for MySQL development (sometimes I use visual studio for easy debugging); and in case if you change the parser code (sql_yacc.yy) or if you are working directly from development branch (bzr launchpad), then the build breaks to generate the yacc files (sql_yacc.h and sql_yacc.cc) with an error bison: M4: Invalid argument as shown below:

1>------ Build started: Project: sql, Configuration: Debug Win32 ------
1>Generating sql_yacc.h, sql_yacc.cc
2>------ Build started: Project: GenServerSource, Configuration: Debug Win32 ------
2>Generating sql_yacc.h, sql_yacc.cc
1>bison: m4: Invalid argument
1>Project : error PRJ0019: A tool returned an error code from "Generating sql_yacc.h, sql_yacc.cc"
1>sql - 1 error(s), 0 warning(s)
2>bison: m4: Invalid argument
2>Project : error PRJ0019: A tool returned an error code from "Generating sql_yacc.h, sql_yacc.cc"
2>GenServerSource - 1 error(s), 0 warning(s)

But if use source zip file for any particular release, then it won’t fail as the files (sql_yacc.cc and sql_yacc.h) are pre-built and copied to the distribution zip file.

But, again if you wanted to change the code or happen to save sql_yacc.yy, then it starts generating the files and build will break. It looks like lot of people are experincing the same problem to build parser code on Windows using any recent version of bison (not just MySQL code base).

Both bison.exe and m4.exe are in the path and they are the latest version; but still it fails..

c:\mysql-5.1\sql>which bison
C:\Gnu\GetGnuWin32\gnuwin32\bin\bison.EXE
 
c:\mysql-5.1\sql>which m4
C:\Gnu\GetGnuWin32\gnuwin32\bin\m4.EXE
 
c:\mysql-5.1\sql>bison --version
bison (GNU Bison) 2.4.1
 
c:\mysql-5.1\sql>m4 --version
m4 (GNU M4) 1.4.13

It looks like the problem is with Windows version of bison to pick m4 executable even though m4 is in the path. For example, you can directy try to generate the files from sql directory using bison as…

c:\mysql-5.1\sql>bison -y -p MYSQL --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy
bison: m4: Invalid argument

The work around what I found is to copy m4.exe to sql directory directly, so that bison can pick from local working directory, then everything starts working as expected.

c:\mysql-5.1\sql>bison -y -p MYSQL --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy
bison: m4: Invalid argument
 
c:\mysql-5.1\sql>ls -al sql_yacc.*
-rw-rw-rw-  1 venu 0 413012 2010-02-07 11:58 sql_yacc.yy
 
c:\mysql-5.1\sql>which m4
C:\Gnu\GetGnuWin32\gnuwin32\bin\m4.EXE
 
c:\mysql-5.1\sql>copy C:\Gnu\GetGnuWin32\gnuwin32\bin\m4.EXE .
        1 file(s) copied.
 
c:\mysql-5.1\sql>which m4
c:\mysql-5.1\sql\m4.EXE
 
c:\mysql-5.1\sql>bison -y -p MYSQL --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy
 
c:\mysql-5.1\sql>ls -al sql_yacc.*
-rw-rw-rw-  1 venu 0 1510389 2010-02-07 14:33 sql_yacc.cc
-rw-rw-rw-  1 venu 0   30532 2010-02-07 14:33 sql_yacc.h
-rw-rw-rw-  1 venu 0  413012 2010-02-07 11:58 sql_yacc.yy

Kind of weired, but atleast there is a work around to change the parser code on Windows now; and it works great including Visual studio also starts building without any errors. But if you remove m4.exe from sql directory, then things starts to break immediately.

April 25, 2008

SQL Server Data Services – Software Design Review

Yesterday I attended the SQL Server Data Services – Software Design Review event in the Microsoft mountain view campus. Thanks for Ryan Dunn who accepted my invitation to attend this as this is only for selected people.

I had a real good time not only was able to understand on how SSDS is built on top of SQL Server, it was pleasure meeting few key folks like:

  • Istvan Cseri, Architect of SSDS
  • Tudaor Toma, Group Program Manager of SSDS
  • Nigel Ellis, Architect and Development Lead of SSDS
  • Ryan Dunn, Technical Evangelist for SSDS
  • and rest of the team…

Thanks for your answers for all my questions, I appreciate that. Even though I did not like the name "SQL Server Data Services" as it does not sound as good as Amazon "SimpleDB", but they already did a great ground work within a short period of time and need to see how they will take the services to the people now.

April 18, 2008

Windows Live Writer, best blogging tool

live-writer  Windows Live Writer is of the best blogging tool that I found in recent times. The tool is very convenient to write and it provides all possible options that one needs when writing a blog post. It also integrates with most popular blogging platforms like Windows Live Spaces, SharePoint, WordPress, Blogger, LiveJournal, TypePad, Moveable Type, Community Server, and more. You can also retrieve any published post and re-edit back.

As it integrates with WordPress along with supporting the categories, tagging etc; it is very convenient to post any blog entry. This is the tool that helped me to blog live when am in MySQL user conference 2008

September 23, 2007

Back to PC Laptop

Finally, am back to good and old school technology. Means, I got my new HP PC laptop nc6400 back. After fighting with Macbook Pro for last few months and the problems were never ending and most of the time the Macbook was kind of useless to my prime time production. It gets too hot within an hour of time and on and off everyday the OS hangs and needs a reboot and all my unsaved documents were lost. So, finally I have to make a change.

After I got my HP laptop from Yahoo!, reinstalled Vista on top of XP Professional and got the setup as needed. Now the things are in normal control and I can see that my productivity was increased and am am spending more time in getting the real work done rather than fighting with endless problems. Even though I still have another Macbook Pro, not sure I will spend that much time as I used to spend earlier.

April 20, 2007

Windows Home Server Installation

Today I received the beta invitation from Microsoft for Windows Home Server. I was able to download the DVD iso, but I could not find a way to directly install from the windows box; as none of the setup programs are available within the ISO files. Only option it is allowing is to reboot using the DVD.

I made a DVD using Nero, and upon booting from the DVD, it was able to load the image and then I can see that the screen with “Setup is initializing…”… but suddenly in the middle, I get the “Windows Home Server Setup Error” dialog with the message “Could not initialize UI subsystem” ..up on clicking OK…it boots back to original OS ‘Vista Ultimate’ that I had on that system. It is bit annoy, not sure if it is because of the bad DVD or corrupted files. I may retry with another image