public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* /usr/local/bin symbolic link disappears every time cyg setup is run
@ 2014-09-03 21:19 Dat Head
  2014-09-04  3:05 ` Larry Hall (Cygwin)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dat Head @ 2014-09-03 21:19 UTC (permalink / raw)
  To: The Cygwin Mailing List

I have a symlink from /usr/local/bin to /3TB-external/bin/CYGWIN to keep
architecture independent bin files on an external drive for portability.

every time I run cyg setup.exe it removes the symlink and creates an
empty /usr/local/bin directory - is it really supposed to do that?
are there some cygwin pkgs (none that I have installed because it has
never put anything there) that put files there? (even if there are,
it shouldn't zap the symlink)

Cygwin 1.7.30-1

CYGWIN_NT-6.1 frog2 1.7.30(0.272/5/3) 2014-05-23 10:36 x86_64 Cygwin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /usr/local/bin symbolic link disappears every time cyg setup is run
  2014-09-03 21:19 /usr/local/bin symbolic link disappears every time cyg setup is run Dat Head
@ 2014-09-04  3:05 ` Larry Hall (Cygwin)
  2014-09-04 17:48   ` Kurt Franke
  2014-09-04 16:23 ` Achim Gratz
  2014-09-12 23:39 ` bi-arch cygwin (was Re: /usr/local/bin symbolic link disappears every time cyg setup is run) Linda Walsh
  2 siblings, 1 reply; 5+ messages in thread
From: Larry Hall (Cygwin) @ 2014-09-04  3:05 UTC (permalink / raw)
  To: cygwin

On 09/03/2014 05:19 PM, Dat Head wrote:
> I have a symlink from /usr/local/bin to /3TB-external/bin/CYGWIN to keep
> architecture independent bin files on an external drive for portability.
>
> every time I run cyg setup.exe it removes the symlink and creates an
> empty /usr/local/bin directory - is it really supposed to do that?
> are there some cygwin pkgs (none that I have installed because it has
> never put anything there) that put files there? (even if there are,
> it shouldn't zap the symlink)

/usr/local is a common subtree on Linux systems, common enough that
setup makes sure it exists by creating it.  Setup, though, doesn't
know about all the variations of symlinks that Cygwin itself does
so its pretty heavy-handed when it comes to symlinks that get in
its way.  As a work-around, you could script setup so that it
recreates the symlink you want with each run.  You could even make
your own "mirror" which provides a package that contains only a
postinstall script that does this, so that anytime you run setup,
you could install or reinstall this package from your own mirror
to make this more generic and integrated.  Another alternative
is to take a look at setup's source and see if you can create a
patch to handle this better.  You can probably think up some
other possibilities for a solution that you like even better. :-)


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /usr/local/bin symbolic link disappears every time cyg setup is run
  2014-09-03 21:19 /usr/local/bin symbolic link disappears every time cyg setup is run Dat Head
  2014-09-04  3:05 ` Larry Hall (Cygwin)
@ 2014-09-04 16:23 ` Achim Gratz
  2014-09-12 23:39 ` bi-arch cygwin (was Re: /usr/local/bin symbolic link disappears every time cyg setup is run) Linda Walsh
  2 siblings, 0 replies; 5+ messages in thread
From: Achim Gratz @ 2014-09-04 16:23 UTC (permalink / raw)
  To: cygwin

Dat Head writes:
> I have a symlink from /usr/local/bin to /3TB-external/bin/CYGWIN to keep
> architecture independent bin files on an external drive for portability.

Just create a mount in /etc/fstab and keep the tree under the mount
point empty.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: /usr/local/bin symbolic link disappears every time cyg setup is run
  2014-09-04  3:05 ` Larry Hall (Cygwin)
@ 2014-09-04 17:48   ` Kurt Franke
  0 siblings, 0 replies; 5+ messages in thread
From: Kurt Franke @ 2014-09-04 17:48 UTC (permalink / raw)
  To: cygwin

