Branches with symlinks can't be checked out on Windows
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Bazaar |
High
|
Parth Malwankar | ||
| | Breezy |
Medium
|
Unassigned | ||
Bug Description
Windows does not support symlinks but there is a plugin for bzr that emulates this behavior. If the plugin is installed then this works. I think this should be a core feature of bzr and not a plugin. Also displaying a stack trace is not a useful error message for the user so even if it is decided to keep it as a plugin this is not the correct behavior. When checking out a branch that uses symlinks on Windows the following exception is raised:
bzr branch http://
.......
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
AttributeError: 'module' object has no attribute 'symlink'
bzr 0.13.0candidate1 on python 2.4.4.final.0 (win32)
arguments: ['c:\\Programme
** please send this report to <email address hidden>
nia@client0055 /d
$ bzr version
Bazaar (bzr) 0.13.0candidate1
Using python interpreter: c:\Programme\
Using python standard library: c:\Programme\
Using bzrlib: c:\Programme\
Related branches
- Martin Packman (community): Needs Fixing on 2012-02-26
- bzr-core: Pending requested 2012-02-20
-
Diff: 472 lines (+197/-62)11 files modifiedbzrlib/commit.py (+12/-6)
bzrlib/delta.py (+7/-3)
bzrlib/diff.py (+4/-0)
bzrlib/errors.py (+0/-15)
bzrlib/mutabletree.py (+25/-7)
bzrlib/tests/test_commit.py (+31/-0)
bzrlib/tests/test_errors.py (+0/-14)
bzrlib/tests/test_transform.py (+61/-11)
bzrlib/tests/test_workingtree.py (+35/-0)
bzrlib/transform.py (+17/-6)
doc/en/release-notes/bzr-2.6.txt (+5/-0)
| Jelmer Vernooij (jelmer) wrote : Re: [Bug 81689] Branches with symlinks can't be created on Windows | #1 |
| Changed in bzr: | |
| status: | Unconfirmed → Confirmed |
| Changed in bzr: | |
| assignee: | nobody → bialix |
| importance: | Undecided → Medium |
| Changed in bzr: | |
| assignee: | bialix → nobody |
| Changed in bzr: | |
| importance: | Medium → High |
| Alexander Belchenko (bialix) wrote : | #2 |
Workaround for this bug (report clear error instead of traceback) was merged to bzr.dev as revno.3020.
About core support of fake symlink on Windows: pure python implementation is ready but walkdirs almost 80% slower on FAT32 with it. I have idea how improve performance with C-extension. I expecting to finish this work after 1.0 release.
| Changed in bzr: | |
| assignee: | nobody → bialix |
| Aaron Bentley (abentley) wrote : | #3 |
Is high priority still appropriate for this bug, now that there's a clear diagnostic?
| Changed in bzr: | |
| assignee: | bialix → nobody |
| Changed in bzr: | |
| status: | Confirmed → Fix Released |
| anatoly techtonik (techtonik) wrote : | #5 |
> bzr checkout --lightweight --hardlink lp:update-manager
Connected (version 2.0, client Twisted)
Authentication (publickey) successful!
Secsh channel 1 opened.
bzr: ERROR: Unable to create symlink 'AutoUpgradeTes
D:\.src\python>bzr version
Bazaar (bzr) 1.14.1
...
Bazaar log file: C:\Documents and Settings\Quest\Мои документы\.bzr.log
...
17.985 Traceback (most recent call last):
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
UnableCreateSym
17.985 return code 3
Windows XP, NTFS
| Changed in bzr: | |
| status: | Fix Released → New |
| Changed in bzr: | |
| status: | New → Triaged |
| Stephan Ruegamer (sadig) wrote : | #6 |
Hi Guys,
just tried to branch launchpadlib on windows...and bzr 1.5 tells me:
bzr branch lp:launchpadlib
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
bzr: ERROR: Unable to create symlink 'bootstrap.py' on this platform
BZR is using py2.5 because some of the needed deps are not available for py2.6
Regards,
\sh
| Robert Collins (lifeless) wrote : Re: [Bug 81689] Re: Branches with symlinks can't be checked out on Windows | #7 |
On Thu, 2009-06-11 at 09:21 +0000, Stephan Hermann wrote:
> bzr: ERROR: Unable to create symlink 'bootstrap.py' on this platform
This is the key: contact the launchpadlib developers and ask them to not
use symlinks.
-Rob
| Johannes Sasongko (sjohannes) wrote : | #8 |
While waiting for someone to come up with the proper fix, could there be a switch to simply skip symlinks?
Something like an --ignore-symlinks option to bzr branch/checkout would be very useful, I think. I'm not really worried about other operations, as long as I can at least get the data. Or is there any other way to do this that I'm missing?
| THirsch (thirsch) wrote : | #9 |
I would love to have an option like --ignore-symlinks as well to allow at least for a checkout/branch that I can work on (with knowledge about the missing symlinks)
Second: On Vista and Windows7 there IS support for real symbolic links.
There is a great tool (with some documentation) out there, that is freely available (ln.exe and LinkShellExtension at http://
Sorry, I am not a programmer and could not lend a helping hand.
All your current work is greatly appreciated (I love bazaar).
Please keep on providing and enhancing this excellent work.
Thomas
| John A Meinel (jameinel) wrote : | #10 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
THirsch wrote:
> I would love to have an option like --ignore-symlinks as well to allow
> at least for a checkout/branch that I can work on (with knowledge about
> the missing symlinks)
>
> Second: On Vista and Windows7 there IS support for real symbolic links.
> There is a great tool (with some documentation) out there, that is freely available (ln.exe and LinkShellExtension at http://
> Sorry, I am not a programmer and could not lend a helping hand.
> All your current work is greatly appreciated (I love bazaar).
> Please keep on providing and enhancing this excellent work.
> Thomas
>
I'm pretty sure the Windows symlinks only support directories as
targets, but maybe that changed?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkt
O5IAmQHQOk5vKL6
=OTHz
-----END PGP SIGNATURE-----
| THirsch (thirsch) wrote : | #11 |
> I'm pretty sure the Windows symlinks only support directories as
> targets, but maybe that changed?
No, it works with files as well (just tested with LinkShell Extension from http://
That's, what seems to be new with Vista/Win7.
So bazaar could check for this versions and allow mimic/handling of linux symlinks on those platforms.
Regards
Thomas
| Markus Mayer (sunside) wrote : | #12 |
The windows internal command line tool for this job is mklink.exe, btw.
Markus
Am 13.01.2010 01:00, schrieb John A Meinel:
> THirsch wrote:
>> I would love to have an option like --ignore-symlinks as well to allow
>> at least for a checkout/branch that I can work on (with knowledge about
>> the missing symlinks)
>
>> Second: On Vista and Windows7 there IS support for real symbolic links.
>> There is a great tool (with some documentation) out there, that is freely available (ln.exe and LinkShellExtension at http://
>> Sorry, I am not a programmer and could not lend a helping hand.
>> All your current work is greatly appreciated (I love bazaar).
>> Please keep on providing and enhancing this excellent work.
>> Thomas
>
> I'm pretty sure the Windows symlinks only support directories as
> targets, but maybe that changed?
>
> John
> =:->
>
| THirsch (thirsch) wrote : | #13 |
Hi,
any advance with this issue?
Anyone working on it. or is it considered to be a 'nice to have'?
Best regards
Thomas
| Changed in bzr: | |
| status: | Triaged → Confirmed |
| Jason R. Coombs (jaraco) wrote : | #14 |
My project, jaraco.windows, adds symlink support to Python under Vista and later. Just easy_install jaraco.windows, then "__import_
| Alexander Belchenko (bialix) wrote : | #15 |
Jason R. Coombs пишет:
> My project, jaraco.windows, adds symlink support to Python under Vista
> and later.
And how it helps for Windows XP users?
| Martin Pool (mbp) wrote : Re: [Bug 81689] Re: Branches with symlinks can't be checked out on Windows | #16 |
On 11 April 2010 06:06, Jason R. Coombs <email address hidden> wrote:
> My project, jaraco.windows, adds symlink support to Python under Vista
> and later. Just easy_install jaraco.windows, then
> "__import_
> It adds 'symlink' to the os module, which may be sufficient for bazaar
> to support symlinks. One caveat is if you're creating a symlink to a
> directory that doesn't exist, you must supply a third parameter,
> target_
> assume the link is to a file).
Thanks for that. What does it actually create on disk?
--
Martin <http://
| GEM (nimp3) wrote : | #17 |
@jason
using on vista easy_install jaraco.windows,
__import_
I have this error with python 2.5 :
SyntaxError: future feature print_function is not defined
to do for python >=2.6
import __future__
if hasattr(__future__, 'print_function'):
from __future__ import print_function
else:
raise ImportError('Python >= 2.6 is required')
but for python 2.5 ?
| GEM (nimp3) wrote : | #18 |
or a script for all version for "print" :
see: http://
# module cbprint
# (C) 2008 Gribouillis at www.daniweb.com
"""This module defines a Print function to use with python 2.x or 3.x.
Usage:
from cbprint import Print
Print("hello", "world")
It's interface is that of python 3.0's print. See
http://
"""
__all__ = ["Print"]
import sys
try:
Print = eval("print") # python 3.0 case
except SyntaxError:
try:
D = dict()
exec("from __future__ import print_function\
Print = D["p"] # 2.6 case
del D
except SyntaxError:
del D
def Print(*args, **kwd): # 2.4, 2.5, define our own Print function
fout = kwd.get("file", sys.stdout)
w = fout.write
if args:
sep = kwd.get("sep", " ")
for a in args[1:]:
| GEM (nimp3) wrote : | #19 |
for python 2.5
edit c:\python2.
extract jaraco from jaraco.
delete jaraco.
edit site-packages\
./jaraco.
in site-packages\
change :
from __future__ import print_function
by
#from __future__ import print_function
from cbprint import Print
delete files filesystem.pyc and privilege.pyc
in site-packages\
import ctypes
line 6, change :
BOOLEAN, LPWSTR, DWORD, LPVOID, HANDLE, FILETIME,
by
BOOLEAN, LPWSTR, DWORD, HANDLE, FILETIME, # I remove LPOID not define in py2.5
after line 10 from .....
add this code :
try:
LPVOID = ctypes.
except AttributeError:
# LPVOID wasn't defined in Py2.5, guess it was introduced in Py2.6
LPVOID = ctypes.c_void_p
delete file site-packages\
in site-packages\
line 11 change :
LPOVERLAPPED = wintypes.LPVOID
by :
try:
LPVOID = ctypes.
except AttributeError:
# LPVOID wasn't defined in Py2.5, guess it was introduced in Py2.6
LPVOID = ctypes.c_void_p
LPOVERLAPPED = LPVOID
lines 22 and 24, change :
wintypes.LPVOID,
by
LPVOID,
delete file :site-packages\
open a console windowsand tape :
python (enter)
__import_
| GEM (nimp3) wrote : | #20 |
this is for vista and 7.
sorry for xp.
| Parth Malwankar (parthm) wrote : | #21 |
Some wiki notes on this: http://
| anatoly techtonik (techtonik) wrote : | #22 |
Please add --ignore-symlinks key.
| Chris Hecker (checker-lp) wrote : | #23 |
ditto
| Changed in bzr: | |
| importance: | Medium → High |
| xaav (xaav) wrote : | #24 |
Possible solution: http://
| xaav (xaav) wrote : | #25 |
In fact, since http://
| Jelmer Vernooij (jelmer) wrote : Re: [Bug 81689] Re: Branches with symlinks can't be checked out on Windows | #26 |
On Sat, 2011-06-04 at 16:46 +0000, Geoff wrote:
> Possible solution: http://
The problem with NTFS symbolic links is that they require administrator
privileges, which makes them unusable in a lot of situations.
Cheers,
Jelmer
| Vincent Ladeuil (vila) wrote : | #27 |
> The problem with NTFS symbolic links is that they require administrator privileges
Quoting http://
Maybe it's useful to know that Administrator privileges are not required in order be able to create symlinks. You just need a specific permission that by default is assigned only to Administrators.
How to set SeCreateSymboli
http://
But anyway, if I read the bug report correctly (what an epic, that's kind of scary), this won't be available before python-3.2, so we won't even start to look at it before migrating to python 3...
| Sasha (sasha-2) wrote : | #28 |
FAR manager is managing all kinds of NTFS links without need for admin rights, C sources at http://
| Parth Malwankar (parthm) wrote : | #29 |
Hello,
I was wondering if the solution to this issue should be considered to consist of two parts.
(a) Enable checkout of branches containing symlinks on windows. Show warnings about symlinks with commands like branch, status etc. This should be simpler and can be done in the short term.
(b) In the longer run other options like those discussed in this bug can be explored to give a more complete solution.
IMHO, (a) should unblock a most users like me who need this feature. In my particular case, we have a situation where the repository resides on unix while some users would prefer to use windows along with various IDEs for editing the files. The users are OK if the symlinks don't exist on Windows. So, just having the ability to checkout the branch should help a lot.
I have created an initial patch for (a) in the branch lp:~parthm/bzr/81689-win-symlink-warning with the "branch" command working on Windows. If (a) seems like a good approach, I could work more on the patch and update other commands and tests to complete the patch and put it up for further review.
Following is the log of whats working ("branch"). As can be seen, commands like status and diff still need work:
D:\ext-src>brun branch lp:~parthm/+junk/project-with-symlink
D:\ext-
zr branch lp:~parthm/+junk/project-with-symlink
Unable to creat symlink "softlink" on this platform.
Branched 2 revisions.
D:\ext-src>cd project-
D:\ext-
hardlink hello
D:\ext-
removed:
softlink@
D:\ext-
D:\ext-
win-symlink-
=== removed symlink 'softlink'
=== target was u'hello'
| Martin Pool (mbp) wrote : | #30 |
Hi Parth!
I think the main drawback with (a) is just that people may commit
changes that delete the symlinks, which may annoy their collaborators.
However, perhaps that's less total annoyance than not being able to
check out the branch on Windows at all. I would probably take the
patch if the implementation is ok, and perhaps we can come back for b
later.
| Parth Malwankar (parthm) wrote : | #31 |
Hi Martin,
As a part of ignoring symlinks on Windows, I plan to update affected commands to show the consistent behavior of showing the "Ignoring 'xxx' as symlinks are not supported on this platform" warning. So, this should ensure that symlinks are not deleted during Windows commits. I have modified to patch for "status", "diff" and "commit" as well. Will work some more on this over the next few days and submit a merge proposal once there patch is cleanup and has tests. I still need to verify if "check" works correctly. Are there any other commands I should looks at.
Below is the interaction with "status", "diff" and "commit" with the new changes:
D:\ext-
hardlink hello
D:\ext-
Ignoring "softlink" as symlinks are not supported on this platform.
D:\ext-
Ignoring "softlink" as symlinks are not supported on this platform.
D:\ext-
Committing to: D:/ext-
missing softlink
Ignoring "softlink" as symlinks are not supported on this platform.
bzr: ERROR: No changes to commit. Please 'bzr add' the files you want to commit,
or use --unchanged to force an empty commit.
| Martin Pool (mbp) wrote : | #32 |
On 20 February 2012 18:52, Parth Malwankar <email address hidden> wrote:
>
> As a part of ignoring symlinks on Windows, I plan to update affected
> commands to show the consistent behavior of showing the "Ignoring 'xxx'
> as symlinks are not supported on this platform" warning.
This sounds a bit like you're planning to do it command-by-command.
It doesn't belong in the command layer; it should be somewhere near
the tree.
--
Martin
| Parth Malwankar (parthm) wrote : | #33 |
> This sounds a bit like you're planning to do it command-by-command.
> It doesn't belong in the command layer; it should be somewhere near
> the tree.
>
The main changes at the moment are in transform.py and delta.py,
though some changes are present in commit.py and diff.py.
I will go ahead and make the merge proposal so that I can improve the
patch based on review comments.
| Changed in bzr: | |
| assignee: | nobody → Parth Malwankar (parthm) |
| tags: | added: symlink |
| Changed in bzr: | |
| status: | Confirmed → In Progress |
| Sasha (sasha-2) wrote : | #34 |
The http://
"mklink" does the creation and "dir" recognition whether file/folder is symlink and where it points to.
While external executables call is slower than API, it is better than not support windows as platform or cut-off the symlink feature as proposed early.
| Basil Peace (grv87) wrote : | #35 |
It's sad to hear that there is no progress in this issue. I want to check out source of pytz package for own building, but it has symbolic links.
I want make some notes for this discussion and also for mentioned wiki page.
1. NTFS is the main file system on modern Windows. There is no reason to implement symbolic links for FAT.
Simply it should be noted in documentation that users should have NTFS if they need symbolic links. Modern developers have it.
2. Problems with privileges can be avoided by UAC manifest, however, I don't sure if it could be suitable without code signing.
First link from google about checking privileges from Python: http://
3. Using of external executables is the last idea, only if everything else doesn't work. There are a lot of reasons to avoid it, including security considerations.
| Ian Brandt (ian-ianbrandt) wrote : | #36 |
I had a symlink in Bazaar that prevented Windows users from checking out the project. I've removed the symlink, added a copy of the file in its place, and committed a new revision. On Windows I still get the same error trying to branch the project. Does this bug apply if there is a symlink anywhere in the history of the project? I would have thought a checkout would work if the latest revision contains no symlinks.
More details from IRC:
[12:14pm] ianbrandt: abentley: Hello. I noticed you started the wiki page on Windows symlink support (http://
[12:15pm] abentley: ianbrandt: No, if the symlink was removed in the latest commit, I'm surprised that you can't do a checkout.
[12:17pm] ianbrandt: abentley: Okay. Me too. This is with 2.5.1. On my mac when I do revno I get 4102. Same on Windows where the repository was checkout out, but the tree failed to populate.
[12:21pm] ianbrandt: bzr ls -R --kind=symlink at the root of the project returns nothing on my mac.
[12:21pm] ianbrandt: bzr revert -r 4102 on Windows results in "bzr: ERROR: No final name for trans_id 'new-1120' file-id: None root trans-id: 'new-0'"
| Ian Brandt (ian-ianbrandt) wrote : | #37 |
I've removed the file in question from the latest revision, and now the project will check out on Windows. So apparently Bazaar can't checkout a project when it contains a file with the same name of a former symlink.
| Alexander Belchenko (bialix) wrote : | #38 |
Ian Brandt пишет:
> I've removed the file in question from the latest revision, and now the
> project will check out on Windows. So apparently Bazaar can't checkout
> a project when it contains a file with the same name of a former
> symlink.
My best guess is: you can restore in the next revision your file. I.e.
you need delete symlink, commit, then add new file with the name of
symlink. That's because bzr is able to track change of symlink to
plain file, and that might confuse bzr on windows.
| Changed in brz: | |
| status: | New → Triaged |
| importance: | Undecided → Medium |
| tags: | added: check-for-breezy |
| tags: | removed: check-for-breezy |

status confirmed
I agree, the least we should do is give a proper error.
-- samba.org/ ~jelmer/
Jelmer Vernooij <email address hidden> - http://