From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>, 24956@debbugs.gnu.org
Subject: bug#24956: 26.0.50; On Windows, setting PATH in compilation-environment has no effect
Date: Thu, 17 Nov 2016 16:27:17 -0500 [thread overview]
Message-ID: <CAM-tV-8oAM8aqfkQtE0o0PF6wG5tZqzZ4JqiiqNR_ZPms3rbkA@mail.gmail.com> (raw)
In-Reply-To: <83k2c1esbp.fsf@gnu.org>
On Thu, Nov 17, 2016 at 3:59 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Noam Postavsky <npostavs@users.sourceforge.net>
>> Date: Thu, 17 Nov 2016 12:59:19 -0500
>> Cc: 24956@debbugs.gnu.org
>>
>> > (let ((compilation-environment (list "PATH=d:\\foo")))
>> > (compile "echo %PATH%"))
>> >
>> > The output is the original contents of PATH. Until recently (June, at
>> > least) it was possible to set PATH in compilation-environment and pass
>> > it to child processes. On GNU/Linux, it still is.
>>
>> It seems that my change in 73f0715d "Keep w32 environment settings
>> internal only", had an unexpected effect on the way differently cased
>> environment variables are handled.
>>
>> With latest master
>>
>> (let ((process-environment (cons "PATH=d:\\foo" process-environment)))
>> (call-process "cmd" nil '(t t) nil "/C" "echo %PATH%"))
>>
>> inserts the original PATH contents, whereas
>>
>> (let ((process-environment (cons "Path=d:\\foo" process-environment)))
>> (call-process "cmd" nil '(t t) nil "/C" "echo %PATH%"))
>>
>> inserts "d:\foo". In Emacs 25.1, or reverting the commit I mentioned,
>> the opposite occurs.
>
> I think this is because PATH doesn't exist in the original environment
> inherited from the shell, only Path does. We push PATH into the
> environment only in w32.c:init_environment (and do the same trick with
> ComSpec vs COMSPEC). But since the above-mentioned change, that
> function no longer affects process-environment.
>
> So to fix this bug, we need to push PATH and COMSPEC into
> process-environment, replacing their camel-case variants.
>
> Does this make sense?
Yes. https://cygwin.com/cygwin-ug-net/using-cygwinenv.html lists a few
other variables that it upcases (at the bottom of the page), should we
do those ones as well?
next prev parent reply other threads:[~2016-11-17 21:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 22:22 bug#24956: 26.0.50; On Windows, setting PATH in compilation-environment has no effect Óscar Fuentes
2016-11-17 17:59 ` Noam Postavsky
2016-11-17 20:59 ` Eli Zaretskii
2016-11-17 21:27 ` Noam Postavsky [this message]
2016-11-18 9:46 ` Eli Zaretskii
2016-11-18 22:11 ` Noam Postavsky
2016-11-19 7:16 ` Eli Zaretskii
2016-11-21 23:19 ` Noam Postavsky
2016-11-22 16:01 ` Eli Zaretskii
2016-11-22 22:35 ` Noam Postavsky
2016-11-23 16:07 ` Eli Zaretskii
2016-11-27 20:01 ` Óscar Fuentes
2016-11-27 20:13 ` npostavs
2016-11-28 22:53 ` Noam Postavsky
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=CAM-tV-8oAM8aqfkQtE0o0PF6wG5tZqzZ4JqiiqNR_ZPms3rbkA@mail.gmail.com \
--to=npostavs@users.sourceforge.net \
--cc=24956@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=ofv@wanadoo.es \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.