This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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

Created on 2019-03-08 21:28 by Jess, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12241 merged Jess, 2019-03-08 21:47
PR 12484 merged miss-islington, 2019-03-21 16:03
PR 12591 merged steve.dower, 2019-03-27 15:43
PR 12592 merged steve.dower, 2019-03-27 15:46
PR 12595 merged miss-islington, 2019-03-27 23:28
Messages (15)
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.
msg338552 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-21 16:03
New changeset 7ee88bf3e59493137a775368165c5c5fe1ed7f46 by Steve Dower (Jess) in branch 'master':
bpo-36245: Avoid problems when building in a directory containing spaces. (GH-12241)
https://github.com/python/cpython/commit/7ee88bf3e59493137a775368165c5c5fe1ed7f46
msg338553 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-21 16:05
Fixed for 3.7 and master.

If it needs to go into 2.7 then someone will need to backport it manually.
msg338554 - (view) Author: miss-islington (miss-islington) Date: 2019-03-21 16:25
New changeset b058a97c90c3144cc602b719483572916b3918bb by Miss Islington (bot) in branch '3.7':
bpo-36245: Avoid problems when building in a directory containing spaces. (GH-12241)
https://github.com/python/cpython/commit/b058a97c90c3144cc602b719483572916b3918bb
msg338971 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-27 15:48
I did the 2.7 backport, and also fixed two more instances in that file.

Pretty sure my automerges won't work without a core dev review, so if someone wants to hit Approve and/or Merge for me, feel free.
msg338995 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-27 23:28
New changeset bb89aa24cf71f9874d1d26f3a2440fefa0b6bbcc by Steve Dower in branch '2.7':
bpo-36245: Avoid problems when building in a directory containing spaces. (GH-12241)
https://github.com/python/cpython/commit/bb89aa24cf71f9874d1d26f3a2440fefa0b6bbcc
msg338996 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-27 23:28
New changeset b95a79c928fc4a6135d91c0c553cb2a63cf15140 by Steve Dower in branch 'master':
bpo-36245: Fix more empty environment variable checks (GH-12592)
https://github.com/python/cpython/commit/b95a79c928fc4a6135d91c0c553cb2a63cf15140
msg338999 - (view) Author: miss-islington (miss-islington) Date: 2019-03-28 00:01
New changeset 1ff04dcadfb57a8a8f61a6ea93292e8ae96dca4a by Miss Islington (bot) in branch '3.7':
bpo-36245: Fix more empty environment variable checks (GH-12592)
https://github.com/python/cpython/commit/1ff04dcadfb57a8a8f61a6ea93292e8ae96dca4a
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80426
2019-03-28 00:01:33miss-islingtonsetmessages: + msg338999
2019-03-27 23:29:29steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-03-27 23:28:55miss-islingtonsetpull_requests: + pull_request12538
2019-03-27 23:28:43steve.dowersetmessages: + msg338996
2019-03-27 23:28:36steve.dowersetmessages: + msg338995
2019-03-27 15:48:12steve.dowersetmessages: + msg338971
2019-03-27 15:46:12steve.dowersetpull_requests: + pull_request12535
2019-03-27 15:43:57steve.dowersetstage: backport needed -> patch review
pull_requests: + pull_request12534
2019-03-21 16:25:24miss-islingtonsetnosy: + miss-islington
messages: + msg338554
2019-03-21 16:05:22steve.dowersetstage: patch review -> backport needed
messages: + msg338553
versions: - Python 3.4, Python 3.5, Python 3.6
2019-03-21 16:03:21miss-islingtonsetpull_requests: + pull_request12437
2019-03-21 16:03:09steve.dowersetmessages: + msg338552
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