user-avatar
Today is Tuesday
May 22, 2012

Category: Admin

July 27, 2009

Installing an avr cross compiler in gentoo

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

One could think that this is as easy as

crossdev avr

but it is not, so i write here how I did it for future reference, and hopefully this will also be useful to other people.

The first problem is that it does not check compatibility between toolchain members (binutils, gcc, …). Understandably, this is somehow difficult, and i don’t blame crossdev. The second problem is that by default crossdev install headers, which are needed  for libc, which is needed for gcc… and headers requires gcc… so you have a loop and if fails.

Finally, i needed the c++ part, and by default crossdev only go as far as stage 3 (plain C), so i’m asking him to go farther with ‘-s4′

Finally i did:
sudo crossdev --b 2.19.51.0.8 --g 4.4.1 --without-headers --target avr -s4

June 15, 2009

tags displayed in hg activity extension

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , 2 Comments

Today i have added a feature to my hg activity extension. I have wanted to have this for long : the tags are now displayed on the graph. Here are two examples, one of the project itself, and another one on the mercurial repository, but only  for the last months.

The first one was generated by:

hg activity --splitauthors --maxauthors 5 --width 1500 --height 900

hgactivity

And the second one by:

 hg activity --datemin 2008-01-01 --splitauthors --maxauthors 5 --width 1500 --height 900

mercurial

May 18, 2009

feedback about converting eigen2 to mercurial

by Thomas Capricelli — Categories: Admin, KDE — Tags: , , 6 Comments

This week-end we did the final conversion of the eigen2 source code repository. I shall describe here the few problems we had, as a feedback to the community.

Eigen original purpose was to help provide linear algebra for several KDE parts. As such, it was until now developed inside the KDE repository, which (still) uses subversion. Let it be clear that KDE did a wonderful job at hosting eigen repository, even though several accounts needed to be created for people who only contribute to eigen and not KDE as a whole. Eigen is getting big enough to live and release its own way , but eigen keeps very strong relationships with KDE.
Here is the script that was used for the conversion. The version of mercurial (and of the mercurial convert extension) was 1.2.1.

hg convert https://orzel@svn.kde.org/home/kde \
    --authors eigen.authors \
    --config convert.svn.tags=tags/eigen \
    --config convert.svn.branches=branches/eigen \
    --config convert.svn.trunk=trunk/kdesupport/eigen2\
    eigen.hg

We faced several problems. Fortunately all but one could be resolved patching python code. That would have been a lot more difficult using, for example, git. Speaking of git, we have found no easy way to make such a conversion, mainly because KDE repository is so huge and it seems git needs to parse the whole history of the whole repository just to convert this part. Eigen is quite small. It took mercurial two hours to convert it, almost all of which was due to network latency between my computer and KDE repository.

Bad default branch name

In mercurial, the default branch name is ‘default’ (same as ‘trunk’ on svn). If you browse a mercurial repository (using the wonderful tck/tk frontend or the web browser), each changeset is tagged with the branch name (and with every tag name is there is any). There is an exception to this, if the branch is ‘default’, nothing is displayed, as a convenience for clarity. Which is great. Using the script I present here, the convert extension would create a branch according to the name of the branches/ subdirectory, which is fine. Though the name for the main branch, the one called ‘trunk’ in svn and usually called ‘default’ in mercurial, was named ‘eigen2′ here, probably because the main directory was named this way.

I have found no way to prevent this using command line arguments. I have tried to play with the –filemap option, but failed. The final solution I used was to locally patch my mercurial (yes, I know, this is ugly):

--- /usr/lib/python2.6/site-packages/hgext/convert/subversion.py
+++ hgext/convert/subversion.py
@@ -777,6 +777,8 @@
                 branch = self.module.split("/")[-1]
                 if branch == 'trunk':
                     branch = ''
+                if branch == 'eigen2':
+                    branch = ''
             except IndexError:
                 branch = None

Bad branch used to save the tags file

In mercurial, tags are created by updating a file called ‘.hgtags’ which maps changesets (identified by their md5 sum) to a string. At the end of the conversion process, ‘hg convert’ will create such a file and check it in the mercurial repository. Unfortunately in our case, the file was not created on the right branch neither, so I also had to patch mercurial for this :