Larry Hall (Cygwin <reply-to-list-only-lh <at> cygwin.com> writes:

> 
> On 09/03/2014 05:19 PM, Dat Head wrote:
> > I have a symlink from /usr/local/bin to /3TB-external/bin/CYGWIN to keep
> > architecture independent bin files on an external drive for portability.
> >
> > every time I run cyg setup.exe it removes the symlink and creates an
> > empty /usr/local/bin directory - is it really supposed to do that?
> > are there some cygwin pkgs (none that I have installed because it has
> > never put anything there) that put files there? (even if there are,
> > it shouldn't zap the symlink)
> 
> /usr/local is a common subtree on Linux systems, common enough that
> setup makes sure it exists by creating it.  Setup, though, doesn't
> know about all the variations of symlinks that Cygwin itself does
> so its pretty heavy-handed when it comes to symlinks that get in
> its way.  As a work-around, you could script setup so that it
> recreates the symlink you want with each run.  You could even make
> your own "mirror" which provides a package that contains only a
> postinstall script that does this, so that anytime you run setup,
> you could install or reinstall this package from your own mirror
> to make this more generic and integrated.  Another alternative
> is to take a look at setup's source and see if you can create a
> patch to handle this better.  You can probably think up some
> other possibilities for a solution that you like even better. 
> 

I just use /usr/local as a mount point:

$> df /usr/local/
Filesystem                1K-blocks      Used Available Use% Mounted on
D:/cygwin-local/usr/local 766838780 405249584 361589196  53% /usr/local

setup may create any structure under this mount point,
but this has no effect in cygwin due to the mount will hide
the previous files/directories at this location

this methode prevents me from putting directory tres inside cygwin tree
which are not delivered via cygwin setup.
I do this also for /home


snip from /etc/fstab :
D:/cygwin-local/usr/local /usr/local some_fs binary 0 0
D:/cygwin-local/home /home some_fs binary 0 0



regards

kf







--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bi-arch cygwin (was Re: /usr/local/bin symbolic link disappears every time cyg setup is run)
  2014-09-03 21:19 /usr/local/bin symbolic link disappears every time cyg setup is run Dat Head
  2014-09-04  3:05 ` Larry Hall (Cygwin)
  2014-09-04 16:23 ` Achim Gratz
@ 2014-09-12 23:39 ` Linda Walsh
  2 siblings, 0 replies; 5+ messages in thread
From: Linda Walsh @ 2014-09-12 23:39 UTC (permalink / raw)
  To: cygwin

Dat Head wrote:
> I have a symlink from /usr/local/bin to /3TB-external/bin/CYGWIN to keep
> architecture independent bin files on an external drive for portability.
----
    I've tried similar and wasn't able to convince anyone (my track
record on being convincing is significantly lamer than mosts').

    I thought this (https://cygwin.com/ml/cygwin/2014-03/msg00494.html)
was the best solution to fix this problem.

    I first mentioned it in
this: (https://cygwin.com/ml/cygwin/2014-01/msg00089.html)
post and would love to see it work.

As it is, I have to manually recreate the links and manually copy
programs installed at the wrong location after each install.

Re: solutions to use a cygwin mount point:

Kurt Franke wrote:
> I just use /usr/local as a mount point:
> $> df /usr/local/
> D:/cygwin-local/usr/local 766838780 405249584 361589196  53% /usr/local
> setup may create any structure under this mount point,
> but this has no effect in cygwin...
and

Achim Gratz wrote:
> Just create a mount in /etc/fstab and keep the tree under the mount
> point empty.

----
Miss the point -- I want setup to write into the shared location
for /usr/share or any specific mount point.

Both "mountvol" and "linkd" create "junctions" which are called
soft mount points by microsoft vs. "mklink", which actually
creates something called a "symbolic link".

Under cygwin, linkd-created junctions are treated like symlinks.
I lobbied (unsuccessfully) to get this changed.  The stumbling
block was a fear of this creating directory loops -- which cygwin
already creates via it's own soft mounts (or so "find" tells me
when doing a rebuild of the "locate" db.

The same behaviors happen on linux with it's mount program
redirecting files and directories... the device num doesn't
change -- and loops can result.  But linux took the path of
providing the feature and not second-guessing how users
and admins should configure their computer.  When MS
implemented junctions in Win2k, they said that uncareful
use could result in directory loops. 

It is unfortunate that cygwin should have eliminated
the usefulness of MS's directory remounting (as this
would have kept this feature in parity with linux).


>
> every time I run cyg setup.exe it removes the symlink and creates an
> empty /usr/local/bin directory - is it really supposed to do that?
> are there some cygwin pkgs (none that I have installed because it has
> never put anything there) that put files there? (even if there are,
> it shouldn't zap the symlink)
----
If it doesn't put files in there, then why would it delete the symlink?

That seems like a malicious enforcement of a broken paradigm.


Note, this allows this type of structure:

>  ll / |grep cyg|cut -c42-999
bin -> /windows/system32/cygwin/bin/
bin1 -> /windows/system32/cygwin/bin/
cygcommon/
cygwin/
cygwin64/
etc -> /Windows/system32/cygwin/etc/
lib -> /Windows/System32/cygwin/lib/
sbin -> /Windows/System32/cygwin/sbin/
usr -> /Windows/System32/cygwin/usr/
var -> /Windows/System32/cygwin/var/


Then the link in /windows/system32 is handled by windows:

(under 32 bit windows:)
C:\cygwin\bin>uname -a
CYGWIN_NT-6.1-WOW64 Athenae 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin
C:\cygwin\bin>dir \windows\system32|grep cyg
01/10/2014  01:09 PM    <SYMLINKD>     cygwin [C:\cygwin]

(64-bit windows:)
C:\bin>uname -a
CYGWIN_NT-6.1 Athenae 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
C:\bin>dir C:\windows\system32|grep cygwin
01/11/2014  09:21 PM    <SYMLINKD>     cygwin [C:\cygwin64]

So depending on whether you are running 32-bit or 64-bit, the *redirector*
link in /windows/<syswow64|system32>/  redirects you to the compatible
architecture (or should if everything was put together correctly.

Unfortunately, w/o any "soft-mount" support by honoring window's linkd
entries, it's not easy to maintain this type of setup (as you can tell
from the "uname" output -- my 32-bit cygwin doesn't get updated
as often... ;-(

Anyway, just a rehash of what a bi-arch cygwin might look like
and how it could be implemented.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-12 23:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03 21:19 /usr/local/bin symbolic link disappears every time cyg setup is run Dat Head
2014-09-04  3:05 ` Larry Hall (Cygwin)
2014-09-04 17:48   ` Kurt Franke
2014-09-04 16:23 ` Achim Gratz
2014-09-12 23:39 ` bi-arch cygwin (was Re: /usr/local/bin symbolic link disappears every time cyg setup is run) Linda Walsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).