public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-02  6:11 Chris Faylor
  0 siblings, 0 replies; 30+ messages in thread
From: Chris Faylor @ 1997-12-02  6:11 UTC (permalink / raw)
  To: justins; +Cc: gnu-win32

>Chris Faylor wrote:
>> 
>> I have recently provided a patch to Cygnus to provide control of various
>> environment variable settings on a program by program basis.
>> 
>> Geoffrey has asked that I get feedback on my changes to see if they are
>> something that is useful to the list as a whole.
>> 
>> My changes cause a program to read the registry for options settings prior
>> to reading settings from the environment.  So, for instance, you can do
>> something like this:
>> 
>>         cygwin -o 'c:\bin\bash.exe' binmode notitle
>> 
>> That will set options in the registry which will cause bash to always
>> use 'binmode' as its default and to never modify the title bar.
>> 
>
>	I can see a possible problem: the change is limited to the copy of the
>program in that directory.  If you use the above example, but have
>another copy of the program in a different directory, the changes will
>not carry over, which in some, but not all, eyes could be a bad thing,
>since you would have to have an entry for each instance of the program
>you want to run.  If, however, you just use the program name without the
>path, the changes would be global for all instances of that program,
>which is a little better in my opinion.

I'm not sure that I agree.  Actually, it could be made to check a default
location, the program without the path, and the program with the path but
that would certainly slow down program startup for, IMHO, minimal gain.

I'm also not sure what the gain would be in keeping multiple copies of a
program around.  If you have the same program sitting in multiple directories
it seems to me that you are a candidate for running CleanSweep.

>	But that just brings up another question: what about instances run from
>symlinks?

Symlinks are a cygwin construction.  The actual program being run is always
the program that they point to.  GetModuleFilename returns the actual
path name of the program and that is what I (currently) use.
--
http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-04 17:09 Chris Faylor
  0 siblings, 0 replies; 30+ messages in thread
From: Chris Faylor @ 1997-12-04 17:09 UTC (permalink / raw)
  To: gnu-win32

>>My changes cause a program to read the registry for options settings prior
>>to reading settings from the environment.  So, for instance, you can do
>>something like this:
>
>>	cygwin -o 'c:\bin\bash.exe' binmode notitle
>
>I nearly sent a rave about how pointless this is because even more
>functionality can already be achieved with environment variables alone
>(at the cost of extra short-lived bash processes to tailor the environment).

So use environment variables then.  I'm not advocating getting rid of
environment variables.  I don't see how reading of options from the
registry can remove functionality.

What the registry can do, that your bash scripts only approach can't, is
allow things like setting up inetd to default to CYGWIN_TTY.  Running
inetd from a shell script that sets CYGWIN_TTY=1 is not easy.  The other
alternative is to set the global environment variable CYGWIN_TTY to 1
and then unset it on a per-session basis.  Yup.  That's pretty flexible.

On top of this, you have to add the not-inconsiderable speed improvement
from reading the registry versus firing up bash (or ash or whatever) to
start up a shell script which sets an environment variable and runs another
program.

>My most serious concern was the loss of functionality:
>
>    Your proposition only seems to cater for per-application configuration,
>    not per-*process* configuration.
>
>Someone else made this point and referred to multiple copies of binaries
>which you thought was a bad thing. But your proposition would *require*
>multiple binaries if users wanted per-process configuration!

Use environment variables, then.  You haven't lost anything.

>Without this extension, the proposition only speeds up per-application
>configuration and users would then have to fiddle the registry *and* the
>environment to achieve per-process configuration.

Don't fiddle with the registry.  Use environment variables.

>With this extension, it speeds up per-process configuration as well.

I'm not so sure, since symbolic links mean nothing to the normal command
shell.  So, you could have:

-rwxr-xr-x   1 cgf      everyone  1716020 Oct 28 09:02 /bin/bash.exe
lrwxr-xr-x   1 cgf      everyone       19 Dec 03 09:40 bashbin.exe -> bash.exe

and have bash default to "text" mode opens and bashbin default to "binmode"
opens.

But running bashbin would never work from the command shell:

C:\bin>bashbin
The name specified is not recognized as an
internal or external command, operable program or batch file.

Of course, this would work:

C:\>bash
$ CYGWIN32=nobinmode bash
$

