You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2022/06/30 03:49:16 UTC

[impala] 02/02: IMPALA-11403: Fix cmake escaping for sed regex in common/thrift

This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit bb610dee09a8069bb993b4c668f7e481c1774b70
Author: Laszlo Gaal <la...@cloudera.com>
AuthorDate: Mon Jun 27 22:28:07 2022 +0200

    IMPALA-11403: Fix cmake escaping for sed regex in common/thrift
    
    common/thrift/CMakeLists.txt contains a sed command line with a captured
    group. This sed construct uses a single backslash ('\1'), which was
    entered verbatim into CMakeLists.txt. The backslash character is however
    an escape character for cmake as well, so it reported a warning about
    incorrect escaping syntax when processing this file.
    Fortunately the generated Makefile output was still correct.
    
    The patch doubles the backslashes in the sed command line to escape them
    correctly according to cmake's syntax rules.
    
    Tested by running `./buildall.sh -cmake_only` on the changed file and
    verifying that
    - the warning is eliminated
    - the generated output still contained the expected sed regex.
    
    Change-Id: I8785fa0500d3a296f98efb973c6ce0737a02e8bb
    Reviewed-on: http://gerrit.cloudera.org:8080/18678
    Reviewed-by: Michael Smith <mi...@cloudera.com>
    Reviewed-by: Riza Suminto <ri...@cloudera.com>
    Reviewed-by: Zoltan Borok-Nagy <bo...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 common/thrift/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/thrift/CMakeLists.txt b/common/thrift/CMakeLists.txt
index 0c12b692b..c86a6e1c4 100644
--- a/common/thrift/CMakeLists.txt
+++ b/common/thrift/CMakeLists.txt
@@ -236,7 +236,7 @@ add_custom_target(thrift-ext-data-src ALL DEPENDS ${THRIFT_DATA_SRC_FILES})
 add_dependencies(thrift-ext-data-src thrift-cpp)
 
 add_custom_target(thrift-cpp-manual-edit
-  COMMAND sed -i.bak "'s|\(dispatchCallTemplated.*\));|\1) override;|'"
+  COMMAND sed -i.bak "'s|\\(dispatchCallTemplated.*\\));|\\1) override;|'"
       ${BE_OUTPUT_DIR}/gen-cpp/ImpalaHiveServer2Service.h
       ${BE_OUTPUT_DIR}/gen-cpp/ImpalaService.h
       COMMENT "IMPALA-11384: Manual override on ImpalaHiveServer2Service.h and ImpalaService.h"