[Preview/RFC] win32 fake symlinks

Alexander Belchenko bialix at ukr.net
Sat Nov 3 10:56:38 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This patch contains working implementation of fake symlinks for windows,
but it's not ready to merge to bzr.dev because I'd like to have merged
this patch first:
http://bundlebuggy.aaronbentley.com/request/%3C47270725.40004@ukr.net%3E
and another big blocker is performance.

Here the link to discussion 1.5 year ago about fake symlinks:
https://lists.ubuntu.com/archives/bazaar/2006q2/012220.html

Since then my understanding of win32 fake symlinks supports is not changed.

1) We should have support for fake symlinks in the core, because bug reports about symlinks on
Windows arise quite regularly. Although I was wrong when I said that I can't fix my win32symlinks
plugin to make it works with recent bzr 0.9x series, I don't want to backport my improvements to
that plugin.

2) I provide fake symlinks in format that understand Cygwin. So people who like to run bzr.exe on
Cygwin should be happy. Though Cygwin itself creates links (with ln -s) as windows shortcuts, that
have extra '.lnk' extension. No support for such shortcuts is provided because I concerned about
speed. So if you need to create fake symlinks either on pure Windows or on Cygwin I provide new
hidden command 'symlink', as equivalent to 'ln -s TARGET NAME'.

3) To allow bzr using fake symlinks on win32 I monkeypatching os module. I'm hardly convinced that
monkeypatching here is right thing, because no-one Linux developer will care to use
osutils.[symlink|readlink|lstat] instead of os.[symlink|readlink|lstat]. And I don't want forever go
behind you guys as street-cleaner an fix all places where you write win32-incompatible code.

About speed.

The most important part of symlinks support is patching os.lstat function
(win32utils.lstat_fake_symlink). Currently I have pure python implementation, and as expected it
slower for big trees.
But actual numbers for win2k+IDE disk and winxp+SATA disk is very different (even though machines is
quite similar: both are Celeron 1.7GHz, 512MB RAM).

For win2k+IDE: bench_osutils.WalkDirsBenchmark.test_walkdirs_kernel_like_tree bencmark show ~80%
slower result (1343ms vs. 2469ms).

But for winxp+SATA difference is much smaller: 1296ms vs. 1483ms (~15%).

Anyway I think that I need writing C-extension for lstat_fake_symlink.

Alexander.




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHLFPmzYr338mxwCURAsUaAJ93dtCGyN6EJ1fBhT2OkA3+YHoXzgCcC6ak
T9LGZR5UhdxB0tOJyXslW7Y=
=XO8e
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bzr-mail-kkhcki.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20071103/6b3bb8bc/attachment-0001.diff 


More information about the bazaar mailing list