Personally, I don't think that that is extremely odious.

>So my suggestion is not to use dos-style file paths in the registry,
>but rather cygwin-style file paths (thus including binaries, scripts
>and symbolic links).  This shouldn't be a problem since it only applies
>to cygwin programs anyway(?).

When you ask a process what name it was invoked by, it returns a MS-DOS
style path name.  That's what I'm currently using.  It is pretty foolproof.

I don't remember saying that the registry stuff wouldn't work with
scripts but neither scripts nor symbolic links are impossible to do, and
if the consensus is that it is crucial, then I'll look into implementing
it.

My feeling from reading this newsgroup is that 99% of the problems that
occur are when a user ports the nifty UNIX XYZ program to cygwin32.
Everything compiles ok, but when the user tries to run the program it
seems to screw up reading data files.  In this case, setting a 'binmode'
registry option for the program would solve the problem.

I haven't seen much traffic on the list from people complaining that
they have to set up shell scripts to turn off 'TITLE' or 'TTY' for a
program some of the time but leave them on for others.  I also don't see
why a program would *want* to sometimes default to opening files in
O_BINARY and sometimes default to O_TEXT.  Of course, since
CYGWIN_BINMODE is not available yet perhaps this is a requirement that
is waiting in the wings.

Perhaps someone could, in a non-raving manner, enlighten me with some
real-world examples.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* RE: Feedback needed on proposed cygwin feature
@ 1997-12-04 17:07 Michael Anthon
  1997-12-05  8:07 ` Chris Faylor
  0 siblings, 1 reply; 30+ messages in thread
From: Michael Anthon @ 1997-12-04 17:07 UTC (permalink / raw)
  To: gnu-win32

On Thursday, 4 December 1997 12:31, cgf@bbc.com [SMTP:cgf@bbc.com]
wrote:
> In article < 34856623.C5226DBC@twinspot.net >,
> Tomas Fasth  <tomas.fasth@twinspot.net> wrote:
> >Modifying the exe file "on-the-fly" for environmental settings is not
to
> >recommend. Two of the reasons I can think of is:
> >
> >* Security considerations in a multiuser / multiprocess environment.
> 
> What security considerations are there that are not also present with
> any other scheme, whether it is using extended attributes or setting
options
> in the registry?  You would have to have the right privileges to
change
> the binary.

Modification of binary files in a multi-user environment is not a good
thing.  The registry is there, you may as well use it.  Something I have
not yet seen mentioned is the fact that each user can have a separate
profile in the registry, making it easy for each user to have different
settings.  Modifying the binary might get just a little frustrating if
someone else keeps changing it to the way THEY like things (unless you
want to fill your hdd with multiple copies of executables)
Also, for a user to be able to modify a binary, they would need write
access to that binary.  I suspect this would cause nightmares for sys
admins, not to mention the possibility of adding back doors directly
into the binaries themselves.  I bet a normal user can't modify any of
the shell binaries in a standard Unix setup.

> 
> >* Will cause problem in environments with active virus protection.
> 
> How does a virus detection program detect the difference between
installing
> a new version of bash or changing a byte in the existing file?

SOME virus protection schemes are now including a mechansim whereby any
changes to an executable file will raise a warning.  Norman Anitvirus is
one in particular that I have used that does this.  It's a bit of a pain
if you forget to disable that feature before installing any new
software.  If that installation tries to upgrade, for example, a dll
file, as most of them seem to do these days, the Virus detection kicks
in and gives you a warning.

The same thing would apply to modification of the executables as
suggested here.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-02 20:23 Earnie Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Earnie Boyd @ 1997-12-02 20:23 UTC (permalink / raw)
  To: gnu-win32

>From: Chris Faylor <cgf@bbc.com>
>Date: Mon, 1 Dec 1997 17:46:58 -0500 (EST)
>To: jazz@softway.com
>Subject: Re: Feedback needed on proposed cygwin feature
>Cc: gnu-win32@cygnus.com
>
>>> Extended attributes are not an option for Windows 95, however.
>>
>>Didn't Sergey's Coolview extensions provide a mechanism for storing
>>extended attributes on FAT filesystems and under Win95? Or am I
>>misremembering things?
>
>Just under Windows NT, I think.
>
>I do remember that people using FAT on Windows NT complained because
>cygwin was creating a large file to hold the extended attributes, also.
>That may be another mark against using them.

Yes, the file grew to be about 150M before I found out what was eating 
up the disk space.  I removed the coolview patches on my Windows NT but 
now use the latest coolview on my W95.  My WinNT has a FAT mount.

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-02 16:54 dahms
  1997-12-03  7:38 ` Theodore Jump
  0 siblings, 1 reply; 30+ messages in thread
