classification
Title: PCBuild/build.bat errors, probably from space characters in paths
Type: compile error Stage: patch review
Components: Build, Windows Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: Jess, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2019-03-08 21:28 by Jess, last changed 2019-03-18 12:42 by steve.dower.

Pull Requests
URL Status Linked Edit
PR 12241 open Jess, 2019-03-08 21:47
Messages (8)
msg337530 - (view) Author: Jess (Jess) * Date: 2019-03-08 21:28
Have a fix for this that I'll send off shortly.

What I see with the current head (my username was replaced with "Foo Bar" in this example:
> Using "C:\Users\Foo Bar\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe" (found in externals directory)
> Bar\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe""=="" was unexpected at this time.

My theory, window's turning:
> C:\Users\Foo Bar
into
> "C:\Users\Foo Bar"
and this is colliding with our use of "%PYTHON%", creating double quotes, or:
> ""C:\Users\Foo Bar""
which, of course:
> if ""C:\Users\Foo Bar""==""
does not make sense as a statement.
msg337531 - (view) Author: Jess (Jess) * Date: 2019-03-08 21:29
Note: the error is actually in get_externals.bat, which is called by build.bat.
msg337544 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-08 23:11
Since the checks are all against empty strings, perhaps we can use "IF NOT DEFINED PYTHON" instead? That should work as well, I think, and it'll save us from problems in the future if someone puts "]" in their username :)
msg337959 - (view) Author: Jess (Jess) * Date: 2019-03-15 01:01
Alas, "IF NOT DEFINED PYTHON" isn't working - as it's even more possible to get into a state where PYTHON="" than it is for a bracket to be in the python name.

Thus, the system would think it declared where we would have created it into an actual path otherwise.
msg337960 - (view) Author: Jess (Jess) * Date: 2019-03-15 01:14
Looks like the brackets are fine even in the bracket case Steve mentioned.

@echo off

if NOT DEFINED ABCDEF (
  echo "all good"
)

if NOT DEFINED ABCDE (
  echo "all good2"
)

set ABCDE=

if NOT DEFINED ABCDE (
  echo "sadness"
)

if [%ABCDE%]==[] (
  echo "all good3"
)

set ABCDE=]

if [%ABCDE%] NEQ [] (
  echo "all good4"
)

set ABCDE="]"

if [%ABCDE%] NEQ [] (
  echo "all good5"
)


>demo.bat
"all good"
"sadness"
"all good3"
"all good4"
"all good5"
msg337962 - (view) Author: Jess (Jess) * Date: 2019-03-15 01:25
Nevermind, the hold over issue was from another bit.

Updated the change request.
msg338142 - (view) Author: Jess (Jess) * Date: 2019-03-17 21:40
How long should I be waiting on review?
msg338215 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-18 12:42
For this one you're probably waiting on me to get time. I try to find an hour or two each week, depending on what releases are going on, but it can be a little unpredictable.

Zachary could also review and merge if he gets time first. I don't think anyone else is likely to look at this.
History
Date User Action Args
2019-03-18 12:42:51steve.dowersetassignee: steve.dower
messages: + msg338215
2019-03-17 21:40:13Jesssetmessages: + msg338142
2019-03-15 01:25:42Jesssetmessages: + msg337962
versions: + Python 2.7, Python 3.4, Python 3.5, Python 3.6
2019-03-15 01:14:39Jesssetmessages: + msg337960
2019-03-15 01:01:57Jesssetmessages: + msg337959
2019-03-08 23:11:59steve.dowersetcomponents: + Build
versions: + Python 3.7, Python 3.8
2019-03-08 23:11:43steve.dowersetmessages: + msg337544
2019-03-08 21:47:40Jesssetkeywords: + patch
stage: patch review
pull_requests: + pull_request12229
2019-03-08 21:29:32Jesssetmessages: + msg337531
2019-03-08 21:28:39Jesscreate