--- /usr/lib/python2.6/site-packages/hgext/convert/hg.py
+++ hgext/convert/hg.py
@@ -178,7 +178,8 @@                                                                                                   

          self.ui.status(_("updating tags\n"))                                                                       
          date = "%s 0" % int(time.mktime(time.gmtime()))                                                            
-         extra = {'branch': self.tagsbranch}                                                                        
+#         extra = {'branch': self.tagsbranch}                                                                       
+         extra = {'branch': 'default'}                                                                              
          ctx = context.memctx(self.repo, (tagparent, None), "update tags",                                          
                               [".hgtags"], getfilectx, "convert-repo", date,                                        
                               extra)

Spurious file from old history

Once the conversion was done, we noticed a file called src/Core, which should not be here. A diff with a svn checkout would confirm that this is the only difference. I have traced back the problem to a bug in svn which would allow a ‘svn copy’ to be done even if the destination name would already exist.

In our case, a directory called ‘Core’ was copied on top of the file ‘Core’. As such, the underlying file was never deleted, and mercurial kept it. Mercurial did quite well dealing with this actually.

See this wonderful commit

http://websvn.kde.org/?view=rev&revision=72256

And this is how the repository looked like just before this commit:

http://websvn.kde.org/branches/work/eigen2/src/?pathrev=72254

We could not manage to fix this problem, and we just removed the file after the conversion. Having this file would anyway not prevent using eigen2 in compilation.

It seems the bug is fixed in svn 1.6.2:  I can not reproduce this on a small test svn repository. A bug was filled for mercurial with all details, but as we cannot reproduce this behaviour on a test svn repository, this will be very difficult to solve. We for sure can not use KDE repository to test, it is far too huge for this.

Conclusion

We now have eigen2 repository on https://bitbucket.org/eigen/eigen2/ and so far everything seems ok. The repository is worth 7.3 Mb, which is perfectly honest. We can now grant or revoke write access very quickly and easily without disturbing KDE admins. And of course we also have all the wonderful advantages of DVCS.

May 7, 2009

mercurial and ipv6

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

Today I needed to use mercurial over IPv6 in order to share a repository which is on a computer behind an (ipv4) firewall, but that can be reached over ipv6.

The naive

  • hg clone ssh://orzel@ipv6computername/hg/dir
  • hg clone ssh://orzel@[ipv6::address]/hg/dir

miserably failed. But i was hinted on IRC (thanks ‘Ry4an’ !) on how to do this, and thought I should share this knowledge until mercurial get better ipv6 support.

First for the clone call, do

hg --config ui.ssh='ssh -6' clone ssh://orzel@ipv6computername

then you will not be able to push/pull until you add to the repository .hg/hgrc the lines:

[ui]
ssh=ssh -6

Enjoy mercurial on IPv6 :-)

February 21, 2009

Quest for gdc in gentoo

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: Leave a comment

It took me quite some time (and some grep) to find out how to install gdc on gentoo, so here is the answer for those facing the same problem.

gdc is a gcc font-end for the D language, which has some advantages over other ones like dmd, but don’t ask which. (something like ‘support for 64-bit’).

If you google for it, you will either find an old bug (2004) with some gdc ebuilds, or some people telling you that it’s enough to emerge gcc with the ‘d’ USE flag. Fair enough : I try, and it fails.

The reason is that without telling you, this will only work with gcc-4.1.2, I don’t why. Anyway, the following did manage to install it:

USE=”d” emerge -vta =sys-devel/gcc-4.1.2

Even this way, the build fails with some error mentionning ‘D’ and some gcc 4.3.3 symbols (4.3.3 is my current gcc). The real solution was to FIRST emerge gcc-4.1.2 without D support, and then again with D support.