From: dahms @ 1997-12-02 16:54 UTC (permalink / raw)
  To: fjh; +Cc: gnu-win32, dahms

Hi Fergus, you wrote:

: I don't see any good reason to hard-code the `32'.
: 
: Using `CYGWIN32' won't look very good on say the 64-bit NT Alpha port.

MS should have made the jump to >32bit at NT4, at a time several other
unices already were 64bit, and provide a real useful POSIX before forcing
all of us to NT, saving all this hassle!


Bye, Heribert (dahms@ifk20.mach.uni-karlsruhe.de)
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-02  9:41 marcus
  1997-12-03  6:00 ` Tomas Fasth
  1997-12-03  7:38 ` Chris Faylor
  0 siblings, 2 replies; 30+ messages in thread
From: marcus @ 1997-12-02  9:41 UTC (permalink / raw)
  To: gnu-win32

Jason Zions <jazz@softway.com> wrote:
>It strikes me that the best place for per-binary attributed like this
>would be in the binary itself. I don't know how closely cygwin's exec()
>looks at the program being exec'd; if it looks at the program header,
>there should be a way to squirrel the attributes away there someplace.

If there isn't anyplace in the file header that can be used to store this
info away in that doesn't upset NT/W95, or if it is costly to open the object
file whenever a program starts execution, perhaps it would be possible to
provide some global variables in the crt0.o module for controlling various
attributes.  The tool to set the attributes would have to go through the
name list to find the variables, then find the section to modify.  Shouldn't
be too bad, and the performance of the attribute setting program isn't
critical anyway, but it would require that the file not be fully stripped.

On the other hand, perhaps a data section could be defined that contains an
array of attribute flags, or even space for ASCII attribute names.  This
section (perhaps .cygwin_attributes) could be initially provided by the crt0.o
file, then a pointer to it is passed to the DLL on process startup.

Using an array of flags allows easy allowance for significant expansion, but at the cost of having a fixed structure (i.e. the first flag corresponds to the
force-binary attribute, the second flag...) while the ASCII attribute name
requires a "big enough" fixed size buffer be pre-allocated to hold the list
of attributes, and what happens when an attribute name is not recognized by
the DLL?  Of course, perhaps the attribute setting program could change the
section size, etc....

cgf replies to Jason:
> Also, in actuality, the binary does not know that it has been invoked via
> a symbolic link since this is a cygwin affectation.  If you have two
> files hard linked together you might actually *want* to have separate
> settings for them.

You might want separate settings in some cases, but you might also get very
confused by separate settings as well.  If this is supposed to be "Unix-like",
then it would be least surprising to attach the attribute to the file instead
of the name.

Other issues with using name:

The full path name must be unambiguously stored with the attribute and expanded
for execution.  Otherwise, some peculiar things may not work correctly, such
as invoking the program as "../bin/program", using a symbolic link to a
directory "symlinktobin/program", etc.  If the attributes are not consistently
found whenever a program is run, the program will have inconsistent behaviour.

If attributes are set for a program, then the program is moved to another
location or given another name, it looses the attributes.  Furthermore, if
a new program is created (perhaps months later) with the same name and
location, it will mysteriously gain the attributes.  These problems do apply
to symbolic links currently, so they aren't new, but they can be confusing
particularly since they may have subtle effects on the execution of the program
instead of a hard failure to follow a link.

marcus hall
Lucent Technologies
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-02  7:22 Chris Faylor
  0 siblings, 0 replies; 30+ messages in thread
From: Chris Faylor @ 1997-12-02  7:22 UTC (permalink / raw)
  To: kkont; +Cc: gnu-win32

>> My changes cause a program to read the registry for options settings prior
>> to reading settings from the environment.  So, for instance, you can do
>> something like this:
>> 
>> 	cygwin -o 'c:\bin\bash.exe' binmode notitle
>> 
>> That will set options in the registry which will cause bash to always
>> use 'binmode' as its default and to never modify the title bar.
>> 
>
>I find the feature a good idea. I think, however, that there should be
>a `default' registry entry, applying to programs not explicitly
>registered; this could be arranged, for example, by
>
>	`cygwin -d binmode title'.
>
>(Without the default entry, a user will have to register each and every
>program individually, if environment variables are to be dispensed with.)

Actually, I have implemented a registry default (should have mentioned it)
but I'm not talking about dispensing with environment variables.  They
are still very useful in certain situations.  Environment variables take
precedence over registry options.

>Another issue I see important in connection with registry entries for
>specific programs (like the `bash' example you gave) is they way the
>linkage between the program and the settings is specified. If the program
>is identified through its full pathname (as the example on bash above
>indicates) then dangerous things may happen. For example, if the program is
>moved to a different directory, the association will be broken and the
>program will start using the default settings, something obviously
>unsatisfactory. (This problem does not arise with environment variables.)

