[Scons-dev] New symlink copy support

William Blevins wblevins001 at gmail.com
Wed Jul 30 19:27:40 EDT 2014


>
> I see, I missed this fact from the commit. That makes sense,
> but documentation needs to be simplified IMO.
>
> https://bitbucket.org/scons/scons/commits/2e225b46b2ad10230ae0a11090a7a26101866989
> Because I read "symbolic link copying behavior" in a wrong way.


Provide a suggestion?  I can barely read my own mind much less anyone
else's :)

What about this?

+    <para>
+    The &Copy; factory supports copying symbolic links. This behavior can
be controlled by an optional third argument.
+    </para>
+
+    <para>
+    Symbolic link shallow copied a new symbolic link:
+    </para>
+
+    <para>
+    <literal>Command("LinkIn", "LinkOut1", Copy("$TARGET", "$SOURCE"[,
True]))</literal>
+    </para>
+
+    <para>
+    Symbolic link target copied as a file or directory:
+    </para>
+
+    <para>
+    <literal>Command("LinkIn", "FileOrDirectoryOut", Copy("$TARGET",
"$SOURCE", False))</literal>
+    </para>

V/R,
William


On Wed, Jul 30, 2014 at 2:48 AM, anatoly techtonik <techtonik at gmail.com>
wrote:

> On Wed, Jul 30, 2014 at 3:43 AM, William Blevins <wblevins001 at gmail.com>
> wrote:
> >>  2. Get Mercurial and run tests in VM
> >>       hg clone http://selenic.com/hg
> >>       cd hg/contrib/vagrant
> >>       vagrant up
> >>       vagrant ssh -c ./run-tests.sh
> >>
> >> Vagrant mounts current folder as /vagrant inside VM, so when I cd to
> this
> >> folder and try to create symlink, I get a nasty error:
> >>
> >>     vagrant ssh
> >>
> >>     $ cd /vagrant
> >>     $ ln config.yml config.yml2
> >>     ln: failed to create hard link `config.yml2' => `config.yml':
> >> Operation not permitted
> >>     $ ln -s config.yml config.yml2
> >>     ln: failed to create symbolic link `config.yml2': Protocol error
> >>     $ python -c "import os; os.symlink('config.yml', 'config.yml2')"
> >>     Traceback (most recent call last):
> >>       File "<string>", line 1, in <module>
> >>     OSError: [Errno 71] Protocol error
> >
> >
> > I've never used vagrant before, but it was fairly intuitive with your
> > example.
> >
> > 1. run-tests.sh is still executing after 30min+ and there are some
> errors,
> > but nothing I can see related to symlinks.
> > 2. I was able to create symlinks inside the "/vagrant" directory
>
> Sorry if I was not clear. This was just to demonstrate the modern
> development setup with Vagrant. The type of file system mounted
> as "/vagrant" is your host FS. In my case it is Windows, so I get
> this error.
>
> > Based on this example, I don't think your use case makes sense.  In order
> > for the SCons Copy code to fail on "os.symlink", Copy must be attempting
> to
> > copy a symlink:
> >
> >> ls -l
> >> lrwx------ item -> item.txt
> >> -rwx------ item.txt
> >> cat SConstruct
> >> Copy( 'item', 'item_link', True ) # default is True anyway
> >> Copy( 'item', 'item_file', False ) # default is True anyway
> >> scons
> >    Copy( item, item_link )
> >    Copy( item, item_file )
> >> ls -l
> >> lrwx------ item -> item.txt
> >> -rwx------ item.txt
> >> lrwx------ item_link -> item.txt
> >> -rwx------ item_file
> >> echo "item.txt & item_file inode count is 1"
> >
> > Copy does not try to create a symlink from a "real" file:
>
> I see, I missed this fact from the commit. That makes sense,
> but documentation needs to be simplified IMO.
>
>
> https://bitbucket.org/scons/scons/commits/2e225b46b2ad10230ae0a11090a7a26101866989
>
> Because I read "symbolic link copying behavior" in a wrong way.
>
> > Maybe it was just a bad example? You could still have this issue if you
> are
> > copying a symlink from a filesystem that supports it to one that doesn't.
>
> Also in Windows you can not create link from one drive to other even
> if FS supports it.
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> http://two.pairlist.net/mailman/listinfo/scons-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20140730/ffd13c52/attachment-0001.html>


More information about the Scons-dev mailing list