DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 50D95ZQj2759962 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 50D95ZQj2759962 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=y7gGxk/8 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57C3B385770D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1736759133; bh=JQ8VvQNjLJM7xWfvMan7SEbHXyO1XxUV0458HuG20AI=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y7gGxk/8Mwfa3RgW6lq7QPqEbTtfjz7vGKgq6XWJ79OmJlHEJJKByHPL9u/GhjelX 5ZkFoCuiq71M0J0V6Qln94JS5Z1/xdwf+9DU6CN7iOvCed9i8iQbbSraGKRoqoQXLQ jjP7MEY8NtEhN9U55A5OBAgkCGGebE1K2Cd55Jp4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4A13D385841F ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4A13D385841F ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736759105; cv=none; b=d3ZDT4X7Xf0iFiZ8C9Zu2Tkf/WThg0QK20mxB3GgQj5JxZ/nMsBNYqz36sJiewQ9Cydo3gFbYk3IXfE5ZzGZTjOc3KYfAnQwfgM+U9nOMIJb6lU1LR8PQm8UxN0nZp6m/Zf2EfBQ0D7ZnAAhiXaUDL6DnyP1mC//Fo97FasXBQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736759105; c=relaxed/simple; bh=PFVZuNNp0I43Mzd+9YCccBvtrI16qhRyyu3YIamIXWg=; h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version; b=MTVcltDq1m0+r0GsQyKWC/VIBGcPzd2YpruBzKrswCGvd3WBvFD7jtHk1ho5o/mdtLkNYyrV7Nw95vVKkLoOZbpIVQjCYFOobt1aS9HIC0pZuK6gH3sJyO9IRZTGNfco1/7JcYrMGg9nMGCaoj1bYCeR1beVNOBziq9TWXaqxWE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A13D385841F X-Yandex-Fwd: 1 Date: Mon, 13 Jan 2025 11:59:46 +0300 X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <1056238423.20250113115946@yandex.ru> To: Federico Kircheis , cygwin AT cygwin DOT com Subject: Re: env and PATH In-Reply-To: <9375d5cd-792e-45f4-958b-40521d15afd5@kircheis.it> References: <77a3709d-ec4d-497b-bf6c-75f29dc8c992 AT kircheis DOT it> <1756102695 DOT 20250104044139 AT yandex DOT ru> <21a99c98-1a16-4ffb-97f4-fa9480f7b02d AT kircheis DOT it> <383539154 DOT 20250104231316 AT yandex DOT ru> <123712861 DOT 20250109103130 AT yandex DOT ru> <9375d5cd-792e-45f4-958b-40521d15afd5 AT kircheis DOT it> MIME-Version: 1.0 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrey Repin via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Andrey Repin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Greetings, Federico Kircheis! > On 09/01/2025 08.31, Andrey Repin wrote: >> The apparent issue you are missing is that you are calling native app from >> Cygwin environment. >> Each have its own rules, and to have it working with minimal issues, you'd >> need to satisfy both sides. >> In specific case, PATH is a special environment variable for both sides, and >> you have to correctly translate it from one side to the other. > What do you mean? > I'm perfectly aware that PATH is special, and why it is, I also wrote it in the first mail. It is special TO BOTH SIDES. The "both" is the key word. > I questioned the statement that the conversion is expected _because_ `env` > expects POSIX semantics and parsed my command according to that. No, it is expected because of its meaning to both sides AND because env don't know, what kind of program it is running. Runtime knows, env does not. Runtime does conversion, not env. > Since POSIX says nothing about the interaction of env and PATH, Why it should? This is Cygwin specifics. > and conversions are not described by the standard (as you confirmed), the > behavior is expected because of what cygwin does, not because of POSIX. (and > yes, I knew cygwin does the conversion from cygwin PATH to Windows PATH, so > that was expected, I did not expect it to break a Windows PATH and to depend > on the current drive) env don't expect Windows paths to begin with. And dependency on current drive is coincidental, since your paths, read as POSIX, were interpreted as relative. > The main question of this thread was: > "I noticed that PATH is converted, and cannot find a switch do disable this > conversion. Is it possible to define an environment and use it as is, > without having some implicit conversions?" > I mean, there are other variables that have special meanings; all those that define a path. > (Examples would be HOME, XDG_CACHE_HOME, XDG_DATA_HOME, ...) Special to both sides? While HOME and TMP do have a meaning to both sides (though, HOME is questionable), XDG_* ones are purely *NIX specific. > The answer seems to be no (which was what I feared). > Thus special casing for some environment variables is necessary as there is no such switch. > I saw PATH as particularly problematic because I was not aware of the option --path of cygpath. >> I provided a wrapper script I use myself, you could add any massaging to it >> that you feel necessary. Like `unset TERM` or PATH modifications. > Attachment seems to be missing, Was not an attachment. (The list is not very tolerant to those.) > but I think unsetting environment variables > one by one, changing existing, and adding the missing, is too error-prone. > Defining a "clean" environment once seems to have less chances to have some errors. That's up to you. I have more intricate wrappers than this one. Just didn't want to flood the list. -- With best regards, Andrey Repin Monday, January 13, 2025 11:01:39 Sorry for my terrible english... -- 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