I don't see any way around this other than to either use NT extended
attributes (which don't work on Windows 95) or to modify the binary header
which I don't have the expertise to do.

Or, continue to use environment variables...

>Should the linkage between program and settings use only the program's
>basename? Well, this would remove the side-effects following relocation
>of a file, but would force two programs of the same name, in different
>directories, to use the same settings (and no way to override this in the
>registry would be possible). This is less of an issue to me.

Forgoing the the path part of the program name is a possibility.  I don't
like it because it makes debugging a little program harder.

>Even this arrangement may not be entirely adequate; for, if the program reads
>the settings using argv[0] as the key to search (speculation here, since
>I don't know any implementation details) there will be problems in Win95, when
>the standard shell (COMMAND.COM) is used. This shell sets argv[0] so that the
>individual path components have their 8.3 `short-form' names (although the
>cygnus startup code replaces /-separators for \-ones). For example, on my
>system the `find' program gets an argv[0] equal to
>
>	/GNUWIN32/H-I386~1/BIN/FIND.EXE
>
>when run under COMMAND.COM. Then, two, otherwise identical registry entries,
>one for find.exe and one for FIND.EXE might be required. This is, of course,
>unsatisfactory.

I use GetModuleFilename to find the name of the running program.  This
should always return a consistent name.

>> 	c)  "Solves" the problem of programs, ported from UNIX, which need
>> 	    to use `binmode' by default.
>> 
>A small issue here arises: what are the semantics of both using [no]binmode
>and the mount-settings for various directories? A possible (and preferred
>to me) choice is to have a program disregard mount-settings if a
>program-specific registry entry exists. A suggestion for precedence is
>harder in connection with the `default' registry entry I mentioned above.
>Any suggestions? Note, however, that the proper mode should also cover
>standard input/output, when these streams are not directed to the console.
>Sergey, has solved that in recent coolview versions
>(I believe by checking the mount entry for /, for a binary setting--is it so?).
>I definitely wouldn't want to see this aspect broken again. Things like
>`gunzip .. | tar xf -' should work, regardless of the shell used for invocation.

This is tricky, I agree.  For the way that it is currently implemented,
the 'binmode' setting merely changes the program's default setting for
opens which do not specify binmode or textmode.  That means that if you
specifically set O_TEXTMODE (or whatever) in an open it will override
the binmode setting.  If you have a disk mounted as textmode but have
`binmode' set, then a file opened on that disk will be opened as textmode.

>>     Cons:
>> 
>> 	a)  May slow down process startup slightly (I haven't noticed this
>> 	    in simple tests, though).
>> 
>There are so many other major sources of slowness, that I don't think this
>one will make a significant difference.

Yeah, but I don't really want to contribute to slowing down cygwin.  Every
nifty feature added to cygwin may have a price.

>> 	b)  Contributes to creeping featuritis.
>> 
>Something that we should try to keep to a minimum. I definitely wouldn't want
>to see twenty possible options being settable, a year from now.
>Discipline and discretion must be applied when using any powerful tool or
>mechanism. In particular, the scheme proposed should NOT be used for
>`sweeping under the rug' problems that should be fixed by updating the source
>code of individual programs.
>
>> 	c)  The BINMODE option is nice, but may delay true port of a
>> 	    product in favor of a "SET CYGWIN_BINMODE" band-aid.
>> 
>For programs that their natural mode of operation is `binary' (cmp is an
>obvious example), I believe the program's code should enforce it
>explicitly; registry or environment settings are, in my opinion,
>just a temporary patch. (I admit that there is a `grey zone' of programs
>that could benefit from both file modes.)
>
>> The available options are:
>> 
>> 	[no]binmode		- Set default open mode
>> 	[no]title		- Display program names on the console
>> 				  title bar
>> 	[no]glob		- [Do not] interpret wild cards on commands
>> 				  run from CMD.
>I hope this will affect only invocations from within CMD or COMMAND.COM,
>or any (and all) non-Unix shell. 

Yup.

>While at it, let me note that I would like to see a setting like
>dosglob, which, when activated, would perform dos-like globbing (the
>sort of thing you get when you link with an appropriate module in
>Microsoft compilers).  Again this should apply only in case the program
>is invoked from within CMD/COMMAND.COM.  This would make globbing more
>transparent from within Microsoft shells (whose design is responsible
>for this mess in the first place), when using a mixture of cygwin and
>non-cygwin tools.

I'm not sure how this would work.  Do you mean that you'd actually like
to have things like c:\bin\*foo.exe be equivalent to c:\bin\*.exe and you'd
like to disallow c:\*\foo.exe?

>> 	[no]strip_title		- [Do not] strip the path component of files
>> 				  names displayed in the title bar
>> 	[no]tty			- Attach a UNIX-style tty to the program
>> 
>> All of the above are available as normal CYGWIN_* environment variables:
>> 
>> 	CYGWIN_BINMODE, CYGWIN_NOBINMODE
>> 	CYGWIN_TITLE, CYGWIN_NOTITLE
>> 	etc.
>> 
>> These settings are similar to those found in Sergey's recent coolview
>> release except that it is possible to say CYGWIN_NOTITLE as well as
>> CYGWIN_TITLE.
>> 
>
>What happens if one has set both CYGWIN_TITLE and CYGWIN_NOTITLE?

Currently, CYGWIN_TITLE would win because the Win32 environment is maintained
in sorted order and CYGWIN_TITLE occurs after CYGWIN_NOTITLE.

If this is an issue, I could disable the CYGWIN_NO* environment variables.

Thanks very much for the feedback.
--
http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-01 22:51 Chris Faylor
  0 siblings, 0 replies; 30+ messages in thread
From: Chris Faylor @ 1997-12-01 22:51 UTC (permalink / raw)
  To: jazz; +Cc: gnu-win32

>> Extended attributes are not an option for Windows 95, however.
>
>Didn't Sergey's Coolview extensions provide a mechanism for storing
>extended attributes on FAT filesystems and under Win95? Or am I
>misremembering things?

Just under Windows NT, I think.

I do remember that people using FAT on Windows NT complained because
cygwin was creating a large file to hold the extended attributes, also.
That may be another mark against using them.
--
http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-01 22:51 Chris Faylor
  1997-12-01 22:51 ` Jason Zions
  0 siblings, 1 reply; 30+ messages in thread
From: Chris Faylor @ 1997-12-01 22:51 UTC (permalink / raw)
  To: jazz; +Cc: gnu-win32

>Jason Zions <jazz@softway.com> wrote:
>It strikes me that the best place for per-binary attributed like this
>would be in the binary itself. I don't know how closely cygwin's exec()
>looks at the program being exec'd; if it looks at the program header,
>there should be a way to squirrel the attributes away there someplace.
>
>Many "real Unix" systems do just this sort of thing; e.g. chatr in
>HP-UX, which is used to alter a.out attributes.
>
>Pro: 
>  a) attributes are *really* a part of the binary; symlinks and
>hardlinks all pointing to the same bits on the disk will behave the
>same, while name-based approaches may be inconsistent
>
>  b) makes it easier for attributes to work over network mounts (when
>filesystems can be mounted in different places)
>
>Con:
>  a) extracting the attributes from the binary may be slower
>
>  b) may be hard to find a "safe place" to stash the bits

