public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: julie77793@gmail.com
To: <cygwin@cygwin.com>
Subject: RE: CygwinPaltform Identification
Date: Tue, 8 Feb 2022 21:13:03 -0700	[thread overview]
Message-ID: <05f301d81d6b$55d8d710$018a8530$@gmail.com> (raw)
In-Reply-To: <f2da839b-5304-2c5d-9e5b-083fadfe3768@SystematicSw.ab.ca>

I realize that I can create my own env variables. I just think that Cygwin
should provide them so that programmers writing software can rely on the
variable name and value. If there is no consistent value when Cygwin is
installed then dozens of tools that work on other bash solutions for Windows
can't be made to work on Cygwin.

-----Original Message-----
From: Cygwin <cygwin-bounces+cygwin=prettywhack.com@cygwin.com> On Behalf Of
Brian Inglis
Sent: Tuesday, February 8, 2022 6:46 PM
To: cygwin@cygwin.com
Subject: Re: CygwinPaltform Identification

On 2022-02-08 15:01, julie77793@gmail.com wrote:
> Cygwin doesn't create an environment variable in bash to indicate that 
> the platform is Cygwin under Windows.
> This causes compatibility problems when running various tools. Most of 
> my issues have been with Python tools running Windows Python.
> I have been addressing this issue by grepping PATH for cygdrive which 
> doesn't seem like a very good approach.
> Both msys2 and mingw solve this issue by setting the MSYSTEM 
> environment variable which lets tools check that OS=Windows_NT and 
> MSYSTEM=MSYS Please add some way of identifying that programs are running
under Cygwin.

I have been switching env/OS/arch/triple dependent profile and rc files and
sections for years with:

64 $ echo $OSTYPE $OS $HOSTTYPE $MACHTYPE cygwin Windows_NT x86_64
x86_64-unknown-cygwin

32 $ echo $OSTYPE $OS $HOSTTYPE $MACHTYPE cygwin Windows_NT i686
i686-pc-cygwin

Please note that *only* $OS is exported by default (in the above list), so
you will have to explicitly export (in profiles) any other shell variables
you wish to be available to shell subprocesses.

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains too much
technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

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


  reply	other threads:[~2022-02-09  4:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 22:01 Bug Report julie77793
2022-02-08 22:22 ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-02-09  1:46 ` CygwinPaltform Identification Brian Inglis
2022-02-09  4:13   ` julie77793 [this message]
2022-02-09  6:07     ` Allen Hewes
2022-02-09  8:10     ` Cygwin Platform Identification Brian Inglis
2022-02-09  9:12   ` CygwinPaltform Identification Henry S. Thompson
2022-02-09 10:01     ` Cygwin Platform Identification Brian Inglis
2022-02-09  6:29 ` Bug Report Ernie Rael
2022-02-09 16:24 ` Bill Stewart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='05f301d81d6b$55d8d710$018a8530$@gmail.com' \
    --to=julie77793@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).