You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "harinreddy (Code Review)" <ge...@cloudera.org> on 2022/04/05 14:54:40 UTC

[kudu-CR] This commit will fix python 3.x failure in dep extract.py

Hello Andrew Wong,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/18384

to review the following change.


Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................

This commit will fix python 3.x failure in dep_extract.py

Description:
The following script fails:
kudu/build-support/mini-cluster/build_mini_cluster_binaries.sh

with the following error:
Stacktrace…
 ../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py
../build/mini-cluster kudu kudu-tserver kudu-master
2022-03-23 17:57:58,557 INFO: Including target 'kudu' out of
'['kudu', 'kudu-tserver', 'kudu-master']' and its dependencies in archive...
2022-03-23 17:57:58,652 INFO: Attempting to relocate sasl2 modules...
Traceback (most recent call last):
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 501, in <module>
    main()
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 498, in main
 relocate_deps(target_src, target_dst, config)
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 404, in relocate_deps
    return relocate_deps_linux(target_src, target_dst, config)
  File "../build-support/mini-cluster/relocate_binaries_for_mini_cluster.py",
line 340, in relocate_deps_linux
    libs = dep_extractor.extract_deps(target_src)
  File "../build-support/mini-cluster/../../build-support/dep_extract.py",
line 108, in extract_deps
    match = LDD_RE.match(line)
TypeError: cannot use a string pattern on a bytes-like object

This error is traced to line 108 in the file
kudu/build-support/dep_extract.py

      match = LDD_RE.match(line)

Proposed fix:

The “re” function expects ASCII character string. In python 2.x
the default treatment of charters follows ASCII standard. However,
in python 3.x the default encoding follows the UTF-8 standard.
This leads to a failure in python 3.X when the UTF-8 encoded
character objects are used as arguments to functions such as “re”.
The recommended fix is to decode the string before it is passed
as an argument to the ‘re’ call, and this works with both
 python 2.x as well as python 3.x.

Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
---
M build-support/dep_extract.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/84/18384/1
-- 
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 1
Gerrit-Owner: harinreddy <hn...@us.ibm.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>

[kudu-CR] This commit will fix python 3.x failure in dep extract.py

Posted by "harinreddy (Code Review)" <ge...@cloudera.org>.
harinreddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/18384 )

Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................


Patch Set 2:

Thanks Alexey, for looking into this. Looks like this may be Python 2.7 vs python 3.6 conflict?
My simple fix may have broken things other places. A few questions/comments: 1) should this  patch be dropped and wait for the community to migrate from Python 2.7 to Python 3.x? 2) if it should work, I am new to Kudu and need some help to debug this.
Thanks


-- 
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 2
Gerrit-Owner: harinreddy <hn...@us.ibm.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Andrew Wong <an...@g.ucla.edu>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: harinreddy <hn...@us.ibm.com>
Gerrit-Comment-Date: Thu, 14 Jul 2022 15:25:04 +0000
Gerrit-HasComments: No

[kudu-CR] This commit will fix python 3.x failure in dep extract.py

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18384 )

Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/18384/2/build-support/dep_extract.py
File build-support/dep_extract.py:

http://gerrit.cloudera.org:8080/#/c/18384/2/build-support/dep_extract.py@108
PS2, Line 108:       match = LDD_RE.match(line.decode('utf-8'))
I didn't look deep, but from what I can see this change breaks isolate with errors like

flex_partitioning-itest.7  failed to process isolate (isolateDir: /kudu/build/isolate): invalid character '.' after array element

You can see that in http://jenkins.kudu.apache.org/job/kudu-gerrit/26002/BUILD_TYPE=DEBUG/consoleFull



-- 
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 2
Gerrit-Owner: harinreddy <hn...@us.ibm.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Andrew Wong <an...@g.ucla.edu>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 13 Jul 2022 22:20:19 +0000
Gerrit-HasComments: Yes

[kudu-CR] This commit will fix python 3.x failure in dep extract.py

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18384 )

Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................


Patch Set 2:

> Thanks Alexey, for looking into this. Looks like this may be Python
 > 2.7 vs python 3.6 conflict?
 > My simple fix may have broken things other places. A few
 > questions/comments: 1) should this  patch be dropped and wait for
 > the community to migrate from Python 2.7 to Python 3.x? 2) if it
 > should work, I am new to Kudu and need some help to debug this.
 > Thanks

If that's not something very crucial, I'd expect this to be updated when eventually changing the rest of python kudu scripts to work both for python2 and python3 (some of those already do so).

You can abandon this patch, and you can always return it from the 'abandoned' state back in gerrit, if needed.


-- 
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 2
Gerrit-Owner: harinreddy <hn...@us.ibm.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Andrew Wong <an...@g.ucla.edu>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: harinreddy <hn...@us.ibm.com>
Gerrit-Comment-Date: Fri, 15 Jul 2022 17:44:51 +0000
Gerrit-HasComments: No

[kudu-CR] This commit will fix python 3.x failure in dep extract.py

Posted by "harinreddy (Code Review)" <ge...@cloudera.org>.
harinreddy has abandoned this change. ( http://gerrit.cloudera.org:8080/18384 )

Change subject:  This commit will fix python 3.x failure in dep_extract.py
......................................................................


Abandoned

There seems to be conflict between python 2.7 and 3.6 since not all the python scripts have been updated to work with both 2.6 and 3.6. This commit is dropped so that a more comprehensive evaluation of all python scripts to work with 2.7 and 3.6 can done in the future.
-- 
To view, visit http://gerrit.cloudera.org:8080/18384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ied217653a90a6c4260e889cdfbafa683938acf1e
Gerrit-Change-Number: 18384
Gerrit-PatchSet: 2
Gerrit-Owner: harinreddy <hn...@us.ibm.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Andrew Wong <an...@g.ucla.edu>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: harinreddy <hn...@us.ibm.com>