Actually, Geoffrey had already mentioned this scenario in private email.
I should have mentioned it in my original message.

It is certainly doable using extended attributes on Windows NT.
Extended attributes are not an option for Windows 95, however.  I think
that it would end up being slightly slower than using the registry since
the registry options stand a better chance of being cached than a file's
attributes.

I agree that it probably would be possible to modify the binary header.
I don't have the expertise to do so, however.  If anyone else can volunteer
a way to store arbitrary data in PE binary I'll be happy to incorporate it.

Also, in actuality, the binary does not know that it has been invoked via
a symbolic link since this is a cygwin affectation.  If you have two
files hard linked together you might actually *want* to have separate
settings for them.

cgf
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* RE: Feedback needed on proposed cygwin feature
@ 1997-12-01 11:43 JONCKHEERE
  1997-12-02  7:23 ` Chris Faylor
  0 siblings, 1 reply; 30+ messages in thread
From: JONCKHEERE @ 1997-12-01 11:43 UTC (permalink / raw)
  To: GNU-WIN32; +Cc: JONCKHEERE

                                     D0TNG (D0 AXP cluster) @FNAL,  1-DEC-1997
---------------------------------------------------------------------------
> From:	SMTP%"cgf@bbc.com"  1-DEC-1997 06:08:43.18
> To:	JONCKHEERE
> CC:	
> Subj:	Feedback needed on proposed cygwin feature
> 
> I have recently provided a patch to Cygnus to provide control of various
> environment variable settings on a program by program basis.

Is this patch generally available yet? If so where? If not when can we
expect to see it?
 
> Geoffrey has asked that I get feedback on my changes to see if they are
> something that is useful to the list as a whole.

From your discription it looks like *just* the sort of thing we need.
But probably needs some generalization.

We are porting a large body of code from Unix to NT, including the code
development system used on Unix (CVS and a home brewed set of scripts
and makefiles). It all works very well in the DOS command line window.
But we'd like to integrate it into the windows environment. The
biggest problem we face is that the various exes require different,
sometimes conflicting environment variable values.

At the moment we invoke each exe via a bash shell script which sets
the variables. But this is something of a kludge. It sounds like your
patch, or a generalization of it, might allow a much more elegant
solution to our problem. 
 
> My changes cause a program to read the registry for options settings prior
> to reading settings from the environment.  So, for instance, you can do
> something like this:
> 
> 	cygwin -o 'c:\bin\bash.exe' binmode notitle
> 
> That will set options in the registry which will cause bash to always
> use 'binmode' as its default and to never modify the title bar.
> 
> The available options are:
> 
> 	[no]binmode		- Set default open mode
> 	[no]title		- Display program names on the console
> 				  title bar
> 	[no]glob		- [Do not] interpret wild cards on commands
> 				  run from CMD.
> 	[no]strip_title		- [Do not] strip the path component of files
> 				  names displayed in the title bar
> 	[no]tty			- Attach a UNIX-style tty to the program
> 
> All of the above are available as normal CYGWIN_* environment variables:
> 
> 	CYGWIN_BINMODE, CYGWIN_NOBINMODE
> 	CYGWIN_TITLE, CYGWIN_NOTITLE
> 	etc.
> 
> These settings are similar to those found in Sergey's recent coolview
> release except that it is possible to say CYGWIN_NOTITLE as well as
> CYGWIN_TITLE.

Can the list of variables be expanded by the user? I'd like to be able
to do things like setting PYTHONPATH (or just PATH) to an arbitrary
value depending on the exe, and the version of the exe, I'm running. 
 
> Which leads into another source of discussion.  I would prefer something
> like this for setting these options:
> 
> 	set CYGWIN32=binmode notitle tty
> 
> rather than:
> 
> 	set CYGWIN_BINMODE=1
> 	set CYGWIN_TTY=1
> 	set CYGWIN_NOTITLE=1
> 
> My current patch allows both uses but it would probably better to stick
> with one.
> 
> Here are the pros and cons as we see them so far:
> 
> 1) Registry
> 
>     Pros:
> 
> 	a)  Don't need to mess with system environment variables.
> 
> 	b)  Allows pinpoint control of what program gets what options, e.g.
> 	    setting `tty' on for bash means that bash always starts with
> 	    a true /dev/tty.  Other programs run from the command line will
> 	    not also use tty handling as seen when using the CYGWIN_TTY
> 	    environment variable.
> 
> 	c)  "Solves" the problem of programs, ported from UNIX, which need
> 	    to use `binmode' by default.
> 
>     Cons:
> 
> 	a)  May slow down process startup slightly (I haven't noticed this
> 	    in simple tests, though).
> 
> 	b)  Contributes to creeping featuritis.
> 
> 	c)  The BINMODE option is nice, but may delay true port of a
> 	    product in favor of a "SET CYGWIN_BINMODE" band-aid.
> 
> 2) CYGWIN32
> 
>     Pros:
> 
> 	a)  Minimizes environment variable name space pollution.
> 
> 	b)  Mirrors proposed registry options syntax.
> 
> 	c)  More intuitive?
> 
>     Cons:
> 
> 	a)  May be harder to test for in shell scripts.
> 
> 	b)  Less intuitive?
> 
> I'd appreciate any and all feedback on this.  Please send comments to the list
> in general.
> 
> Thanks.

Naively, the cygwin32 form seems most appealing. But that depends on
the expandability of the list and if the list can be different for
each exe.

Hope this helps, Alan

> -- 
> http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
> VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Feedback needed on proposed cygwin feature
@ 1997-12-01  5:09 Earnie Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Earnie Boyd @ 1997-12-01  5:09 UTC (permalink / raw)
  To: cgf; +Cc: gnu-win32

Sounds like a great idea.

>From: cgf@bbc.com (Chris Faylor)
>Subject: Feedback needed on proposed cygwin feature
>Date: Mon, 1 Dec 1997 04:12:00 GMT
>To: gnu-win32@cygnus.com
>Reply-To: cgf@bbc.com
>

[snip]

>
>Which leads into another source of discussion.  I would prefer 
something
>like this for setting these options:
>
>	set CYGWIN32=binmode notitle tty

Less environment clutter.  Nice idea.

>
>rather than:
>
>	set CYGWIN_BINMODE=1
>	set CYGWIN_TTY=1
>	set CYGWIN_NOTITLE=1
>
>My current patch allows both uses but it would probably better to stick
>with one.
>
>Here are the pros and cons as we see them so far:
>
>1) Registry
>
>    Pros:
>
>	a)  Don't need to mess with system environment variables.
>
>	b)  Allows pinpoint control of what program gets what options, e.g.
>	    setting `tty' on for bash means that bash always starts with
>	    a true /dev/tty.  Other programs run from the command line will
>	    not also use tty handling as seen when using the CYGWIN_TTY
>	    environment variable.
>
>	c)  "Solves" the problem of programs, ported from UNIX, which need
>	    to use `binmode' by default.
>

text=binary on by default would be a definite benefit.

>    Cons:
>
>	a)  May slow down process startup slightly (I haven't noticed this
>	    in simple tests, though).
>
>	b)  Contributes to creeping featuritis.
>
>	c)  The BINMODE option is nice, but may delay true port of a
>	    product in favor of a "SET CYGWIN_BINMODE" band-aid.

I see nothing wrong with "What ain't broke don't fix" attitudes.

>
>2) CYGWIN32
>
>    Pros:
>
>	a)  Minimizes environment variable name space pollution.
>

This one gets my vote!

>	b)  Mirrors proposed registry options syntax.
>
>	c)  More intuitive?

Less hassle.

>
>    Cons:
>
>	a)  May be harder to test for in shell scripts.
>

To aid in testing a switch or environment variable could be added to 
turn on debug mode to display the values of the registry variables on 
stderr.  Or, a standalone program to list and modify registry elements 
by a given key?

>	b)  Less intuitive?

Only for those that aren't intuitive.

>
>I'd appreciate any and all feedback on this.  Please send comments to 
the list
>in general.
>
>Thanks.
>-- 
> http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
>VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
>-
>For help on using this list (especially unsubscribing), send a message 
to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>


-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Feedback needed on proposed cygwin feature
@ 1997-12-01  2:03 Chris Faylor
  1997-12-01  9:09 ` Norm Peterson
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: Chris Faylor @ 1997-12-01  2:03 UTC (permalink / raw)
  To: gnu-win32

