Brian Warner [Sat, 27 Nov 2010 08:38:09 +0000 (00:38 -0800)]
remove --multiple/-m option from all CLI commands: closes #1262
I personally used "tahoe start/restart -m ../MY-TESTNET/node*" all the time,
to spin up or update a local testgrid while iterating over new code. However,
with the recent switch from "subprocess.Popen(/bin/twistd)" to "import and
call twistd.run()" in scripts/startstop_node.py (yay fewer processes!),
"start -m" broke, and fixing it requires os.fork, which is unavailable on
windows (boo windows!). And I was probably the only one using -m. So in the
interests of uniformity among platforms and simpler code (yay negative code
days!), we're just removing -m from everything. I will start using a little
shell script or something to simulate the removed functionality.
This patch also cleans up CLI-function calling a bit: get the basedir from
the config dict (instead of sometimes from a separate argument), and always
return a numeric exit code.
Brian Warner [Sat, 27 Nov 2010 00:44:11 +0000 (16:44 -0800)]
Revert previous commit: there's an ugly corner-case on windows that fails tests.
Specifically, test_runner.CreateNode.test_client failed, because the
os.fork-is-present test decided that --multiple should not be allowed on
windows, even though --multiple works just fine for 'tahoe create-client'.
The only restriction on --multiple is for 'tahoe start' and 'tahoe restart'.
This needs a different approach, probably by cleaning up BasedirMixin. We
should only be withholding --multiple on windows for "start" and
"restart". (we should continue withholding --multiple on all platforms for
"run").
Brian Warner [Fri, 26 Nov 2010 22:45:38 +0000 (14:45 -0800)]
startstop_node.py: fix "tahoe start -m" by forking before non-final targets
* don't advertise -m flag on tahoe start/restart/run unless os.fork is
available (i.e. windows)
* test_runner.py: add test to exercise "start/stop/restart -m"
david-sarah [Sun, 21 Nov 2010 23:39:57 +0000 (15:39 -0800)]
misc/build_helpers/run_trial.py: allow the module argument to specify a leaf module rather than a directory. This fixes false positive wrong-source errors in the test-from-prefixdir step when we test only allmydata.test.test_runner.
bundled zetuptoolz: prefer locally-available distributions over remotely-downloaded distributions above all
This fixes #1233. Actually the previous patches—[20101103034740-93fa1-9df33552497282eb72a84e5b434d035974bf2dbb] and [20101117080828-92b7f-dc0239f30b26e7e5d40b228114fb399c1e190ec5]—fixed it, but with them zetuptoolz would download a higher-numbered distribution from the net instead of using the locally-available (fake) pycryptopp-0.5.24, thus preventing the tests from passing. This patch changes that behavior (which is an improvement in its own right) and also fixes a bug in the tests.
bundled zetuptoolz: choose a binary dist in preference to a source dist, even if the latter is newer, as long as the former satisfies the requirement
patch by David-Sarah, tiny bugfix to patch by Zooko
ref: #1233
tests: test-with-fake-dists: clean up *just* the pycryptopp-0.5.24 eggs when exiting
also don't set the PATH and PYTHONPATH, which is unnecessary for this test
also wrap the behavior in a couple of functions, just for tidiness
tests: test-with-fake-dists.py has the side-effect of injecting a fake package into ./support, so after that test rm -rf ./support, and likewise with ./pycryptopp*.egg.
setup: when testing, set the __requires__ as precisely as possible even if the version of this particular build of Tahoe-LAFS is not yet known (addresses test failure ref #1190, #1233)
tests: change test-with-fake-pkg to exercise a test suite which actually requires pycryptopp, thus making this a better test which can detect ill-installed pycryptopp
setup: remove --multi-version
It causes copious scary-looking warning messages and I'm no longer sure if it was actually needed to accomplish our goals ref #530.
setup: include pycryptopp in the set of Python packages described in the show-tool-versions step (for cross-referencing with the test-with-fake-dists step, which behaves differently depending on what version(s) of pycryptopp are already present before it starts)
setup: upgrade bundled darcsver from 1.6.3 to 1.7.0
ref #1259, we're going to use its 'versionfiles' setup() keyword argument to specify where to write the version file.
Remember, we have to bundle darcsver to work-around http://bitbucket.org/tarek/distribute/issue/55/revision-control-plugin-automatically-installed-as-a-build-dependency-is-not-present-when-another-build-dependency-is-being
setup: remove separate licensing declaration
Whenever Free Software/Open Source legal folks are examining the Tahoe-LAFS source code, it seems like there has to be a discussion and documentation about every single licensing declaration. Since this one is (was) permissive, then you would think it could be avoided, but I'm not betting on it. We would probably have to install a copy of the MIT licence into every one of the "copyright" files under the debian/ subdirectory, for example. So: let's just let hashbasedsig.py be licensed the same way as the rest of Tahoe-LAFS.
tests: make test-with-fake-pkg's unacceptably-old fake pycryptopp be 0.5.13 instead of 0.5.17, since 0.5.17 is acceptably new on non-x86 archs
Also move the fakepkgs directory to be in misc/build_helpers/ instead of in the base of the source tree.
setup: add platform.machine() to show-tool-versions, because FreeStorm WinXP builder apparently thinks that its platform.machine() is not one of ['i386', 'x86_64', 'amd64', ''], since it is requiring pycryptopp >= 0.5.14 instead of pycryptopp >= 0.5.20
edit docs for English usage, rename "Tahoe" to "Tahoe-LAFS" in docs/configuration.rst, rename a variable in bin/tahoe-script.template for clarity, update François's CREDITS entry
david-sarah [Mon, 1 Nov 2010 00:33:16 +0000 (17:33 -0700)]
allmydata/__init__.py: move the call to require_auto_deps() to the top again, since the [4784] patch turned out not to be the cause of the failure on the 'mm netbsd5' buildslave.
david-sarah [Sun, 31 Oct 2010 15:38:28 +0000 (08:38 -0700)]
allmydata/__init__.py: call require_auto_deps() after importing nevow and twisted, reverting change in [4784]. Also fix a missing 'warnings.filters.pop()'.
setup: run require_auto_deps() before attempting to import any deps in __init__.py
For one thing, this makes missing-dependency failures into DistributionNotFound errors instead of ImportErrors, which might be more useful to the user. For another thing, if someone is using distributions that were installed with --multi-version, then they might be not importable until after require_auto_deps() has been run. (The docs claim that this would be the case, but we don't have an example of this happening at this time.)
setup: show-tool-versions: emit module and __version__ information even when module name != distribution (package) name, and add TwistedCore, TwistedWeb, and TwistedConch
david-sarah [Fri, 29 Oct 2010 23:53:28 +0000 (16:53 -0700)]
scripts/runner.py: remove pkg_resources.require() calls. These are at best redundant because we have already called _auto_deps.require_auto_deps() (from allmydata.__init__) at that point, and they are causing failure of the test-from-prefixdir step on some buildslaves. refs #1190
david-sarah [Fri, 29 Oct 2010 22:31:11 +0000 (15:31 -0700)]
bundled zetuptoolz: if __main__.__requires__ exists then do not add packages to the working set if they provide an incompatible version of a package. Also put a complete __requires__ listing the transitive closure of dependencies at the beginning of generated scripts, rather than a shallow __requires__ specifying only the application version. refs #1190
david-sarah [Fri, 29 Oct 2010 22:28:25 +0000 (15:28 -0700)]
setup.py, misc/build_helpers/run_trial.py: use undocumented __requires__ variable to cause setuptools/zetuptoolz to put the correct versions of dependencies on sys.path. Also ensure that run_trial adds the bundled zetuptoolz egg at the start of sys.path if present. Make the source directory comparison work correctly for the test-with-fake-pkg build step. refs #1190
david-sarah [Fri, 29 Oct 2010 19:18:04 +0000 (12:18 -0700)]
test_runner.py: if the only noise is 'UserWarning: Unbuilt egg for setuptools', skip instead of failing the no_noise tests. This version avoids 'any' to be compatible with Python < 2.5. refs #1235.
david-sarah [Thu, 28 Oct 2010 18:00:46 +0000 (11:00 -0700)]
NEWS: clarify (strengthen) description of what backdoors.rst declares, and add bugfix entries for 'tahoe cp' and Windows console bugs. refs #1216, #1224, #1232
david-sarah [Wed, 27 Oct 2010 04:33:02 +0000 (21:33 -0700)]
make ResponseCache smarter to avoid memory leaks: don't record timestamps, use DataSpans to merge entries, and clear the cache when we see a new seqnum. refs #1045, #1229
tahoe_cp.py: Don't call urllib.quote with an Unicode argument, fix #1224
tahoe_backup.py: Fix another (potential) occurrence of calling urllib.quote()
with an Unicode parameter
Brian Warner [Fri, 29 Oct 2010 08:20:36 +0000 (01:20 -0700)]
fix #1223, crash+inefficiency during repair due to read overrun
* repairer (really the uploader) reads beyond end of input file (Uploadable)
* new-downloader does not tolerate overreads
* uploader does lots of tiny reads (inefficient)
This fixes the last two. The uploader still does a single overread at the end
of the input file, but now that's ok so we can leave it in place. The
uploader now expects the Uploadable to behave like a normal disk
file (reading beyond EOF will return less data than was asked for), and now
the new-downloadable behaves that way.
Brian Warner [Wed, 27 Oct 2010 06:13:42 +0000 (23:13 -0700)]
'tahoe start': use import+call rather than find+spawn
This removes the need to use a locally-built (dependency) bin/twistd, and
removes a big chunk of behavior differences between unix and windows. It
also happens to resolve the "client node probably started" uncertainty.
Might help with #1190, #602, and #71.
setup: catch and log ValueError from locale.getdefaultlocale() in show-tool-versions.py
I got a bug report from Mathias Baert showing that locale.getdefaultlocale() raises an exception on his Mac OS X system. Heh.