From e1bc907a9213468a27b67a715b46524009daf6fb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 30 Sep 2017 18:06:30 -0700 Subject: Add test for another subst dollar escaping situation. In this case 34120( is getting translated to (escape closings). Since there is no closing $) it fails with error. --- src/engine/SCons/SubstTests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index 6604128..fcd77df 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -336,6 +336,10 @@ class scons_subst_TestCase(SubstTestCase): # Test double-dollar-sign behavior. "$$FFF$HHH", "$FFFIII", + # Test double-dollar-sign before open paren. It's not meant + # to be signature escaping + 'echo $$(pwd) > XYZ', 'echo $(pwd) > XYZ', + # Test that a Literal will stop dollar-sign substitution. "$XXX $LITERAL $FFF", "GGG $XXX GGG", -- cgit v0.12 From f7a846e6c44b3ae20f8575c9823fc7cbe6d920d7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 30 Sep 2017 18:13:07 -0700 Subject: add fix for mistaking $$( for $( and breaking subst. Reported by Noah Hoffman noah.hoffman at gmail.com in: https://pairlist4.pair.net/pipermail/scons-users/2017-September/006352.html --- src/CHANGES.txt | 6 ++++++ src/engine/SCons/Subst.py | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0e742ec..3b717ff 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -15,6 +15,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fixed a regression in scons-3.0.0 where "from __future__ import print_function" was imposed on the scope where SConstruct is executed, breaking existing builds using PY 2.7. + From William Deegan: + - Fix broken subst logic where a string with "$$(abc)" was being treated as "$(abc) and the + logic for removing the signature escapes was then failing because there was no closing "$)". + This was introduced by a pull request to allow recursive variable evaluations to yield a string + such as "$( $( some stuff $) $)". + RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 NOTE: This is a major release. You should expect that some targets may rebuild when upgrading. diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index a68b54d..68d247f 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -338,7 +338,10 @@ SUBST_RAW = 1 SUBST_SIG = 2 _rm = re.compile(r'\$[()]') -_rm_split = re.compile(r'(\$[()])') + +# Note the pattern below only matches $( or $) when there is no +# preceeding $. (Thus the (?