I have recently provided a patch to Cygnus to provide control of various
environment variable settings on a program by program basis.

Geoffrey has asked that I get feedback on my changes to see if they are
something that is useful to the list as a whole.

My changes cause a program to read the registry for options settings prior
to reading settings from the environment.  So, for instance, you can do
something like this:

	cygwin -o 'c:\bin\bash.exe' binmode notitle

That will set options in the registry which will cause bash to always
use 'binmode' as its default and to never modify the title bar.

The available options are:

	[no]binmode		- Set default open mode
	[no]title		- Display program names on the console
				  title bar
	[no]glob		- [Do not] interpret wild cards on commands
				  run from CMD.
	[no]strip_title		- [Do not] strip the path component of files
				  names displayed in the title bar
	[no]tty			- Attach a UNIX-style tty to the program

All of the above are available as normal CYGWIN_* environment variables:

	CYGWIN_BINMODE, CYGWIN_NOBINMODE
	CYGWIN_TITLE, CYGWIN_NOTITLE
	etc.

These settings are similar to those found in Sergey's recent coolview
release except that it is possible to say CYGWIN_NOTITLE as well as
CYGWIN_TITLE.

Which leads into another source of discussion.  I would prefer something
like this for setting these options:

	set CYGWIN32=binmode notitle tty

