X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 876333858D1E
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
 spf=none smtp.mailfrom=systematicsw.ab.ca
X-Authority-Analysis: v=2.4 cv=IaOU5Ema c=1 sm=1 tr=0 ts=62031ce0
 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17
 a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=sw0zEMgVmqyQ86me2nEA:9 a=QEXdDO2ut3YA:10
Message-ID: <f2da839b-5304-2c5d-9e5b-083fadfe3768@SystematicSw.ab.ca>
Date: Tue, 8 Feb 2022 18:46:07 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.5.1
Subject: Re: CygwinPaltform Identification
Content-Language: en-CA
To: cygwin@cygwin.com
References: <337301d81d37$7afda680$70f8f380$@gmail.com>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Organization: Systematic Software
In-Reply-To: <337301d81d37$7afda680$70f8f380$@gmail.com>
X-CMAE-Envelope: MS4xfFtZV3EpM7to9SkFAr0fegYB13oIsqCAyZH92W+V3xJHvHvouNxt1o6DC+gkcdhvcHfcg1X7mqKQXAW5C6wNyxFn2VmVHAMxGOKbwTVAdhrMxGzXEEac
 FC/ZRT6o7+IgOUe6IR6VRntMAc5aglHuDnvfFHf7DsAOfkLKGOyz3QREtqSlabaKECmjfQtmcCKMT4VX5sVyxtrYkt3MfupJJeo=
X-Spam-Status: No, score=-1163.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Reply-To: cygwin@cygwin.com
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

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
