[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #1727: chicken-install srfi-18 fails on Windows
From: |
Chicken Trac |
Subject: |
Re: #1727: chicken-install srfi-18 fails on Windows |
Date: |
Sun, 11 Apr 2021 17:41:06 -0000 |
#1727: chicken-install srfi-18 fails on Windows
------------------------------------+---------------------
Reporter: Josh Helzer | Owner: (none)
Type: defect | Status: new
Priority: major | Milestone: someday
Component: unknown | Version: 5.2.0
Resolution: | Keywords:
Estimated difficulty: |
------------------------------------+---------------------
Comment (by Vasilij Schneidermann):
I've looked into this today and discovered that we might need to do a
breaking change. Windows handles quoting differently when applied to
environment variables:
{{{
C:\Users\me> set JAVA="C:\path\to\java"
C:\Users\me> echo %JAVA%
"C:\path\to\java"
C:\Users\me> echo "%JAVA%"
""C:\path\to\java""
C:\Users\me> %JAVA% -version
openjdk version "11.0.8" 2020-07-14
[...]
C:\Users\me> "%JAVA%" -version
'""C:' is not recognized as an internal or external command,
operable program or batch file.
}}}
In fact, quotes aren't permitted in paths. If I inspect the environment
variables on my Windows machine, it may look like this:
{{{
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;[...]
}}}
Which is not what {{{egg-compile.scm}}} does:
{{{
(printf #<<EOF
@echo off~%
set PATH=~a;%PATH%
set CHICKEN_CC=~a
set CHICKEN_CXX=~a
set CHICKEN_CSC=~a
set CHICKEN_CSI=~a
EOF
(qs* default-bindir platform) (qs* default-cc platform)
(qs* default-cxx platform) (qs* default-csc platform)
(qs* default-csi platform))
}}}
{{{default-bindir}}} should not be quoted at all. According to
https://ss64.com/nt/set.html, the {{{set}}} command should instead quote
its entire argument, including the name. The above session again, but with
correct quoting:
{{{
C:\Users\me> set "JAVA=C:\path\to\java"
C:\Users\me> echo %JAVA%
C:\path\to\java
C:\Users\me> echo "%JAVA%"
"C:\path\to\java"
C:\Users\me> %JAVA% -version
'""C:' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\me> "%JAVA%" -version
openjdk version "11.0.8" 2020-07-14
[...]
}}}
I believe that to be the correct behavior and am willing to write a patch
to implement it. However it will require every single egg installable on
Windows to use quoting for the {{{CHICKEN_CSC}}}, {{{CHICKEN_CSI}}},
{{{CHICKEN_CC}}} and {{{CHICKEN_CXX}}} variables, otherwise the scripts
will break on every installation that contains spaces in its installation
path. On the upside, this would relieve me from fixing the above six
scripts, five of which I'm directly responsible for :)
--
Ticket URL: <https://bugs.call-cc.org/ticket/1727#comment:3>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- Re: #1727: chicken-install srfi-18 fails on Windows,
Chicken Trac <=
- Re: #1727: chicken-install srfi-18 fails on Windows, Chicken Trac, 2021/04/11
- Re: #1727: chicken-install srfi-18 fails on Windows, Chicken Trac, 2021/04/11
- Re: #1727: chicken-install srfi-18 fails on Windows, Chicken Trac, 2021/04/19
- Re: #1727: chicken-install srfi-18 fails on Windows, Chicken Trac, 2021/04/21
- Re: #1727: chicken-install srfi-18 fails on Windows, Chicken Trac, 2021/04/21