Thursday, October 7, 2010

Clients for windows based on drizzle7-2010.09.1802 beta release for download

Not sure whether Windows binaries got any audience.
If anybody is interested in checking..
Here it is available for Download

(Just now uploaded the binaries based on beta release)
Checked on Windows XP and Windows 7.

Tuesday, October 5, 2010

New Drizzledump on Windows

AWESOME!..The new drizzledump.
great job Andrew and Team!. No more dependancy on drizzled/internal/* files.
hats off from this freelance porter.
 
I see historically how bad it was.
It was a nested web of dependency.
for sombody who ports drizzledump to windows had to make following list of files compile properly on windows.

drizzled\internal\mf_getdate.cc
drizzled\internal\my_static.cc
drizzled\internal\mf_dirname.cc
drizzled\internal\mf_format.cc
drizzled\internal\my_init.cc
drizzled\internal\mf_loadpath.cc
drizzled\internal\my_delete.cc
drizzled\memory\root.cc
drizzled\typelib.cc
drizzled\ctype-utf8.cc
drizzled\internal\my_symlink.cc
drizzled\internal\mf_pack.cc
drizzled\internal\my_thr_init.cc
drizzled\charset.cc
drizzled\error.cc
drizzled\internal\my_sync.cc
drizzled\ctype-uni.cc
drizzled\ctype-uca.cc
drizzled\ctype-simple.cc
drizzled\ctype-bin.cc
drizzled\ctype.cc
drizzled\charset-def.cc
drizzled\ctype-mb.cc
drizzled\internal\bmove_upp.cc
drizzled\internal\dtoa.cc
drizzled\internal\my_strtoll10.cc

modifing all files and linking is a hell lot of donkey work.

See the current status:
No more circus on dependancy web of code. Just a straight compilation and Linking of client\drizzledump*.cc files.

So going forward, i am expecting LCOV reporting lots of code unused and our captains keep pressing Shift+Del on more files. :)

New Standard C++ code and Boost done another magic also.
no need to stuff in any windows specific code (#ifdef blocks).
Not even a single charachter modification is requied to build it under windows!!

Tuesday, August 24, 2010

Drizzle Clients on Windows - dirzzle and drizzledump

All I have to share now is Drizzle client tools (both drizzle command line and drizzledump) for MS Windows are available for Download.
If you have time, please try it and give me feedback.
(Consider this as a temporary location for hosting the binary packages. In future, we shall move to sacred location.)


Kept postponing this post because there is a real dragon is under hatching (CoApp).
See Monty's post.
Help of those tools are required for moving forward because of our dependancy on list of libraries.
Current build is using MinGW.

All started with, Toru's question on my previous blog post. :)
Question was "Does this survive through the tests?" (libdrizzle patches on windows)
Answer is : This is the productive way I can test my libdrizzle patches for windows.

Patches for this windows build of clients are on the way to main trunk.
I am trying to keep the patches as small chunks to ensure proper review and required rework in this earlier stages itself.

Wednesday, August 4, 2010

Drizzle on Windows - Challenges ahead

Since Drizzle is Open, I am sure that one day someone will take the mantile to deepest.
As you already know, Drizzle is effectively making use of other opensource libraries available.
(Drizzle developers tell that is because they are lazy. But personally i consider that it is because they (we) are open to the environment and we respect and trust on expertise of other opensource communities)

But same philosophy works against a "builder" and "porter" on non open platform (say windows).
many of this opensource libraries need to be built on (ported???) windows.

Best example is google protobuffer itslef.
latest tarball release of protobuffer won't compile on windows.
(simple googling told me that google already corrected this issue in the branch)
But it is an alarm bell! These powerful libraries are not very well used / tested on Closed Grave yards.

I downloaded tarballs of most of the libraries on which drizzle is dependent on.
all these tarballs expect me to run ./configure and make.
!!!!(puzzled!)...in my language... "dog gets an unbroken coconut as food" (trasilated version)

I think, since windows relys on binary distributions, they are not exepcting us to "make" it.
But there are dedicated people who maintain binary versions; but getting latest version is challenge.
Mingw (Msys) team are doing an amazingly well job here.
No wonder, most of binary versions of these libraries are build on Mingw
I hope thats the way to go deeper.

Tuesday, July 27, 2010

Drizzle on Windows - Libdrizzle

lately  I started thinking from a users point of view.
Web developers want to try drizzle. but many of them got windows platform for devleopment.
So they are not able to connect to drizzle server

so started seaching for options. found that i have 3 options.
1. Native compile the source using MinGW.
2. Take the help of cygwin to get posix platform
3. Coss-compile the source from Linux to windows.

Toru, Stewart and Monty responded to my views on drizzle-discuss.
Monty was already trying on libdrizzle for sometime.
and Toru also voted for libdrizzle first.
Monty's approach was to use option 3 with option 1.
(later i realized his approach is better and smart). like:
./configure --build=x86_64-unknown-linux-gnu --host=i586-mingw32msvc

everybody voted for libdrizzle to be available for windows first.
That voting makes sence because developer in windows should be able to connect to server first.

My step was to get libdrizzle compiled using cygwin.
cygwin gives full Linux system calls in a dll. that is a very big offer for me.
i could not deny that.

as expected everything went smooth in cygwin.
libdrizzle got compiled without any effort. and i am able to verify the connectivity from windows xp box.

Next step is very challenging.
(The step to compile libdrizzle on windows natively without help of cygwin1.dll)
for a non-programmer like me it is a herculean task.
Monty's working branch (lp:~mordred/libdrizzle/mingwport)
gave a kick start because he already done all background work.

after adding few more lines to Monty's work, (drizzle.h and conn.c )
I am able to compile files from mingw

it was bit challenging to figure out that following defines are must have (i added them to common.h)
#define WINVER WindowsXP
#define _WIN32_WINNT 0x0501
(otherwise haunting, "undefined reference to `freeaddrinfo'"and undefined reference to `getaddrinfo'"" like messages will come when you try to link)

My effort is to create static library which can be linked to make executable.
since configure and make are giving me trouble on windows, i tried handweave the compilation.
to see what is happening in the make
logged all commands executed when libdrizzle is getting compiled with cygwin
$>make V=1

more over go a good guidence from:
http://www.adp-gmbh.ch/cpp/gcc/create_lib.html

Step 1. compiling the library files:
all below executed in windows command prompt.
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\drizzle.c  -o libdrizzle\libdrizzle_la-drizzle.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\conn.c  -o libdrizzle\libdrizzle_la-conn.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\conn_uds.c  -o libdrizzle\libdrizzle_la-conn_uds.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\handshake.c   -o libdrizzle\libdrizzle_la-handshake.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\command.c   -o libdrizzle\libdrizzle_la-command.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\query.c   -o libdrizzle\libdrizzle_la-query.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\result.c   -o libdrizzle\libdrizzle_la-result.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\column.c   -o libdrizzle\libdrizzle_la-column.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\row.c   -o libdrizzle\libdrizzle_la-row.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\field.c   -o libdrizzle\libdrizzle_la-field.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\pack.c   -o libdrizzle\libdrizzle_la-pack.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\state.c   -o libdrizzle\libdrizzle_la-state.o
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c libdrizzle\sha1.c   -o libdrizzle\libdrizzle_la-sha1.o

Step 2. get the poll implementation on windows
cd libdrizzle\win32
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c poll.c   -o poll.o
cd ..\..

Step 3. Create a single static library (libdrizzle.a)
"C:\MinGW\bin\ar.exe" cru libdrizzle/libdrizzle.a  libdrizzle/libdrizzle_la-drizzle.o  libdrizzle/libdrizzle_la-conn.o libdrizzle/libdrizzle_la-conn_uds.o libdrizzle/libdrizzle_la-handshake.o libdrizzle/libdrizzle_la-command.o  libdrizzle/libdrizzle_la-query.o  libdrizzle/libdrizzle_la-result.o  libdrizzle/libdrizzle_la-column.o  libdrizzle/libdrizzle_la-row.o libdrizzle/libdrizzle_la-field.o libdrizzle/libdrizzle_la-pack.o libdrizzle/libdrizzle_la-state.o libdrizzle/libdrizzle_la-sha1.o libdrizzle/win32/poll.o

Step 4. Compile user program and link to the above created library.
"C:\MinGW\bin\gcc.exe" -I. -I"C:\MinGW\include" -c examples/simple.c   -o examples/simple.o
"C:\MinGW\bin\gcc.exe" -op -o examples/simple.exe examples/simple.o  ./libdrizzle/libdrizzle.a  -lwsock32 -lws2_32
cd examples

Step 5. Test the user program.
simple.exe -d test -h 10.97.93.243 -q "select * from t1"

I want to thank you Monty for the huge help and guidance i recived.

Resolution to get my hands wet on opensource

I took a resolution month back and it is working perfect for me.
being a open source enthusiast i did not contribute to community much.
so "i should concentrate on something for atleast 1 weeks and if it is interesting, work on that in coming weeks until something materializes". that was the resolution.
this started showing me magics.


First one was that i should work on "Firefox extensions".
That was a grant success inside the company appreciations and patches started flowing.
it automates most of my tasks inside the company.
In-fact, just like any Open Source effort, here also i was trying to scratch on my itch.
later i realized, it is not only solves myown problems, but others too..
I taught me a big lesson, most of us require opensource software to solve over problems
and it works even inside a closed system like a company