#1441 closed defect (fixed)

'/usr/bin/tahoe debug --help' gives incorrect information about running coverage on the installed Debian/Ubuntu Tahoe

Reported by: davidsarah Owned by: davidsarah
Priority: minor Milestone: 1.9.0
Component: code-frontend-cli Version: 1.8.2
Keywords: debian ubuntu usability test news Cc:
Launchpad Bug:

Description (last modified by davidsarah)

If current Tahoe were packaged for Debian/Ubuntu, the following information printed by /usr/bin/tahoe debug --help would be wrong:

Another debugging feature is that bin/tahoe allows executing an arbitrary
"runner" command (typically an installed Python script, such as 'coverage'),
with the Tahoe libraries on the PYTHONPATH. The runner command name is
prefixed with '@', and any occurrences of '@tahoe' in its arguments are
replaced by the full path to the tahoe script.

For example, if 'coverage' is installed and on the PATH, you can use:

    bin/tahoe @coverage run --branch @tahoe debug trial

to get branch coverage for the Tahoe test suite. Or, to run python with
the -3 option that warns about Python 3 incompatibilities:

    bin/tahoe @python -3 @tahoe command [options]

The described feature added in #1303 is not supported by the /usr/bin/tahoe script (and isn't needed, because it doesn't indirect through a subprocess). The correct information is:

To get branch coverage for the Tahoe test suite (on the installed copy of
Tahoe), install the 'python-coverage' package and then use:

    python-coverage run --branch /usr/bin/tahoe debug trial

Attachments (1)

fix-1441.darcs.patch (17.2 KB) - added by davidsarah at 2011-07-24T17:30:22Z.
Correct the information printed by '/usr/bin/tahoe debug --help' on Debian/Ubuntu?. fixes #1441

Download all attachments as: .zip

Change History (12)

comment:1 Changed at 2011-07-24T17:13:09Z by davidsarah

  • Description modified (diff)
  • Priority changed from major to minor
  • Status changed from new to assigned

comment:2 Changed at 2011-07-24T17:14:18Z by davidsarah

  • Keywords debian ubuntu added

Changed at 2011-07-24T17:30:22Z by davidsarah

Correct the information printed by '/usr/bin/tahoe debug --help' on Debian/Ubuntu?. fixes #1441

comment:3 Changed at 2011-07-24T17:31:10Z by davidsarah

  • Keywords review-needed added
  • Owner davidsarah deleted
  • Status changed from assigned to new

comment:4 Changed at 2011-08-02T00:25:43Z by davidsarah

  • Keywords news added

Proposed NEWS:

- When running a 'tahoe' script installed by a Debian/Ubuntu package
  of Tahoe-LAFS, 'tahoe debug trial --help' now prints correct
  information about how to run coverage tests. (`#1441`_)

comment:5 Changed at 2011-08-02T17:05:21Z by kevan

  • Owner set to kevan
  • Status changed from new to assigned

comment:6 follow-up: Changed at 2011-08-02T18:05:38Z by kevan

  • Owner changed from kevan to davidsarah
  • Status changed from assigned to new

Looks like you're mixing tabs and spaces in your patch: lines 853 and 860 of debug.py appear to be prefixed by a single tab character in my editor.

The Python docs I can find on the subject say that whether sys.argv[0] is the full path to the script is OS-dependent. Presumably we've established that sys.argv[0] is always the full path on ubuntu and debian systems, but it'd be nice to see the reasoning behind that, either directly in the code or as a comment in this ticket for future reference.

Looks good, otherwise.

comment:7 Changed at 2011-08-02T18:05:58Z by kevan

  • Keywords review-needed removed

comment:8 Changed at 2011-08-11T17:43:05Z by david-sarah@…

  • Resolution set to fixed
  • Status changed from new to closed

In 0dc917af08617a26:

Correct the information printed by '/usr/bin/tahoe debug --help' on Debian/Ubuntu?. fixes #1441

comment:9 Changed at 2011-08-11T17:43:57Z by warner

I added a second patch to fix the tabs-vs-spaces issue, 5aad81f84d288493.

comment:10 in reply to: ↑ 6 Changed at 2011-08-12T00:38:54Z by davidsarah

Replying to kevan:

The Python docs I can find on the subject say that whether sys.argv[0] is the full path to the script is OS-dependent. Presumably we've established that sys.argv[0] is always the full path on ubuntu and debian systems, but it'd be nice to see the reasoning behind that, either directly in the code or as a comment in this ticket for future reference.

Apparently it depends on what the invoking program passes to the exec* call. Linux bash, dash, ksh, zsh and tcsh all pass the full path.

os.readlink('/proc/self/exe') (when it succeeds) will give the full executable path on Linux, but unfortunately that will be the path to the Python interpreter in tahoe's case. Since this is only affecting help text, and since I don't know of any more reliable way to perform this test, I think it is OK as it is in 0dc917af08617a26.

comment:11 Changed at 2011-08-16T22:53:43Z by david-sarah@…

In [5179/ticket393-MDMF-2]:

Correct the information printed by '/usr/bin/tahoe debug --help' on Debian/Ubuntu?. fixes #1441

Note: See TracTickets for help on using tickets.