rather than:

	set CYGWIN_BINMODE=1
	set CYGWIN_TTY=1
	set CYGWIN_NOTITLE=1

My current patch allows both uses but it would probably better to stick
with one.

Here are the pros and cons as we see them so far:

1) Registry

    Pros:

	a)  Don't need to mess with system environment variables.

	b)  Allows pinpoint control of what program gets what options, e.g.
	    setting `tty' on for bash means that bash always starts with
	    a true /dev/tty.  Other programs run from the command line will
	    not also use tty handling as seen when using the CYGWIN_TTY
	    environment variable.

	c)  "Solves" the problem of programs, ported from UNIX, which need
	    to use `binmode' by default.

    Cons:

	a)  May slow down process startup slightly (I haven't noticed this
	    in simple tests, though).

	b)  Contributes to creeping featuritis.

	c)  The BINMODE option is nice, but may delay true port of a
	    product in favor of a "SET CYGWIN_BINMODE" band-aid.

2) CYGWIN32

    Pros:

	a)  Minimizes environment variable name space pollution.

	b)  Mirrors proposed registry options syntax.

	c)  More intuitive?

    Cons:

	a)  May be harder to test for in shell scripts.

	b)  Less intuitive?

I'd appreciate any and all feedback on this.  Please send comments to the list
in general.

Thanks.
-- 
http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~1997-12-05  8:07 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-02  6:11 Feedback needed on proposed cygwin feature Chris Faylor
  -- strict thread matches above, loose matches on Subject: below --
1997-12-04 17:09 Chris Faylor
1997-12-04 17:07 Michael Anthon
1997-12-05  8:07 ` Chris Faylor
1997-12-02 20:23 Earnie Boyd
1997-12-02 16:54 dahms
1997-12-03  7:38 ` Theodore Jump
1997-12-02  9:41 marcus
1997-12-03  6:00 ` Tomas Fasth
1997-12-03 18:36   ` Chris Faylor
1997-12-04 13:02     ` Tomas Fasth
1997-12-05  8:07       ` Chris Faylor
1997-12-03  7:38 ` Chris Faylor
1997-12-02  7:22 Chris Faylor
1997-12-01 22:51 Chris Faylor
1997-12-01 22:51 Chris Faylor
1997-12-01 22:51 ` Jason Zions
1997-12-01 11:43 JONCKHEERE
1997-12-02  7:23 ` Chris Faylor
1997-12-01  5:09 Earnie Boyd
1997-12-01  2:03 Chris Faylor
1997-12-01  9:09 ` Norm Peterson
1997-12-01 11:47 ` Jason Zions
1997-12-01 22:10 ` Justin Smith
1997-12-01 22:51 ` Theodore Jump
1997-12-01 22:51 ` Michael Hirmke
1997-12-02  7:16   ` Chris Faylor
1997-12-02  9:41     ` Fergus Henderson
1997-12-03  7:38       ` Chris Faylor
1997-12-02  5:17 ` Kimon Kontovasilis

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).