Project

General

Profile

Actions

Bug #13582

closed

wsdiff does not like non-proto directories

Added by Andy Fiddaman over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

If you use wsdiff against arbitrary directory trees, rather than against a workspace, it produces a backtrace:

From Rich Lowe:

; find old
old
old/root_i386
old/root_i386/libumem.so.1
old/root_i386/64
old/root_i386/64/libumem.so.1
; find new
new
new/root_i386
new/root_i386/64
new/root_i386/64/libumem.so.1
new/root_i386/libumem.so.1
; wsdiff -vVr 99.log old new
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/opt/onbld/bin/wsdiff", line 1298, in run
    compareOneFile(base, ptch, False)
  File "/opt/onbld/bin/wsdiff", line 1316, in compareOneFile
    fileName = fnFormat(base)
  File "/opt/onbld/bin/wsdiff", line 306, in fnFormat
    if len(os.path.commonprefix([fn, baseWsRoot])) == len(baseWsRoot):
  File "/usr/lib/python3.5/genericpath.py", line 72, in commonprefix
    s1 = min(m)
TypeError: unorderable types: NoneType() < str()

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/opt/onbld/bin/wsdiff", line 1298, in run
    compareOneFile(base, ptch, False)
  File "/opt/onbld/bin/wsdiff", line 1316, in compareOneFile
    fileName = fnFormat(base)
  File "/opt/onbld/bin/wsdiff", line 306, in fnFormat
    if len(os.path.commonprefix([fn, baseWsRoot])) == len(baseWsRoot):
  File "/usr/lib/python3.5/genericpath.py", line 72, in commonprefix
    s1 = min(m)
TypeError: unorderable types: NoneType() < str()

Actions #1

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1286
Actions #2

Updated by Andy Fiddaman over 2 years ago

I've tested this change by running wsdiff on the directory structure that showed up the problem (as noted earlier in the ticket).
I also regression tested by running against full proto directories, from the root and against subdirectories within, and against renamed protos. Results were the same before and after this change, except that the backtrace no longer occurs for the problem case.

Actions #3

Updated by Electric Monk over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 7713a0580ffd38602449546f743c4eaccdeff06d

commit  7713a0580ffd38602449546f743c4eaccdeff06d
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2021-02-27T00:19:45.000Z

    13582 wsdiff does not like non-proto directories
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Rich Lowe <richlowe@richlowe.net>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF