Showing posts with label dps909. Show all posts
Showing posts with label dps909. Show all posts

Monday, December 24, 2007

What Open Souce means for me ...

Andrew Smith has written a good post in the opensource@seneca planet, which has made me rethink on some floating ideas in my mind ...

It is a privilege and a great opportunity that Seneca and Mozilla have met each other and is allowing some "rock star" students (like Andrew Smith and Ben Hearshum) to shine and others to be created. We get prepared before we enter the workforce and we are forced to work in projects which are in the leading edge.
Before we get graduated, we get in touch with incredible software developers from which we can learn their techniques and ways of developing. Most of this world's software developers do not have this opportunity and being prepared before graduating is a big asset. I have few friend's from when I went to University of Malaga (where I was studying Computer Engineering) who are jealous of this course that I have taken.

During this semester I have been studying everyone I have seen and have read the blogs of rhelmer, bhearshum, shaver, pike(Axel) and others..., and tried to learn the way each one of them work and what is their part on this big project.

I have also tried to learn how these people around the globe try to manage/drive/organize different sub-communities of the Mozilla communities. People like Axel and Mic Berman have to organize a HUGE variety of different communities from different countries (since they are part of the l10n drivers) and they even have time for people like me asking silly/innocent questions and knowing that in their part of the community there is so many people that just want to get only their localization out and that's it!

It has also pushed me to move from being an "only Windows developer" to "give me any other OS and I can still develop" developer.
It has also pushed to read, read and read even more (blogs, newsgroups, mailing lists, documentation, source code, etc...) and never give up against impediments!

--------------------
The first part of this post was a "thank you" letter but I would like to get back to the initial post of Andrew Smith.

The relationship of Mozilla and Seneca creates an environment of young developers to have sympathy to Mozilla because they opened their arms to helps us become more experienced developers and braver, and this is a good way of Mozilla to be able to find some gems and get some shelved project to get resumed ... For Seneca, it is a good way to be in the spot and students to earn experience before graduating and be exposed...

The problem to this environment is that it doesn't work without students who get enrolled in college. As Andrew mentioned the number of developers in the world for Open Source are not enough and the amount of Computer Science students enrollment has been continuously dropping year by year in North America and this could affect Mozilla@Seneca if it is not already affecting it.
This could lead to reducing requirements and accepting the developers that you find (this does not just affect Open Source Software Development only) rather than the developers that are prepared.

I believe that taking the Opens Source course does NOT automatically make you "prepared" but if you are lucky it can "awaken" you as a developer as I have seen in others that took the same course with me

Thanks for reading so far since I know that the flowing of my writing on English could be a little difficult ;)

Friday, December 07, 2007

0.3.3 l10nFork final release

As Rueen and Vince have announced, they completed most of the TODOs that we had in mind for the 0.3 release and thanks to Ben's and Ted's help, I have completed the rest of the TODOs for the 0.3 but ONE (read from a file changes to be applied to an l10n tree), which right now is hard-coded :(

Anyways, I want to say that the project is ready to be evaluated since the BUG has the latest release and the WIKI page has the latest information.

The project will still continue to change since the script can grow much more but for now there will be no more updates until exam's week is done.

I would like to conclude with two last thoughts:
  1. Now that I have spent another full day with python, I can see that the learning curve is a little long but I have started to understand it and it is the best scripting languages that I have found so far (I also have to say that I have only dealt with Perl and PHP). It is really powerful, fully object-oriented and a really complete library!
  2. I believe that the Open Source courses that Seneca offers produces a new kind of open source developers; Ben is a graduated of Seneca and took this course last year, his support has been amazing and every single line he wrote about our script was something that I will fully understand and induce me to research on the right line. Others even though they tried to help (and they did help most of the time), they forget my newness in open source and my lack of knowledge of the language. PLEASE: don't misunderstand me, every single person in the IRC channel has always helped me and a lot (a lot, a lot, a lot...)- I refer to comments on Bugzilla that passed over my head and I can understand that people might not have time to be "educational" or "guide me" on their comments

Monday, December 03, 2007

l10nFork0.3.1 release and concerns

I have posted the attachment in Bugzilla (Bug403215 comment 7) and I have added this comment:
This attachment is supposed to do multiple regular expressions changes to the
DTD and the properties files of an l10n source tree

I think it will be amazing if it could create a parallel l10n tree with the
changes applied to the new regional. We want to get rid of creating .bak files

Inside the file, you can find "todo.txt", "changes.txt", "instructions.txt" and
"release.txt" with plenty of information.
And this is the help I am looking for or what I want to get done by the end of this week:
Please if someone could just give me an idea of how would they:
1) create a parallel l10n tree - (I am thinking of copying from SOURCE to
DESTINATION and then apply changes)
2) read the changes from changes.txt which contains multiple changes and
recreate the regular expressions - (I am thinking of an array with COMPILED
regular expressions and then iterate through them)
I have also asked for help to Ben Hearsum (the master in python ;) and said that he will have a look at it

Monday, November 26, 2007

Session 18 - Adding chrome to FirstXpcom extension

The lab I am doing is "Adding Chrome to FirstXpcom Lab" and it goes like this:
  • cd ~/.mozilla/firefox
  • cat profiles.ini //to find the name of your profile
  • cd 0sce3rh9.development/extensions
  • echo /home/armen/sandbox/firstxpcomchrome > firstxpcomchrome@senecac.on.ca
Once done this, you can run your minefield and you will see under Tools in red "Your localized item here" and you will see your extension in the add-on manager.
Myself, the first time didn't work and I decided to fix it. I went to the install.rdf and I saw that the line was wrong:
  • firstxpcom@senecac.on.ca First XPCOM chrome 0.1 Armen {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 2.0.0.* 3.*
Obviously, it seems that I didn't fill properly the wizard since it should say this: firstxpcomchrome@senecac.on.ca
  • Replaced the code in firstxpcomchrome/content/overlay.js with what appears on the lab
I try to make it work, to just test it but I know there are pieces missing:
Chrome file doesn't exist: /home/armen/sandbox/firstxpcomchrome/content/firstxpcomdialog.xul


  • Therefore, let us create the file : firstxpcomchrome/content/firstxpcomdialog.xul with the XUL instructions about the dialog and with JavaScript instructions

At this point, it should work but I couldn't find out what the final results were to be until I noticed a little pop up window on the right hand corner (look at the huge red arrow)

So this lab is done and all that is left is to work on the 0.3 release, the zip file is here

Sunday, November 25, 2007

0.3 roadmap - 2 weeks until the end

I want to highlight that we have some fixes that we want to do our script for the 0.3 release that we have in two weeks. I have updated the info on the wiki page related to our project.
  1. Fix the key changing problem (the regular expressions has to be more strict)
  2. Add more words to change in an l10n tree
  3. Stop using .bak files (and make the changes permanent)
  4. Generate a second l10n tree out of original with the changes
I think we can do it, but if the wind blows in our favor...

Saturday, November 17, 2007

Session 17 - Creating extension (open new tab after current tab)

This lab I am doing helps you learn how to do your first extension for Firefox.
This extension is based in a patch that makes new tabs to open after the current tab, instead of opening as the last tab.
"
this time we will overlay our changes onto the browser at runtime, and alleviate the need for any direct changes to the code. This is possible using extensions." (Dave Humphrey)

  • create this folder structure:
    • intall.rdf
    • chrome.manifest
    • chrome/
      • chrome
        • addtabeside.js
        • overlay.xul
  • Zip the content and rename the file to addtabbeside.xpi
  • Drag and drop the .xpi file into the browser or the add ons manager and install it


Please if you want to create more extensions you can read some reflections that Dave wrote about it (it mentions online wizards ) and/or use Open Komodo which has a "Mozilla extension" project template you can use.

Session 16 - XPCOM lab - retry

I am on Linux an using Gedit to create the files for the XPCOM lab:

NOTE: Substitute $(objdir) for the path to your build directory

  • mozila/extensions/firstxpcom/public/IFirstXpcom.idl
  • Generate uuid through firebot for the .idl file -> 9de38b2d-6d9e-4350-bc8a-b5330de0accf
  • mozilla/extensions/firstxpcom/Makefile.in
  • mozilla/extensions/firstxpcom/public/Makefile.in
  • mozilla/extensions/firstxpcom/src/Makefile.in
  • mozilla/extensions/firstxpcom/install.rdf
  • Add ac_add_options --enable-extensions=default,firstxpcom to .mozconfig
  • $ cd $(objdir)
    $ ../build/autoconf/make-makefile extensions/firstxpcom //to do an incremental build and create the objects in the objdir
  • $ cd $(objdir)/extensions/firstxpcom
    $ make
  • This will create the public and src directories on the obj-dir, as well as generate the Makefiles necessary in each
  • $ cd $(objdir)/extensions/firstxpcom/public
    $ make

  • As a result of this first (partially) successful run of make, exported and generated header files (i.e.,from our IDL) will be placed in $(objdir)/dist/include/firstxpcom
  • Within $(objdir)/dist/include/firstxpcom/IFirstXpcom.h you'll see the following block of code:
    #if 0
    /* Use the code below as a template for the implementation class for this interface. */
    ...
    /* End of implementation class template. */
    #endif
  • Copy and paste this implementation stub into the following file: mozilla/extensions/firstxpcom/src/FirstXpcom.cpp
  • We also have to add the Module Code (read more ) at the bottom of the CPP file and #include "nsIGenericFactory.h" and in that code we will use these macros:
    • NS_GENERIC_FACTORY_CONSTRUCTOR(FirstXpcom)
    • NS_IMPL_NSGETMODULE(FirstXpcomModule, components)
  • $ cd $(objdir)/extensions/firstxpcom
    $ make
  • I had to change this statment for the next one:
    mName.Assign(L"FirstXpcom Component");
    mName.AssignLiteral("FirstXpcom Component");
    because I was getting this errors:
    ../../../../extensions/firstxpcom/src/FirstXpcom.cpp: In constructor ‘FirstXpcom::FirstXpcom()’:
    ../../../../extensions/firstxpcom/src/FirstXpcom.cpp:28: error: no matching function for call to ‘nsString_external::Assign(const wchar_t [21])’
    ../../../dist/include/xpcom/nsStringAPI.h:124: note: candidates are: void nsAString::Assign(const nsAString&)
    ../../../dist/include/xpcom/nsStringAPI.h:128: note: void nsAString::Assign(const PRUnichar*, PRUint32)
    ../../../dist/include/xpcom/nsStringAPI.h:132: note: void nsAString::Assign(PRUnichar)
    make[2]: *** [FirstXpcom.o] Error 1
  • Assuming this works without errors, here's what has happened:

    * Generated makefiles for your project were created in extensions/firstxpcom/ (remember, we're under /mozilla/$(MOZ_OBJDIR)/.
    * Exported header files and generated header files (from IDL) in dist/include/firstxpcom/
    * Static libraries for your modules in dist/lib/ (in case other modules want to link statically instead of using XPCOM).
    * XPI file in dist/xpi-stage/firstxpcom.xpi.
    * Everything else in dist/bin/extensions/firstxpcom@senecac.on.ca
  • I try to run the Firefox and see if it gets loaded and visible in the Addon Manager but I get this message:
    "Malformed File: Minefield could not install this item because "insall.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem"
  • Ben Hearsum told me to try this: XML.com: RUWF? The XML syntax checker
    and the message I got was this:
    xml declaration not at start of external entity at line 1, column 1, byte 1:
    1.0" encoding="UTF-8"?>
    ^
  • I have been able to make, it seems to load BUT I can't see "FirstXpcom" as one of the extensions or add-ons
  • Anyway, let's continue and let's install the Extension Developer's Extension but it does not work on FF3, I have read in Rueen's blog post this:
    Problem: Can’t get the Extension Developer’s Extension to install on Firefox 3 due to extension security reasons.

    Answer: Install it in Firefox 2. Open Firefox 3. Type: about:config in the URL bar above. Right click on any Row and choose “new” then “boolean”. Now for name type: “extensions.checkUpdateSecurity” then click Ok. For value type: “false” and click Ok. Finally go to extension’s page and try to install it again. (Thanks Cesar)
  • You can skip to add to FF2, just add extensions.checkUpdateSecurity as false

  • After trying the rest of the lab I saw that I had to get the firstxpcom to be in the addons manager
  • After a while I realized that inside $(objdir)/dist/bin/extensions I had two folders I recognized "firstxpcom@senecac.on.ca" and "azambran@learn.senecac.on.ca", hehe, I know I have done something wrong
  • I went to the install.rdf and changed my email address to "firstxpcom@senecac.on.ca" since on the cpp I registered the component with "@senecac.on.ca/firstxpcom;1"
  • I delete both folders in the $(objdir)/dist/bin/extensions and $(objdir)/extensions/firstxpcom
  • $ cd $(objdir)
    $ ../build/autoconf/make-makefile extensions/firstxpcom
  • $ cd $(objdir)/extensions/firstxpcom
    $ make
  • run minefield and there we go! the firstpcom shows as one of the addons


  • Let's test the Java Script shell, Tools > Extension Developer > Javascript Shell
    • const cid = "@senecac.on.ca/firstxpcom;1"
      var obj = Components.classes[cid].createInstance()
      obj = obj.QueryInterface(Components.interfaces.IFirstXpcom) //We are QI it to IFirstXpcom...
      var sum
      sum = obj.add(4,5)
      obj.name = name
      print(obj.name)
      alert(obj.name)
Awesome, my first XPCOM component!!!

Friday, November 16, 2007

Python script - Automatic l10n string replacer - 0.2.3 release update

Our script now has been released in our wiki page, with some instructions and screenshots by Rueen.

In the other hand, we are trying to get more help on the bug on how to add make more regular expressions substitutions to a tree rather than just one change.

My personal feeling of this project is that I still don't see how this script would be used in the end but maybe someone will end up stepping in and bring some insightful ideas.

Another issue is that it should not be called TOOL, it is a scrip that would be run where an l10n source tree is and once run it would generate another l10n source tree with the changes made.

I hope this script could go really far, since it could be really useful once people would understand it.

Thursday, November 15, 2007

Session 15 - Building on Linux another nightmare

BREAKING NEWS (this has happen after this post):
----------------------------------------------------
This is what I tried to run minefield:

  • firefox -P development -no-remote //does not work
  • /home/armen/sandbox/mozilla/obj-i686-pc-linux-gnu/dist/bin/firefox -P development -no-remote //it did work
  • ./firefox -P development -no-remote //which works
Thanks Andrew

BEGINNING OF POST:
-------------------------

I have installed Virtual Box and I am running Ubuntu 7.something (Gutsy), which I got from the Freedom Toaster at Seneca. I also added the Guest Additions to have better video resolution and others.

This means that now I can build on my laptop but I gotta say that in Linux I am having more problems to build than on Windows. In Windows everything seems to be more straight forward.


I tried to check-out and I got this error message:

  • armen@armen-linux:/tmp/sandbox$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
    The program 'cvs' can be found in the following packages:
    * cvsnt
    * cvs
    Try: sudo apt-get install
    bash: cvs: command not found

Therefore I tried the suggestion:
  • sudo apt-get install cvs


Now, I have CVS installed, let's check-out:
I am trying to build and it seems that the are more problems:
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
I have tried this, since I tried to use "package" to get a package manager or something:
  • sudo apt-get install mailagent //I don't think this was necessary
The gcc version is:
  • gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

I am checking the build requirements on developers.m.o:
  • It seems that pkg-config --version is 0.22, rather than 0.9 //doesn't apply, it must be a typo or something

I just found that the whole problem is that I need the package build-essential that depends in few others and Ubuntu would always ask me for a CD. This is the way around thanks to Ben Hearsum :D

I had to comment the line:
# deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release i386
(20071016)]/ gutsy main restricted
in the file: /etc/apt/sources.
list
REMEMBER to use SUDO(root privileges) when modifying the file and when running the update:
  • sudo apt-get update
  • sudo apt-get install build-essential

At this point, I am at home, keep on trying and now on #developers Joshua and fantasai
It seems that now these packages are missing:
  • checking gtk+-2.0 >= 1.8.0 gdk-x11-2.0 glib-2.0 gobject-2.0... Not found, bla, bla
A guy in developer told me to get this:
  • sudo apt-get install libgtk2.0-dev //but it wasn't enough
  • sudo apt-get build-dep firefox
Now, I get this:
  • checking for libcurl... no
  • sudo apt-get install libcurl3-dev
Finally it seems that is working!

Mullin says to use this next time: sudo apt-cache search
libcurl

I was able to do all of this because there were some people on IRC who knew this, not because I was able to read it from developers website!

-------------------------------


I also tried to do the lab for Thursday but I had some errors on copy and pasting and when it seemes that everything actually got made, Minefield crashed saying that I had a problem with an rdf or a manifest, I can't recall.

I have downloaded the source code again and built again, but now I have a new problem, IT ALWAYS OPEN FF2 EVEN IF I CREATE A NEW PROFILE!!!!


This wouldn't be my blog if I would be able to do something at the first try :(

Wednesday, November 07, 2007

SESSION 14 - Patch for Thunderbird

Today, in class I decided to use Linux rather than Windows (since Dave insisted that was faster) and I didn't feel so uncomfortable as I thought but it seems that in the lab that the computers shut off around 6pm, therefore I lost my patch and everything.

Trying this lab: Thunderbird_Bug_Fix_Lab


Anyway, I am back here on Windows and I am checking out the source code for Thunderbird (I already have Firefox's source code in this machine).

  • make -f client.mk checkout MOZ_CO_PROJECT=mail
  • cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/mail/config/mozconfig

I will probably change the .mozconfig just for this build
. $topsrcdir/mail/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/tbird-debug
mk_add_options MOZ_CO_PROJECT=mail,calendar
ac_add_options --disable-optimize
ac_add_options --enable-debug
In class, though the time I spent discussing with the rest of class mates, I realized that I was going to fancy about how to fix the bug. I am going to try this change in this file: http://mxr.mozilla.org/mozilla/source/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp Let's move to mozilla/tbird-debug/netwerk/streamconv/converters and do a "make"
Let's run it:
  • /c/ff/mozilla/tbird/dist/bin/thunderbird.exe

My changes weren't been reflected so I try attaching VS2005 to it and it directly told me that the source file I was editing wasn't the one being executed!! I think that is amazing!

I had to build 2 folders above. Here are the links with the 2 different make's I tried:

To make the patch, from the "mozilla" folder:
  • cvs diff -u8p . > patch_td.txt

To apply the patch add it to you "mozilla" source folder and apply it like this:
  • patch -p0 < patch_td.txt

My own bug in landfill: http://landfill.bugzilla.org/bugzilla-3.0-branch/show_bug.cgi?id=6008
My own patch:
http://matrix.senecac.on.ca/~azambran/mozilla/patches/patch_td.txt
(I need somebody to review it)

Once I have attached the patch to the bug, I read this: http://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree and I have realized that I could have set a flag when doing the attachement but now I will have to cselect the "Details" of the attachment and then set the "review" flag to '?' and add the email of two class members separated by a comma, who are "reviewers"

Now it shows in the attachment a column that says this:

azambran: review? (masmullin)
azambran: review? (awdelyea)


That's it for today!

Saturday, October 20, 2007

Session 13 - the new tab lab

Now, I work at my brother's Windows XP computer and everything works fine!!

I'm trying the Dave's new tab solution,(the solution is not updated but it is illustrative), I had few looks here and there since I already tried this lab last week, I knew what to do but after this humongous number of hours in front of the computer doing Mozilla development labs, I am feeling pretty tired (I started at 11am and is 11pm)


Let's get started:

  • open the file: /c/ff/mozilla/browser/base/content/tabbrowser.xml
  • I've commented the following line and I added the rest:
    //this.mTabContainer.appendChild(t);
    // Insert tab after current tab, not at end.
    var currentTabIndex = this.mTabContainer.selectedIndex;
    this.mTabContainer.insertBefore(t, this.mTabContainer.childNodes.item(currentTabIndex + 1));
    //pay attention it is a whole tab (the next after the current one) what it gets added as the second parameter
  • I've also modified this:
    // wire up a progress listener for the new browser object.
    // var position = this.mTabContainer.childNodes.length-1;
    // the tab has been added beside the currentTab rather than the end
    var position = currentTabIndex + 1;
    var tabListener = this.mTabProgressListener(t, b, blank);
  • I did a make in the objdir parallel folder: (I chose one folder above)
    $> make /c/ff/ff-debug-/browser/base
  • Then I run minefield:
    $> /c/ff/ff-debug-/dist/bin/firefox.exe -no-remote -P development
  • and it works (well, the deletion of the tabs is kind of screwed up but no energy to think why)

Create the patch - here's the patch
  • I did it from browser/base/content - Dave's going to kick my butt
    cvs diff -u8p . > tabPatch.txt
  • Save the file into the mozilla source folder and type this:
    patch browser/base/content/tabbrowser.xml <>
  • The patch will get applied and that's it!!!

Session 8 -Modifying the Browser Lab

I'm trying to do this lab: http://zenit.senecac.on.ca/wiki/index.php/Modifying_the_Browser_Lab
but I don't have the build on the computer and trying to get through DVD or my iPod says that will take 50 minutes!!!!
I will try to use my laptop, which has the source code BUT I had so many problems trying to build on VISTA (let's try again)
  • On this file: http://mxr.mozilla.org/mozilla/source/browser/base/content/tabbrowser.xml
  • t is a XUL:tab (http://developer.mozilla.org/en/docs/XUL:tab)
    1091 var t = document.createElementNS(
    1092 ",="">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
    1093 "tab");
    1111 this.mTabContainer.appendChild(t);
  • mTabContainer is a:
     159       
    160 document.getAnonymousElementByAttribute(this, "anonid", "tabcontainer");
    161
  • Instead of appending to the end, I want to place it just beside the current tab
  • There are few ideas I have:
    • In http://developer.mozilla.org/en/docs/XUL:tabs,
      I have found selectedIndex and insertItemAt
    • this.mTabContainer.insertItemAt(this.mTabContainer.selectedIndex+1, t);


I never finished this lab, continue reading session 13

Session 10 - Download manager - incremental patch

I took some notes in class of the incremental build that Chris and Dave had and I decided to do it since I couldn't make it work the lab of modifying the behaviour of the "new tab"

  • I modified /c/ff/mozilla/toolkit/components/download/nsDownloadManager.cpp
  • Added these lines:
    nsDownloadManager::InitDB(PRBool *aDoImport)
    {
    #ifdef DEBUG_ARMEN
    printf("\n\n\n\n*************\N\NStarting Init in nsDownloadManager\n\n*****\n\n\n\n");
    #endif
  • cd /c/ff3/obj-i686-pc-mingw32/toolkit/components/download
  • export DEBUG_ARMEN
  • make

  • After a lot of work, I got tired and I got rid of #ifdef DEBUG_ARMEN
    First, my brother's account was called "Zambrano brothers", therfore, I created an account "Armen"
  • On the Mingw32 I appear as: Armen@DAVID, when before it was Zambrano brothers@DAVID
  • but #ifdef did not work either, I tried DEBUG_ARMEN and DEBUG_Armen

  • Anyways, now the changes are reflected without the #ifdef statement

Session 12 - Incremental build lab + Shaver's patch


Proffesor Humphrey's lab - Incremental Build Lab
  • cd netwerk/protocol/http/src/
  • Added these lines to nsHttp.cpp
HttpHeapAtom *
NewHeapAtom(const char *value) {
/* DEBUG_ is defined at build time, and Faculty is the username in the lab */
#ifdef DEBUG_Faculty
printf("Hello World!\n");
#endif
  • cd /c/ff/ff-debug-/netwerk/protocol/http/src/
  • make
  • cd /c/ff/mozilla/ //it's better to get your patch from the MOZILLA folder
  • time cvs diff -u8p . > patch.txt // this way people don't have to wonder where you made the changes - 2 minutes wait
  • You can find my patch here

To apply the patch, put it in your c:\ff\mozilla folder and type this:
  • patch -p0 <>
  • Because I alread had the changes, it will reply to me saying:
patching file `netwerk/protocol/http/src/nsHttp.cpp'
Reversed (or previously applied) patch detected! Assume -R? [n]

I typed "y" to revert the changes
  • After reverting if I type it again:
patching file `netwerk/protocol/http/src/nsHttp.cpp'

I also applied Shaver's patch!!!!
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|? threads/.gdb_history
|Index: threads/nsThread.cpp
|===================================================================
|RCS file: /cvsroot/mozilla/xpcom/threads/nsThread.cpp,v
|retrieving revision 1.70
|diff -u -p -5 -r1.70 nsThread.cpp
|--- threads/nsThread.cpp 11 Jul 2007 03:01:56 -0000 1.70
|+++ threads/nsThread.cpp 25 Aug 2007 15:53:36 -0000
--------------------------
File to patch:
  • It seems that I'm not in the right folder (Shaver didn't follow the suggestion of Dave's lab!!; After all, the suggestion is for learners), after thinking a little bit:
    cd xpcom/threads/
    patch -p0 --dry-run < ../../latency-tracing-patch.txt
  • But I got the same error, I move once up
    cd ..
    patch -p0 --dry-run < ../latency-tracing-patch.txt
  • It worked!!! Now without faking the patch, making and running
    patch -p0 < ../latency-tracing-patch.txt
    cd ../../ff-debug-/xpcom
    make
    ../dist/bin/firefox.exe -no-remote -ProfileManager
  • Dave said about: "Run your browser and watch for messages in stderr" but I don't what to look for
  • How do I really know if it all worked??? not sure; I don't know if the changes are running in the instance right now; I think I will find out in the next incremental lab that I will be going which affects the download manager

My personal Mozilla development status

Today, Saturday 20th of October, is the day that I'm going to do all the labs that I did not have enough time before to work on, and in which I will try once more to build on Vista, since, I know it worked in Vince's laptop and I think I never installed the Windows SDK, but, before that I will finish the incremental build lab and the extension's lab.

On Tuesday, we will celebrate our second coding party and hopefully get our 0.2 release almost done, stayed tuned!

Monday, October 15, 2007

Session 11 - MozillaBuild in Vista - nsinstall giving me problems

I deleted my whole objdir because I couldn't make it work an incremental build and now I find myself not being able to build on Vista.
What's wrong? After the weekend developing for the 0.1 release, now I can't build anymore on Vista AGAIN, could it has to do with it?
The last time I only had to "run as administrator" the msvc8.bat

Could it has to do that at some point I decided to update my source tree without checking tinderbox first?

I'm trying to understand this Bug 388543[MozillaBuild] nsinstall on vista dies due to UAC

Everytime, I try to run the make -f client.mk build, I get a different error, why?:
  • nsinstall: cannot copy c:\ff\mozilla\js\src\jsapi.h to ..\..\dist\include\js\jsapi.h: The system cannot find the file specified
  • nsinstall: cannot copy c:\ff\mozilla\nsprpub\pr\include\prbit.h to c:\ff\mozilla\objdir\dist\sdk\include\prbit.h: The system cannot find the file specified
  • nsinstall: cannot copy c:\ff\mozilla\xpcom\string\public\nsObsoleteAString.h to ..\..\..\dist\include\string\nsObsoleteAString.h: The system cannot find the file specified
  • nsinstall: cannot copy c:\ff\mozilla\nsprpub\pr\include\prclist.h to c:\ff\mozilla\objdir\dist\include\nspr\prclist.h: The system cannot find the file specified

Which has this ApplyManifesto.vbs, which I do not know what to do with it!!!:
Dim objFSO, objShell, objProc, objManifestFile
Dim strPathMozBuild, strPathMT, strPathExe, strArgs, strPathManifest

strPathMozBuild = "c:\mozilla-build"
strPathMT = "c:\Program Files\Microsoft Visual Studio 8\VC\bin\mt.exe"

'*** Nothing below this line should need to be modified

set objFSO = CreateObject("Scripting.FileSystemObject")
set objShell = CreateObject("WScript.Shell")
strPathManifest = strPathMozBuild & "\tmp.manifest"

strPathMT = Chr(34) & strPathMT & Chr(34)

AddManifestToExes strPathMozBuild & "\msys\bin"
AddManifestToExes strPathMozBuild & "\moztools\bin"
AddManifestToExes strPathMozBuild & "\moztools-180compat\bin"

Sub AddManifestToExes(byval strDirectory)
Dim fileExt
Set objFolder = objFSO.GetFolder(strDirectory)
For Each objFile In objFolder.Files
fileExt = objFSO.GetExtensionName(objFile.Path)
If fileExt = "exe" Then
AddManifest objFile
End If
Next
For Each objFolder In objFolder.SubFolders
GetFiles objFolder.Path
Next
End Sub

Sub AddManifest(oFile)
WScript.echo "Adding manifest to: " & oFile.Path
strPathExe = oFile.Path
Set objManifestFile = objFSO.CreateTextFile(strPathManifest, True)
objManifestFile.WriteLine ""
objManifestFile.WriteLine ""
objManifestFile.WriteLine " objManifestFile.WriteLine " processorArchitecture=""X86"""
objManifestFile.WriteLine " name=""" & oFile.Name & """"
objManifestFile.WriteLine " type=""win32""/>"
objManifestFile.WriteLine " "
objManifestFile.WriteLine " "
objManifestFile.WriteLine " "
objManifestFile.WriteLine " objManifestFile.WriteLine " level=""asInvoker"""
objManifestFile.WriteLine " uiAccess=""false""/>"
objManifestFile.WriteLine "
"
objManifestFile.WriteLine "
"
objManifestFile.WriteLine "
"
objManifestFile.WriteLine "
"
objManifestFile.Close

strArgs = " -outputresource:" & strPathExe & ";#1 -manifest " & strPathManifest

set objProc = objShell.Exec(strPathMT & strArgs)

Do
WScript.Sleep 100
Loop Until objProc.Status <> 0

If objProc.ExitCode <> 0 Then
WScript.Echo "EXIT CODE: " & objProc.ExitCode
WScript.Echo "ERROR: " & objProc.StdErr.ReadAll
End If

objFSO.DeleteFile(strPathManifest)
End Sub

I also tried nsinstall.manifest to put this beside C:\mozilla-build\moztools\bin\nsinstall.exe, according to this post http://wiki.mozilla.org/Penelope_Developer_Page#Windows_Vista:


processorArchitecture="X86"
name="nsinstall"
type="win32"/>


Description of your application



level="asInvoker"
uiAccess="false"/>





My .mozconfig:
#mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
. $topsrcdir/browser/config/mozconfig
# the line before sets the project as browser and enable the application
mk_add_options MOZ_MAKE_FLAGS=-j4

# Options for 'configure' (same as command-line options).
ac_add_options --enable-debug
ac_add_options --disable-static --enable-shared
ac_add_options --disable-optimize

Saturday, October 13, 2007

Experience with bugzlla

I made another post about the bugs I received because I was watching Axel (localization owner) and Dave told me that I didn't really do what he was expecting

Then I decided to add another user to watch, since I had only few bugs. I chose Ted (luser in IRC) who came to give a speech and after two days I realized I chose the wrong one; do you know why? Because I got 130+ bugs notifications in two days :P - How does he manage them? I really don't know

I've also understood now the concept of voting, which allows the users to vote for the bugs they think are more important to get fixed

I've also learned that you can save certain searches like the blocking bugs

I'm thinking that I haven't found a way to see which bugs I'm subscribed to or to see which bugs have filled others (let's say the use I want to watch) or to find users to follow (as it was mentioned in class). I have to bookmark them or use a filter on Thunderbird to direct them to a folder and then look email per email

It is insane to handle so many bugs and to receive so many emails, an interface like facebook that gives you more control on what things you are subscribed to (groups in the case of facebook), the notifications (types and frequency) of bugs activity and a long etcetera

Bugzilla won't change since it is too much work to redesign it and all the developers that have been using it for years have found many ways around to get the job just done.

Regular Expressions

"In your face regular expressions!" (shaking head)
"I don't care how many hours I spent but I defeated you"
Before our code will ruin every DTD since it would change the entity name and the value, when we only want to change the values of each entity that matches the pattern
import re

print "BEGIN"
instring = 'colorsDialog.title "asdColors">\ncolorsDialog.title "Link Colors">'
# usinf Python's raw reg exp
newstring = re.sub(r'(".*)([Cc])olor', r'\1\2olour', instring)
wrongstring = re.sub(r'([Cc])olor', r'\1olour', instring)

print instring
print newstring
print wronstring
print "END"

l10n-merge tool update

This last Friday for around six hours three fellows were trying to figure out "what are we trying to write" and on Saturday we said "man, we have something!"
In the first few hours we went over emails, python samples, etc... and then after dinner we coded a python code that reads the .dtd files from the current folder makes a regular expression substitution:
re.sub(r'([Cc])olor', r'\1olour', instring)
and saves the file with a extension .bak with the changes made

The features we want to add are:
  • More regular expressions substitutions!
    • >> color(s) -> colour(s) -- re.sub(r'([Cc])olor', r'\1olour', instring)
      >> dialogue -> dialog -- re.sub(r'([Dd])ialogue', r'\1ialog', instring)
      >> Go forward -> Go forwards -- ??, etc
      >> Minimize -> Minimise
      >> Center -> Centre
      >> Organize -> Organise
      >> Customize -> Customise
  • Read the regular expression substitutions from a file and apply them
  • Go recursively into folders with .dtd and .properties files and make the changes there too, rather than just the current folder
  • Give two parameters: where to read from and where to write the changed source - this will require a parallel creation

Thursday, October 11, 2007

Session 9 - what does it take to start again on Vista?

NOTE=I've skipped session 8 until I have the lab done

Well, I wanted to do the lab that my professor told us to do (Modify the browser ) and I normally bring a hard drive with my source and build there so I can pour into the class' computer but I forgot it!!

I had three options:
  • Build on the PC from the lab (get the source code again and build), but this required too much time!!
  • Get the source code and the build from somebody else, I tried to get it by using my iPod (the transfer said that it would take 50 miuntes!!) and through a DVD (which was only finalized by the end of the class)
  • Or just work on the research that required the lab (which I did and I got the answer but couldn't test it)

Afterwards, I got angry and I said: why other people have been able to build on Vista and not me?????

It was over, I had to tackle this and stop building at my brother's computer or on the borrowed mac!!!
"Today, I should have the minefield build running on my laptop (which uses Vista)!!"

  • I deleted the whole source code
  • I ran the environment as administrator (right click on msvc8.bat and "run as administrator")
  • I got it again
  • new .mozconfig
  • build a debug-build
  • and voila!!!!
    • real 232m57.500s (232/60=3h52min)
      user 4m56.726s
      sys 13m46.088s
    • this long time might be that I had something running wrong on Vista, since the CPU wasn't being used more than 10%. I closed some programs and killed some processed and it seemed to go faster, but I did this almost like 3 hours and half after started
    • TODO - Research on how to take advantage of my dual core and build below 60 minutes
  • I run this:
    $> ../obj-i686-pc-mingw32/dist/bin/firefox.exe -no-remote -ProfileManager
    and did not run properly
  • The I run this:
    $> export XPCOM_DEBUG_BREAK=warn
    $> ../obj-i686-pc-mingw32/dist/bin/firefox.exe -no-remote -ProfileManager
    It run but it looked like this:

  • pretty empty, isn't?
  • Look at this screenshots of the errors I saw behind the screen (it shows Leaks or something):
  • Then I did this:
    $> obj-i686-pc-mingw32/dist/bin/firefox.exe -no-remote -ProfileManager > afterRun.log
    The contents below:
  • ++WEBSHELL 014192F8 == 1
    ++DOMWINDOW == 1
    ++DOMWINDOW == 2
    --WEBSHELL 014192F8 == 0
    --DOMWINDOW == 1
    --DOMWINDOW == 0
    nsStringStats
    => mAllocCount: 7042
    => mReallocCount: 636
    => mFreeCount: 7042
    => mShareCount: 6015
    => mAdoptCount: 1380
    => mAdoptFreeCount: 1380
    ++WEBSHELL 02FD6008 == 1
    ++DOMWINDOW == 1
    ************************************************************
    * Call to xpconnect wrapped JSObject produced this error: *
    [Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame :: file:///c:/ff3/obj-i686-pc-mingw32/dist/bin/components/nsBrowserGlue.js :: bg__initPlaces :: line 297" data: no]
    ************************************************************
    ++DOMWINDOW == 2
    ++WEBSHELL 04519E00 == 2
    ++DOMWINDOW == 3
    ++DOMWINDOW == 4
    ++WEBSHELL 06478C18 == 3
    ++DOMWINDOW == 5
    ++DOMWINDOW == 6
    --WEBSHELL 02FD6008 == 2
    --WEBSHELL 04519E00 == 1
    --WEBSHELL 06478C18 == 0
    --DOMWINDOW == 5
    --DOMWINDOW == 4
    --DOMWINDOW == 3
    --DOMWINDOW == 2
    nsStringStats
    => mAllocCount: 16815
    => mReallocCount: 2957
    => mFreeCount: 16092 -- LEAKED 723 !!!
    => mShareCount: 14500
    => mAdoptCount: 2038
    => mAdoptFreeCount: 2024 -- LEAKED 14 !!!
  • I still had the weird leaks and the weird run of minefield, which would still work

  • Let's CREATE A NEW PROFILE
  • It works!!!!!
    But I have to raise some things I realized:
    • When I run the corrupted profile, I get these leaks:
      => mFreeCount: 15663 -- LEAKED 666 !!!
      => mShareCount: 14267
      => mAdoptCount: 2003
      => mAdoptFreeCount: 1989 -- LEAKED 14 !!
    • The first time I run a just create a profile and use it:
      It asks me twice for a profile to select and the warnings dialog boxes appeared as if I didn't call export XPCOM_DEBUG_BREAK=warn

I hope you enjoyed this post and my next adventure would be to add that patch that I have to create for the lab; See you soon!