Update: moreover, once installed, you cannot switch back (using gcc-config) gcc4.3.3, as ‘gdc’ will not be available at the command line anymore. As a conclusion, I’m happy not to program in D seeing the very bad support from Gentoo :-(

November 14, 2008

Mercurial bulk update

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: 6 Comments

I don’t know about you, but I have on a lot of different places a directory called ‘hg’ with lot of different mercurial clones inside. Whether on the home of my several computers for my own projects, or inside other directories for external projects, and so on.

Now, remember one important aspect of distributed source control : your clone is actually both a repository and a working directory. This is why you usually (git and others do the same) have two different commands : one to synchronize the  repository (pull) and one to update the working directory (update).

Updating comes with a risk : you can have conflicts. This is why I never update a svn repository without thinking first (do I have local modifications ?). But pulling is a lot less problematic. And, especially on my laptop, I often want to ‘sync them all’ as soon as I have some internet connection. Until now i had a script syncall with the path of all (svn,unison and) mercurial repositories hardcoded. This does not scale, and I now need that in at least 5 different places. I dont feel like maintaining such scripts.

And now comes the magic alias that made my day. I’m usually lame at shell scripting, so I’m sure there are better ways. But it works, now, on my computer. And this is so useful.

alias hgbulk '\ls */.hg -d | cut -d\/ -f1 | xargs -i bash -c  "(cd {}; hg pull )"'

(yes, I use tcsh, but i’ve tested that in bash too. Don’t ask why I use tcsh.)

November 13, 2008

Yet another activity graph : how often do you emerge ?

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

Really, I seem to be fond of activity graphs those days. I have reused part of this previous code, but this time I parse the emerge log file to display the activity of your successful emerges. Think of it as a graphical view of ‘genlop -l’.

Those examples are the emerge activity of my two main computers.

The current code does the bare minimum, and  I need to add at least command line options for

  • logfile to use (currently/default : /var/log/emerge.log)
  • filename to create (currently/default : activity.png)
  • width/height of the image (currently/default : 800×600)

The usage is straightforward:

orzel@berlioz EmergeActivity% ./EmergeActivity.py
There are 9896 emerge completed successfully
Created the file 'activity.png'
orzel@berlioz EmergeActivity% xv activity.png &

You can grab the source (browse, tarballs, mercurial clone, even RSS) from :

http://sources.freehackers.org/EmergeActivity/

November 2, 2008

Activities gallery

by Thomas Capricelli — Categories: Admin, Django, Gentoo, KDE, Linux kernel — Tags: , , , , , , , 3 Comments

While developing my recently released activity mercurial extension (and here too), I did a lot of tests on some quite famous/big projects. I’ve found the results to be quite interesting and decided to put up this gallery. Are you interested in the history of commits for kde, linux, django, portage(software), and others?

warning : this is just for fun (copyright Linus Torvalds), I’m perfectly aware that the number of commits is a very bad indicator for development.

The gallery : http://labs.freehackers.org/projects/hgactivity/wiki/Gallery

October 31, 2008

Splitted activity for mercurial

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , Leave a comment

Today I have added new options to the mercurial activity extension and  most importantly, it is now possible to have a different curve for each author. It looks like this :

October 31, 2008

Activity extension for mercurial

by Thomas Capricelli — Categories: Admin, Gentoo, KDE — Tags: , , 6 Comments

example : activity of the mercurial "crew" repository

 

example : activity of the mercurial crew repository

This is something i’ve really been missing for long in mercurial : a way to display the activity of a repository. No, ‘hg churn’ is not the right answer, I want an idea of when the peaks of development happened. So I have written this small extension. It is based on matplotlib, so you’ll need that to be installed. It is tested with mercurial 1.0.2 and the current development version of mercurial (so-called mercurial ‘crew’ repository). I’m a big fan of this kind of information, and I’m sure to use this extension regularly, so you can count on it being maintained.

To use is, grab a copy :

hg clone http://sources.freehackers.org/hgactivity/

and add a line in your ~/.hgrc under [extensions] with the full path to the activity.py (example on my computer, please adapt to your actual path:)

activity=/home/orzel/hg/hgactivity/activity.py

To use it, just do from inside a repository:

hg activity

The first example shows the activity for the mercurial.crew repository, and here’s another one representing the activity of the the ‘kdebase’ module from kde (I have a local mercurial mirror):

Activity of kdebase in the last month

Activity of kdebase during the last month

Homepage of the project: http://labs.freehackers.org/wiki/hgactivity

© 2012 Thomas Capricelli All rights reserved - Wallow theme v0.46.5 by ([][]) TwoBeers - Powered by WordPress - Have fun!